A product manager asks in Slack: can we just paste support tickets into GPT-4 to summarize them? Sure, except those tickets have names, emails, phone numbers, and the occasional partial card number a frustrated customer typed into the wrong field. One engineering team's answer to that question turned into a two-week build, according to a Medium writeup from someone who lived through it. That gap — between "works in the demo" and "works when real tickets hit it" — is the whole topic.
Find-and-replace is a liability, not a control
The instinct everyone has first is [REDACTED]. Swap the name, swap the email, ship it. It fails in two specific ways, laid out clearly in a DEV Community guide: if a prompt mentions two different people, both become identical [REDACTED] tokens and the model loses track of who did what. And because the replacement is non-unique, you can't map it back — the output can't be de-redacted into something a human agent can actually read.
The fix the same source lands on is consistent, entity-aware tokenization: swap jane@example.com for something like <EMAIL_1>, keep a short-lived lookup table mapping token to real value, let the model reason over tokens, then swap the real values back into the response before a human sees it. It's a small amount of code — a dict, a regex pass, a reverse pass — but it's the difference between a system that preserves relational context and one that silently corrupts it.
The regex-only approach has its own ceiling, though. The Medium piece is blunt about it: an email pattern catches structured data with near-zero false negatives, but names are a different animal. "John called about his order" is PII. "John Deere tractor parts" is not. Regex can't tell. The team that wrote it up landed on a three-stage pipeline — regex for the deterministic stuff, a NER model for the fuzzy stuff, and a human review queue for whatever neither one is confident about. That third stage is the one teams skip when they're trying to ship fast, and it's usually the one that catches the case that would've made the incident report.
The prompt is the smallest leak surface, not the only one
Here's where most teams stop thinking too early. A checklist from Origin Data Partners makes the case that if your system runs agents or tools, PII doesn't just live in what the user typed — it lives in tool arguments, tool results, reasoning traces, and environment dumps, because "an agent copies whatever its tools return into the trace." A CRM lookup returns a full customer record; the model only needed one field, but the whole record is now sitting in a trace that goes to a logging vendor. Nobody typed that PII, so any filter scanning the user's input never sees it.
A guide from LLMOpsGuide frames this as six separate leak points — the prompt itself, logs and traces, caches, retrieved documents, tool results, and fine-tuning datasets — each with its own readers and its own retention. Redacting the prompt doesn't redact the log line written before your check ran. A shared semantic cache can hand one user's redacted answer to a different user entirely if the cache key collides. The same source notes that as of November 2026, OpenAI retains abuse-monitoring logs — which may contain prompts — for up to 30 days by default, which is a reminder that "we redact before sending" only covers one leg of the trip.
The operational implication: you don't buy one redaction library and call it done. You need redaction (or at least a decision — block, mask, or tokenize) applied separately at each of those six points, because they have different readers and different lifespans. Thoughtworks built an internal proxy, described in their engineering blog, that runs PII scrubbing as a fail-closed stage in a routing pipeline — if the scrubber errors, the request halts instead of going out unredacted. That's the right failure mode. A redaction layer that fails open is worse than no redaction layer, because it gives you a false sense that the control exists.
Tokenized data is still personal data, legally
The part teams reliably get wrong is thinking redaction equals compliance. A TextLayer guide is specific about this: if you keep the mapping so you can restore real values later, that's pseudonymized data, and under GDPR and Quebec's Law 25, pseudonymized data gets treated the same as personal data for anyone who holds the key to un-redact it. Your lookup table is now itself a regulated asset — it needs its own access controls, its own retention limit, its own audit trail. Teams that build a slick tokenization layer and then stash the mapping dict in a long-lived Redis instance with no TTL haven't reduced their compliance surface, they've just renamed it.
The practical takeaway isn't "redact everything perfectly" — the TextLayer piece is upfront that perfect redaction without destroying meaning is impossible. It's that redaction is a risk-minimization step regulators credit you for, not a line you can cross off. Treat the token map with the same seriousness as the data it stands in for, log every redaction decision the way the Origin checklist recommends, and build the fail-closed habit into whatever gateway sits between your app and the model provider. The teams getting burned aren't the ones with imperfect NER models — they're the ones who redacted the prompt and stopped there.
