feat(mask): masking PDP — policy veto + tokenize + BEACON_COMMIT seal#25
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #24 (needs
exodus_tokenize). Retarget tomainonce #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.v1Why 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
denyon forbidden identity mixtures (health + adtech), returns no record.allow_maskedapplies per-fieldtokenization-profiletransforms (Chameleon / FPE / hash / redact).re_identifyis 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