Skip to content

feat(mask): masking PDP — policy veto + tokenize + BEACON_COMMIT seal#25

Merged
mdheller merged 2 commits into
mainfrom
feat/exodus-masking-pdp
Jul 6, 2026
Merged

feat(mask): masking PDP — policy veto + tokenize + BEACON_COMMIT seal#25
mdheller merged 2 commits into
mainfrom
feat/exodus-masking-pdp

Conversation

@mdheller

@mdheller mdheller commented Jul 6, 2026

Copy link
Copy Markdown
Member

Stacked on #24 (needs exodus_tokenize). Retarget to main once #24 merges.

The masking Policy Decision Point (P1 #5): one enforcement step composing the shipped pieces —

policy veto (no_health_adtech) + exodus_tokenize + exodus_seal → masking-decision.v1

Why it beats passive masking

Every decision carries a policy-decision ref and a signed BEACON_COMMIT receipt (verified in the test via exodus_seal.verify_receipt) — the verifiable-evidence property WKC-style dynamic masking does not produce. Tokens are domain-scoped and cross-domain-unlinkable.

Behaviour

  • deny on forbidden identity mixtures (health + adtech), returns no record.
  • allow_masked applies per-field tokenization-profile transforms (Chameleon / FPE / hash / redact).
  • re_identify is reason-gated + profile-attr gated → governed, audited release.

Tests

scripts/test_exodus_mask.py — 5 dependency-free tests, all green; tokenize (8) + gate tests still pass.

Next: HTTP wiring into the Catalog Gateway read path (prophet-platform, P1 #6).

🤖 Generated with Claude Code

mdheller added 2 commits July 5, 2026 20:28
…reference engine)

Implements the masking-layer desensitisation primitives (the one piece not yet on
main after the gate + sealing PRs landed). Algebraic pseudonym is homomorphic under
re-keying, so domain re-tokenisation and key rotation never touch cleartext:

  token = H(value)^2 ^ k(domain,epoch) mod P;  retoken tweak = k2 * k1^-1 mod Q

scripts/exodus_tokenize.py
  - chameleon_token / domain_tweak / retokenize (domain-scoped, cross-domain
    unlinkable, key-evolving epochs).
  - hmac_pseudonym + build_reid_lookup (governed re-identification dictionary).
  - fpe_encrypt/decrypt (reference balanced Feistel, even-length digits).
  - one_way_hash / redact / generalize / suppress.
  - apply_profile() dispatches by tokenization-profile.v1 scheme.
  - stdlib-only; BLAKE3 opportunistic like exodus_seal.py.

scripts/test_exodus_tokenize.py (8 tests, plain-assert idiom)
  - verifies the 256-bit reference group is a safe prime; determinism;
    cross-domain unlinkability; homomorphic re-tokenisation == native token;
    epoch-rotation consistency; FPE round-trip + format; re-id lookup; dispatch.

Reference impl: production needs >=2048-bit MODP/EC group, constant-time bigint,
HSM-held scalars, and NIST FF1 FPE (documented in the module).
… -> masking-decision

Composes the shipped pieces into one enforcement step (P1 #5), evaluated at
read/export/activate/re-identify time:

  policy veto (forbidden identity mixtures, e.g. no_health_adtech)
    + exodus_tokenize (per-field Chameleon/FPE/hash/redact)
    + exodus_seal (BEACON_COMMIT receipt over the decision)
  -> a masking-decision.v1 record (the decision is itself verifiable evidence)

scripts/exodus_mask.py
  - evaluate_masking(record, requesting_realm, audience, profiles, policy, ...):
    verdict allow / allow_masked / deny / review_required; applies field transforms;
    re-identification is reason-gated + profile-attr gated; emits masking-decision.v1
    with a policy-decision ref + (signed) BEACON_COMMIT receipt.
  - unlinkable-identifier / side-channel mitigations recorded on every decision.

scripts/test_exodus_mask.py (5 tests)
  - no_health_adtech veto (deny, no record returned); allow_masked tokenizes the
    field; re-identify requires reason + authz; signed receipt verifies via
    exodus_seal.verify_receipt; masking-decision.v1 shape.

Depends on exodus_tokenize (PR #24). Gateway HTTP wiring (prophet-platform) is the
remaining P1 #6 integration; this is the reusable PDP engine.
@mdheller mdheller changed the base branch from feat/exodus-tokenization-engine to main July 6, 2026 00:40
@mdheller mdheller merged commit 5c4dcb9 into main Jul 6, 2026
3 checks passed
@mdheller mdheller deleted the feat/exodus-masking-pdp branch July 6, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant