
Redacting PII before it reaches an LLM lowers the stakes of a breach, but redacted text you can swap back is still personal data. Liam Tengelis covers what GDPR, Quebec’s Law 25 and HIPAA ask for, how accurate open redaction tools are today, and an example architecture that sends an LLM only redacted text.
PII (Personally Identifiable Information) requires special handling: We need to be careful about where we send it and how it is stored.
In the context of AI, handling PII safely matters more than ever: businesses are processing more and more unstructured data while new regulation is being written.
In this article we’ll survey the primary concerns from relevant regulations and walk through how an example AI deployment can be architected to best abide by those regulations.
We’ll also share a PII redaction toolkit your team can use to become familiar with the technical points of redaction.
Key takeaways
The limits of redaction and pseudonymization
We advocate for taking the same precautions with redacted data as you would with unredacted data. The argument is two-fold:
If you retain the original PII from redacted text (in order to swap it back in for example), then this is technically classified as pseudonymized, or tokenized, data. Under GDPR and Quebec’s Law 25, pseudonymized data is regarded identically to personal data, for anyone who can “un-redact” it.
It is impossible to guarantee perfect redaction while still preserving a text’s meaning.

Thus while a PII redaction process is an important risk-minimization step, it’s not a cure-all for your privacy compliance.
Why redact
Redaction’s benefits are best seen in the context of a breach.
Legally, redaction has the following benefits:
A breach of well-redacted data is less likely to be a risk to the people in it, which can mean the affected people don’t need to be told, and possibly not even the regulator
Regulators must take the technical and organisational measures in place into account when deciding on a fine and its size, and the GDPR names pseudonymisation as one such measure
In general, redacting PII is evidence of the kind of care that regulators look for in a data privacy policy. As good stewards of our customers’ personal data, redaction is a minimum protection we can offer them, even if technically imperfect.
The relevant regulatory concerns
Depending on the regions you operate in, different regulations will legally dictate the specifics of how we must handle personal information. There are key principles behind all such regulations though, and we would encourage thinking in terms of these principles instead of any particular regulation’s criteria.
Regulatory frameworks, in general, have the following concerns:

Sources for this table
GDPR: full text (also cited for pseudonymisation and encryption, the 72-hour deadline and unintelligible data); 2025 EDPS v SRB ruling; Art. 5, Art. 28, Art. 30, Art. 35, Art. 37, Art. 44, Art. 45, Art. 46
Quebec Law 25: full text; overview; 2024 anonymisation regulation
HIPAA (45 CFR): 160.103, 164.306, 164.308, 164.402, 164.404, 164.406, 164.408, 164.502, 164.504, 164.506, 164.508, 164.514, 164.520, 164.524, 164.526, 164.528, 164.530; HHS FAQ on data location; HHS encryption standard
EU AI Act
The EU AI Act doesn’t introduce any personal-data specific requirements directly. One potentially relevant aspect however for “high-risk” systems is that logs of decisions made by AI are required to be kept for at least 6 months (Article 19 for providers, Article 26 for deployers). Redaction is basically the only solution to satisfy both this requirement and GDPR requirements for storing personal data .
A survey of redaction technology
We’ve published the code to a ‘PII Toolbox’ that we’ll use to illustrate the relevant technical concerns in PII redaction / tokenization.
How to evaluate a redaction system
Consider the two competing concerns of a redaction system:
Utility of the redacted text
Redaction coverage
Thus we measure the quality of a redaction system through its:
A) Recall - the % of actual PII that is redacted
and
B) Precision - the % of redacted text that was actually PII
Since it’s generally preferable to err on the side of over-redaction, as a single metric for redaction system quality, we recommend the F2 score of Recall to Precision, which treats Recall as twice as important as Precision.

Structured forms
Structured PII like emails or card numbers are relatively straightforward to detect with deterministic rules and regular expressions. Here are some common structured forms we might need to redact:
Bank account numbers
Driver’s license numbers
Social insurance numbers
Phone numbers
Email addresses
Dates of birth
Credit and debit card numbers
Health insurance and patient ID numbers
Postal codes and addresses
Some of these PII types even have checksums we can use to be almost certain that we have correctly identified them. With that being said, the possibility of typos means that even for such well-structured PII types, we can not guarantee perfect redaction.
In our toolbox, we use Microsoft Presidio for structured PII redaction. You can find example redaction rates and performance rates here.
On two synthetic test sets, Nemotron and Gretel, Presidio found at least 92% of every structured type we tested, except SWIFT/BIC codes, which it almost never found.
Presidio is cheap to run, with a peak memory of 0.45 GiB at a rate of 0.003 seconds per 1,000 characters.
Unstructured forms
Unstructured PII forms include:
Names
Addresses
Occupations
These have no reliable deterministic method of detection, although we can use ‘hints’, like names of all known users of a given system, to improve our redaction rate. Ultimately however, the unpredictability of unstructured data requires us to rely on language models for robust unstructured PII detection.
In our toolbox, we compare the redaction rates and resource requirements of some good small model options. All these options fit comfortably within AWS Lambda’s 10 GB memory limit, peaking at 2.78 GiB at most, but have varying redaction performance, especially when it comes to name detection.
Identity linking
To maximize the usefulness of tokenized text for an LLM, it’s important that references to the same person are still identifiable as the same person in the tokenized text, even if the name isn’t duplicated. For example, “David” might simply be “him” later on in a document. This motivates the use of another language model for the purpose of coreference resolution. The toolbox uses Maverick, a coreference model, followed by a nickname step that links short forms such as “Dave” to “David”.
With a ‘coreference layer’, GLiNER + Presidio correctly resolved differently mentioned identities 80% of the time, vs 3% of the time without. You can find the full results here.

What accuracy rates to expect
Names, places, organisations and dates
We tested four language models on two test sets:
TAB is English court judgments from the European Court of Human Rights, whose names are mostly European
Worldwide is English newswire from around the world, with many non-Western names
The scores use relaxed matching: a detection counts if it has the right type and covers at least half of the right text.
F2 by type (full table):

Emails, phone numbers, card numbers and bank details
We tested Presidio on two synthetic datasets:
Keep in mind that synthetic data is likely cleaner than real production data.
Share of each type that Presidio found (recall):

Cost

Example
To make this concrete, let’s consider an example scenario:
Suppose a European online retailer wants an LLM to draft replies to customer support emails. The emails contain names, postal addresses, phone numbers, email addresses and potentially other PII.
Here is a simple architecture that sends only tokenized text to the LLM:

What still applies after redaction
Because we keep the placeholder map in order to swap names back in, the redacted text is pseudonymised data, and under GDPR pseudonymised data is still personal data. So the following all still apply:
A written contract with the provider.
Where the data is processed. Use a deployment in an EU region, which keeps prompts and responses in the EU.
Purpose limitation and minimisation. Send the model only what it needs to perform its task, and nothing more.
Retention. The map should be kept only as long as the ticket needs it.
Breach notification. A leak of the redacted text at the provider is still a breach, but with the identifying details replaced, it is far less likely to require telling the regulator or customers. The placeholder map is what would make a leak serious, so if persisted, it should be encrypted.
Conclusion
Redaction lowers the stakes of a breach, but it is not a cure-all for private data handling. Maintain discipline with the handling of redacted data, and continuously evaluate your redaction system in production. We hope this article has given you the tools to do so confidently.
Tell us what you're working on.


