← Back to Registry Hub/Site Search/L1 · stage6_security_finops
⚡Flashcard Drill➔
L1S6 · Security & FinOpsVerified: 2026-11-30

Stage 6 · Zero-Data-Retention (ZDR) Gateway & Reversible PII/PHI Redaction Proxy Pattern

Enterprise privacy egress gateway combining hybrid NER/regex PII/PHI detection with ephemeral request-scoped vault tokenization, ZDR-enforced LLM provider endpoints, and streaming placeholder re-hydration inside the customer trust boundary.

Best For

Regulated healthcare, fintech, and legal apps calling external LLM APIs under HIPAA/GDPR/PCI mandates where raw PII/PHI must never leave the private VPC.

Human-AI Boundary

Secrets and payment PANs trigger hard irreversible blocking; only workflow-essential identifiers use short-TTL encrypted in-memory vault mappings for re-hydration.

Anti-Patterns to Avoid

  • Applying irreversible `[REDACTED]` masking to all entities when downstream SQL/API tools or user summaries still require accurate entity linkage
  • Writing unmasked prompts or raw JWT/API keys into observability traces (LangSmith/OTel/Datadog) while only scrubbing the LLM payload

Latency/Cost Profile & Eval Metrics

Presidio ONNX/SpaCy + regex pipeline 18-35ms p95; streaming Trie re-hydration < 2ms · Dedicated CPU/ONNX redaction sidecar + short-TTL encrypted Redis mapping vault (no raw PII stored on disk)

  • PII/PHI Recall & Residual Leakage Rate: >= 99.5% recall on SSN/CC/MRN/API secrets; 0 unmasked secret egress in adversarial red-team runs (Benchmark with synthetic multi-lingual medical/financial adversarial corpus including typos and JSON payloads)
  • Over-Redaction Utility Loss: <= 3% task accuracy degradation vs unredacted baseline via type-preserving pseudonyms (Replace `<PERSON_1>` consistently across conversation turns so model reasoning over entity relationships stays intact)

💰 Business ROI Model & Evidence Level

production_practice

🏗️ End-to-End Architecture Pipeline

Step 1: Hybrid NER/Regex Scrubbing & Ephemeral Vault Tokenization
≤ 35ms

Run regex + ONNX NER over prompts and retrieved chunks, replacing entities with consistent typed tokens stored in an encrypted short-TTL Redis vault.

Step 2: ZDR Endpoint Routing & Observability Log Scrubbing
≤ 10ms

Route solely to ZDR-contracted endpoints (disabling vendor debug logging) and scrub telemetry spans before persistence.

Step 3: Streaming Boundary-Buffered Re-Hydration
≤ 5ms

Verify caller RBAC scope and re-hydrate typed tokens inline via sliding-prefix SSE buffering without breaking streaming smoothness.

🚨 Production Failure Modes & Signatures

  • Cross-turn entity inconsistency (`John` mapped to `<PERSON_1>` in turn 1 and `<PERSON_4>` in turn 2) breaking multi-turn coreference
  • Prompt injection tricking the LLM into transforming `<PII_1>` (e.g. base64 or spacing) so re-hydration fails or leaks mapping behavior

🎤 Interview Defense & System Design Deep-Dive Q&A

  1. How do you handle SSE token splitting when re-hydrating `<PERSON_1>` placeholders in real time without adding noticeable streaming jitter?
  2. Why is turning off vendor training via ZDR insufficient without an in-VPC redaction gateway and telemetry log scrubber?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔

Bidirectional Taxonomy Links

Internal Tools & Primary Sources