Pseudonymising data before sending it to an LLM
Stripping names from a prompt does not make it anonymous. Before sending data to an external model, the realistic goal is to pseudonymise it: replace identifiers with tokens and keep the mapping table on your side. This guide describes the method, its limits and where it fits among your usage rules.
Updated October 8, 2026
What the law says, in brief
Pseudonymised data remains personal data for whoever holds the mapping table; only demonstrated anonymisation takes data outside the scope of the GDPR. France's Conseil d'État made the point on 13 February 2026 in the Cegedim case: identifying a patient only by a code does not make the data anonymous when other details make it possible to re-identify them.
When sending data to a language model, one detail matters. When the provider processes the data on your behalf, whether it is personal is assessed from your perspective, according to the draft Guidelines 02/2026 of the European Data Protection Board (EDPB): tokens therefore do not take the prompt outside the GDPR on the provider's side. Definitions, criteria and case law are covered in the guide Anonymise or pseudonymise: what the law says.
Why a prompt is hard to anonymise
To judge anonymisation, European authorities apply three criteria, set in 2014 and being updated in draft EDPB guidelines put to consultation in 2026: it must no longer be possible to isolate a person, to link information about them across datasets, or to infer new information about them.
Free text often retains clues that can identify a person. Remove the name from an email and the job title, the department, the city, a date or an event may remain. “The finance director at the Lyon site, on sick leave since March” is often enough to point to a single person in a company. A language model is also capable of piecing these clues together.
There is also the intended use to consider. Names sometimes have to be put back, to address a letter to the right person or name the parties in a case summary. Anonymisation, being irreversible by definition, prevents this. Pseudonymisation is therefore often better suited to these uses, provided its limits are understood.
A pseudonymisation pipeline before sending
To pseudonymise data before calling the model, proceed step by step and keep the mapping table within your environment.
- DetectFind the direct identifiers in the prompt and in the document context: names, email addresses, phone numbers, postal addresses, national insurance numbers, IBANs, contract numbers.
- Replace consistentlyThe same person gets the same token throughout the request, so the model can follow the reasoning.
- Keep the mapping table locallyThe table is stored in a vault, within your perimeter, with restricted access.
- Send and restoreThe model works on tokens; the original values are restored on your side, in the answer received.
- Log without the plain textLogs keep the pseudonymised version, never the original prompt in plain text.
What automatic detection misses
No detector is exhaustive. In particular, detection misses:
- Indirect identifiers: job title, department, place, date, rare event. These are what enable re-identification, and they match no known format.
- Special-category data spelled out: “being treated for cancer”, “union representative”. No name, but special-category data under Article 9 GDPR.
- Unexpected formats: typos, internal identifiers, rare or foreign names, text extracted from a scanned document.
Pseudonymisation must therefore be backed by usage rules. For special-category data and the most confidential files, prefer a model run locally, even after pseudonymisation.
Choosing by use
| Use | Suitable technique | What the external provider sees |
|---|---|---|
| Generic drafting, market and technology watch, non-sensitive code | None, no personal data | The text as is |
| Customer correspondence, routine case summary | Reversible pseudonymisation | Tokens and indirect identifiers |
| Statistics, test datasets, training | Anonymisation, checked against the three criteria | Aggregated or transformed data |
| Health, sensitive HR files, litigation | Local model, nothing sent out | Nothing |
This table applies, for personal data, the mapping described in the guide Data sovereignty and generative AI. Questions of legal basis and impact assessment are in the guide GDPR and generative AI, and exposure to foreign laws in the guide The Cloud Act and AI.
Frequently asked questions
Does the model provider still receive personal data?
Yes, in most cases. It receives tokens in place of direct identifiers, but also the rest of the text, with its indirect identifiers. Moreover, when it acts on your behalf, under the EDPB's draft guidelines, whether the data is personal is assessed from your perspective: it remains personal for the provider. A data processing agreement is therefore still required, as are transfer safeguards if the provider is outside the EEA.
Is replacing names enough to anonymise a text?
No. Free text contains indirect identifiers (job title, place, date, event) that often make it possible to find the person. The result is at best pseudonymised, and must be treated as personal data.
Can pseudonymised health data be sent to an external model?
Pseudonymisation reduces the risk, but automatic detection does not catch every health reference written out in words. For such data, a model run locally remains the safest option, and the impact assessment must address the question explicitly.
Where SmartAGT fits
In hybrid mode, SmartAGT's privacy vault detects direct identifiers and reversibly pseudonymises them before data is sent to an external provider's model. The mapping table stays within your perimeter, and no prompt in plain text reaches the audit log.
For the most sensitive uses, the model can run entirely within your infrastructure, with no outbound traffic at all. Details are on the Security page.