Keeping PII out of LLM pipelines
For engineers
Keeping personal data out of prompts, logs, traces and vector stores in LLM apps with redaction, minimization, provider controls, retention and leak tests
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
What is the main benefit of replacing a name with a token like <PERSON_1> before the model call?
Check yourself · 2 of 5
Why is an allowlist of fields safer than a denylist for building a prompt?
Check yourself · 3 of 5
A provider says it does not train on your API data. What can you still conclude?
Check yourself · 4 of 5
A user asks to delete their account. Their chats were also embedded into a vector index with no user_id metadata. What is the problem?
Check yourself · 5 of 5
What is a canary in a PII leak test?
Topics
- Detecting and redacting PII before the model5 min read · Regex, NER and LLM-based detectors such as Presidio, reversible pseudonymization tokens, and the PII they still miss
- Data minimization in prompts and context5 min read · Field allowlists for prompt builders, tool outputs and retrieval results so the model sees only what the task needs
- Provider data controls for API calls5 min read · Zero data retention, abuse-monitoring retention, regional processing, and turning off stored responses and files
- Retention for logs, traces and embeddings5 min read · Where PII lands in an LLM app, from traces and eval sets to vector stores and caches, and how to set TTLs and delete by user
- Testing pipelines for PII leaks5 min read · Seeded canary PII, log and output scanning, and redaction recall tests that run in CI
Start here
- Microsoft Presidio: PII detection and anonymization (opens in a new tab)ToolFree
The open-source analyzer and anonymizer used in the redaction examples, with recognizers and operators.
- LLM02:2025 Sensitive Information Disclosure (OWASP GenAI) (opens in a new tab)StandardFree
Names how LLM apps leak personal data and lists sanitization and access-control mitigations.
- Your data (OpenAI API guide) (opens in a new tab)DocsFree
Shows what an API provider stores, for how long, and which controls (retention, storage flags) you can change.
Helps to know first
110 questions · last verified 2026-12