L0S2 · Data & RetrievalS6 · Security & FinOpsVerified: 2026-11-17
Presidio Reversible PII/PHI Redaction & Token-Map Gateway Primitive
Boundary privacy primitive combining Presidio NER + deterministic checksum recognizers to mask PII/PHI/secrets into deterministic placeholders before external LLM calls or vector writes, rehydrating answers strictly inside trusted enclave boundaries.
Best For
HIPAA/GDPR/PCI-regulated enterprise AI gateways forwarding sensitive workflows to external commercial model APIs.
Human-AI Boundary
Ephemeral token-vault maps live solely in short-TTL tenant-scoped memory; raw PII never enters log shippers.
Anti-Patterns to Avoid
- Writing raw unredacted customer SSNs, API keys, or patient MRNs into vector DB payloads or third-party observability traces
- Persisting reversible PII lookup tables in long-lived shared caches without per-session TTL and tenant isolation
Latency/Cost Profile & Eval Metrics
Regex/Checksum 1–4ms + Small NER ONNX < 18ms P95 on CPU · Zero LLM token overhead; dedicated CPU inference pool
- PII Recall on Annotated Domain Emails/Tickets: >= 0.99 recall on SSN, credit cards, MRN, and auth secrets (Treat false negative (leak) as 20x costlier than benign false positive masking)
💰 Business ROI Model & Evidence Level
production_practiceUnlocks frontier commercial LLM APIs for regulated datasets without breaching compliance—saving weeks of InfoSec sign-off and six-figure self-hosting GPU overhead.
⚖️ Engineering Trade-Off & Decision Matrix
Reversible Request-Scoped Vault Redaction
When to Use: Internal agent UX where authorized staff need real entity names restored post-inference.
Trade-Off: Requires short-TTL vault state and semantic placeholder typing (`<COMPANY_A>`).
Irreversible One-Way Hashing / Scrubbing
When to Use: Offline fine-tuning corpora and anonymized benchmark suites.
Trade-Off: Zero re-identification risk at the cost of non-reversibility.
🛡️ Compliance & Governance Hard Constraints
- Dual enforcement: mask both ingestion chunks before embedding AND runtime user prompts/tool results
- Zero plaintext PII persistence in LLM trace exporters (OpenTelemetry / Langfuse)
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
Bidirectional Taxonomy Links
[L1] Stage 5 · Production Trace-to-Golden-Dataset Failure Flywheel Pattern[L1] Stage 6 · Indirect Prompt Injection Firewall & Ephemeral MicroVM Sandbox Pattern[L2] L2 Scenario · Enterprise Legal Contract Redline & Risk Clause Auditor[L3] Capstone: Multi-Tenant RBAC, Incremental CDC & Semantic Cache RAG Hub[HubB] Role Lens · Forward Deployed Engineer (Enterprise AI Delivery & Solutions)[L0 Card] Prompt Injection Defense[L0 Card] Multi-Tenant Partitioning & RBAC[L0 Card] Distributed Tracing & Observability
Internal Tools & Primary Sources
- Microsoft Presidio — Data Protection and De-identification SDK (official_docs, 2026-11-17)