PII redaction
Removing or masking personal data, such as names, emails and ID numbers, before text reaches a model, a log or a third party.
PII redaction is removing or masking personal data, such as names, emails and ID numbers, before text reaches a model, a log or a third party. A detector replaces each item with a placeholder such as [EMAIL_1], and the mapping stays on your side so answers can be filled back in.
Detection combines patterns for emails and numbers with a model for names and addresses; Microsoft’s open-source Presidio is a common starting point. It lowers the data sent to model providers and kept in traces. Detection is never complete: names in unusual forms and data in attachments slip through, so it reduces risk rather than removing it. Under GDPR, masked data whose mapping you keep is pseudonymized, and pseudonymized data still counts as personal data.
Use it together with a data processing agreement and zero data retention from the model provider; each covers gaps the others leave. Where the model needs the real value, such as a reply addressed by name, redact the logs and pass the value only to the call that needs it. Redaction rules are a typical control written into AI governance and an AI acceptable use policy for tools that touch customer data.
Sources
- Microsoft: Presidio: data protection and de-identification SDK data-privacy-stack.github.io
Related terms
- Zero data retention (ZDR): An arrangement in which an AI provider does not store your prompts and outputs after returning the response, beyond what is needed to serve it.
- GDPR: The EU regulation on personal data: lawful basis, minimal data, user rights and breach reporting, for anyone handling EU residents’ data.
- Guardrails: Checks around a model that block, fix or flag inputs and outputs that break the rules.
- Data processing agreement (DPA): The contract GDPR requires when a vendor processes personal data on your behalf: what, why, how it is protected, who else gets it.
- AI governance: The rules and roles that decide which AI a company uses, on what data, with what checks: policy, inventory, risk tiers, approvals and monitoring.
- AI acceptable use policy: A short company rulebook for staff: which AI tools are approved, what data may go into them, how output is checked and when AI use must be disclosed.
- Data classification gate for agents: A check that keeps secrets, personal data and other restricted data out of what a coding agent can read, send to a model or write to logs.
