Home

/

Keep PII Out of Your LLM

/

Week two: the chokepoint and the fast layer

Week two: the chokepoint and the fast layer

Chapter 17
Part V
5
min read

Week two: the chokepoint and the fast layer

Stand up the gateway. Chapter 13. Start as a library if you must, but define the policy shape, the audit record, and the failure mode now, because retrofitting those is painful.

Add the deterministic layer. Chapter 5. Luhn, ABA routing, NPI, and the identifiers you actually handle. In-process, 0.1 ms, no dependencies. It catches your highest-consequence entities at near-certainty, and it becomes the degraded mode when the detector is unavailable.

Redact at the log sink using that same layer. Chapter 16.

Add the output filter. Chapter 13's host allowlist for markdown images and links. Small, and it closes the door EchoLeak used.

End of week two, the highest-consequence identifiers are handled deterministically and every model call passes through one place you control.

Week three: the sidecar and the round trip

Deploy the detection container with Chapter 14's controls applied from the start: TLS, read-only filesystem, no egress, non-root, pinned digest, logging off. Applying them later means a migration.

Wire the round trip. Chapter 9. De-identify, call, re-identify, with the round-trip invariant test, because a 64% reversibility pass rate is a real result from a real benchmark.

Fail closed. Chapters 9 and 13. Decide per route, record the decision in policy, count the degradations.

Build the golden set. Chapter 7. Two to five hundred labelled samples from your own traffic, handled with the care Chapter 7 describes. Score it, choose thresholds per entity, commit the floors to CI.

This is the heaviest week. It is third rather than first because everything before it reduces how much this layer has to catch.

Week four: evidence, and measure again

Turn on the audit record. Counts and types, never content.

Re-run the golden set and record the numbers with their date. This is artefact 3 and it now runs on every build.

Run the task quality comparison from Chapter 10. Fifty examples, treated and untreated, read side by side. Find out whether your controls broke the feature before a user does.

Write the data flow record and the minimisation argument. Mostly assembly, because the inputs already exist.

Book the recurring reviews. Re-measure the golden set quarterly. Review the sidecar's provenance and patch level quarterly. Re-verify provider terms quarterly, with dates.

What you have after thirty days

Prompts carry only the fields the task needs. Every call passes through one chokepoint with versioned policy. Structured identifiers are caught deterministically at near-certainty. Names and free text are caught probabilistically by a detector you host, whose actual performance on your data you can state with a number and a date. Real values never reach the provider, and the mapping never leaves your infrastructure. Logs are redacted and short-lived. The output is filtered. The audit trail proves it.

You will not have solved this. Chapter 4 is clear about why: cross-domain detection lands around 0.5, and yours will too. What you will have is a system where a detection miss is survivable, because the field was probably never sent, the value was probably a token, the blast radius was probably one record, and you can prove all three.

That is the achievable goal. Anyone offering you more than that is selling the demo number.

Detection is a net, not a wall.

Keeping it running

The uncomfortable part is that none of this is finished. The detector drifts as your traffic changes. The container ages faster than the model inside it. Provider terms move, twice a year on recent evidence. New features get built by developers who were not in the room for any of this, and the marker interface only protects the paths someone remembered to route through it.

Chapter 14 drew a line and said complete hardening is a different body of work. The same line applies to the whole system. Building this takes a month. Running it takes attention, indefinitely, from people who keep the context.

If that is work your team should own, own it. The book is deliberately specific enough to implement without help.

If it is work you would rather have delivered and maintained by engineers who do this regularly, that is what You-Source Dev on Demand is for: subscription engineering, delivered as small, scoped tasks with a cadence and visible accountability, instead of a hiring round or a consultancy engagement. The sensible way to start is a Proof of Quality: pick one real task from the thirty-day plan, have it delivered, and judge the work before committing to anything. Details at you-source.com.

Don't detect what you can refuse to send.

Sources for this chapter

  • EU AI Act Article 50 transparency obligations, applicable 2 August 2026 — https://artificialintelligenceact.eu/implementation-timeline/
  • DPIA requirement for high-risk processing — GDPR Article 35. Risk assessment and automated decision-making obligations under CPRA regulations effective 1 January 2026 — see the state trackers cited in Chapter 16.
  • All quantitative claims restated here (cross-domain detection around 0.5, the demo gap) are sourced in Chapter 4.

The five evidence artefacts and the four-week sequence are the author's recommendation. The ordering follows the book's argument that minimisation is cheaper and more effective than detection; it is not derived from a published framework.

the-leak-you-cant-see
blast-radius
what-counts-as-pii
the-five-doors
the-accuracy-reckoning
the-hybrid-that-does-not-work
deterministic-detection
npi-in-c
the-three-way-choice
calling-the-analyzer-from-c
measuring-your-own-demo-gap
choosing-the-operating-point
the-ladder-of-safeguards
pseudonymisation
the-round-trip
restoring-safely
when-masking-breaks-the-task
plausibility-hazard
the-architecture-that-holds
the-reference-architecture
dont-send-it-at-all
structure-beats-prose
the-gateway
failure-is-a-policy-decision
the-sidecar-you-can-trust
egress-deny-it-at-the-network
rag-and-agents
de-identify-before-you-embed
dual-model-separation
the-boring-controls
evidence-and-the-first-thirty-days
week-two-the-chokepoint-and-the-fast-layer
entity-catalogue-and-c-validators
mbi-positional-rules
tooling-at-a-glance
azure-ai-language-pii-in-detail
container-trust-checklist
sources
azure-ai-language
provider-retention

Download the full PDF for free?

Free download — no account required

Get the PDF
Get the PDF
Related Chapters
Free Download
Get the full PDF
All pages, including all code examples, diagrams, and the appendix reference card.
No spam. Unsubscribe at any time.
Your email won't be shared.
Oops! There's a problem with your request. We're working on fixing it. Please try again later.