On PII redaction for LLMs, the real cost of self-hosting detection, and the design choices behind the API.
What auditors look at when an LLM feature touches regulated data, and how redact-and-rehydrate maps to data minimization, retention, and DPA obligations.
GLiNER is a clever zero-shot NER model. We use it. But generic NER misses structural PII like cards, IBANs and tax IDs, and can't do the LLM round-trip.
Wrap a LangChain chain or agent with redact and rehydrate steps so the model never sees customer data. Working code for LCEL and legacy runnables.
The four-step pattern (detect, redact, prompt, rehydrate) that keeps personal data out of OpenAI, Anthropic, and Gemini calls without breaking UX.
Where Microsoft Presidio fits, what it costs to run yourself, and when a managed PII redaction API is the better alternative for an LLM pipeline.