How to anonymize data before giving it to an AI
To anonymize data before an AI reads it, replace every name, company, address, email, phone number, ID and bank detail with a neutral tag such as [PERSON_1], and give the same value the same tag everywhere. Check the replacements for anything missed, then send the file. Keep the list of replacements, called a mapping, if you want the real values back in the AI’s answer.
We build GoPrivate, a reversible anonymizer for files, so the last section shows how it handles each step. Everything before that applies whatever tool you use, even a text editor.
What does it mean to anonymize data?
Anonymizing data means removing or changing the details that identify a person, so that the data can no longer be linked to them. In the EU, anonymous data falls outside the GDPR (Recital 26). The bar is high. European regulators expect anonymization to be irreversible, and they do not count pseudonymization as anonymization (Article 29 Working Party, Opinion 05/2014).
Four words get mixed up in practice. They do different things, and only one of them lets you get the original back.
| Method | What it does | Can you get the original back? | What the text shows |
|---|---|---|---|
| Anonymization | Removes or generalizes identifying details for good | No | “A client in Lyon” |
| Pseudonymization | Replaces each value with a tag or code, and keeps the mapping apart | Yes, with the mapping | [PERSON_1] |
| Redaction | Blacks out or deletes the text | No | ████████ |
| Masking | Hides part of a value | No, part stays visible | FR76 •••• •••• 0123 |
For a file you want an AI to work on, pseudonymization is usually the right choice. The AI reads tags instead of names, and you can put the names back in its answer. Under Article 4(5) of the GDPR, pseudonymized data can no longer be tied to a person without extra information, and that extra information is kept separately and protected. Recital 26 adds that pseudonymized data, which that extra information can tie back to a person, should still be treated as personal data. The European Data Protection Board adopted guidelines on pseudonymization in January 2025 (EDPB Guidelines 01/2025). Our article on pseudonymization vs anonymization goes further into the law and the techniques.
In everyday speech, “anonymize” covers all four. This article uses it that way, and says “pseudonymization” where the difference matters.
Why anonymize a file before an AI reads it?
Once you upload a file, what happens to it depends on the provider, your plan and your settings, and those rules change. Two examples, checked on November 24, 2026:
- OpenAI. “ChatGPT, for instance, improves by further training on the conversations people have with it, unless you opt out.” OpenAI does not train on inputs from ChatGPT Team, ChatGPT Enterprise or the API by default (OpenAI, updated March 13, 2026).
- Anthropic. In an update announced on August 28, 2025, Anthropic said it would train new models on chats from Claude Free, Pro and Max accounts when the training setting is on, and keep that data for five years. With the setting off, retention stays at 30 days. Team, Enterprise and API use are not covered (Anthropic).
You can read these pages and pick the right settings. You also have to trust that everyone on your team did the same on every account, and that the rules will not change. Anonymizing first makes these settings matter less. A name that is not in the file cannot be stored, reviewed by a person or used for training. The details by plan are in is ChatGPT confidential and is Claude private, and real cases are in how AI data leaks happen.
What counts as identifying data in a document?
Direct identifiers are the obvious part: names, companies, postal addresses, emails, phone numbers, national ID numbers, bank details, client and case numbers, dates of birth, web and IP addresses. In the US, the HIPAA Safe Harbor method lists 18 types of identifiers to remove from health data, which makes a useful checklist even outside healthcare (HHS).
Indirect identifiers are harder. A job title, an employer and a city can point to one person without naming them. In a 2019 study, researchers estimated that “99.98% of Americans would be correctly re-identified in any dataset using 15 demographic attributes” (Rocher, Hendrickx and de Montjoye, Nature Communications). A contract or an HR file rarely holds 15 such details, but a rare event or a unique role can be enough.
Values also sit in places people forget to check:
- headers, footers and email signatures;
- comments and tracked changes in Word;
- sheet names and hidden columns in Excel;
- the file name itself, such as
Martin_divorce_draft.docx; - short forms of a name: “Ms Martin”, “Claire”, “CM”.
Claire Martin, of Halden & Co, 12 rue des Lilas, 69003 Lyon, agrees to pay the invoice to IBAN FR76 1234 5678 9012 3456 7890 123. Ms Martin can be reached at claire.martin@halden.example.
[PERSON_1], of [COMPANY_1], [ADDRESS_1], agrees to pay the invoice to IBAN [IBAN_1]. [PERSON_1] can be reached at [EMAIL_1].
What are the ways to anonymize data?
For datasets, the classic techniques are suppression (deleting a column), generalization (an age becomes a range), masking, pseudonymization, adding noise to numbers, and generating synthetic data. They suit databases and statistics. For a document you want an AI to read, five practical methods come up.
| Method | Can the AI tell who is who? | Real values back in the answer? | Effort |
|---|---|---|---|
| Find and replace by hand | Yes, if you number your tags | By hand | High, and easy to miss a variant |
| Redaction in a PDF tool | No, every name is the same black box | No | Medium |
| Scripts and libraries (Presidio…) | Depends on the settings you choose | Possible with encryption | High, with code to write |
| A generic anonymizer | Not if every name becomes [NAME] | Depends on the tool | Low |
| A reversible file anonymizer (GoPrivate) | Yes: [PERSON_1], [PERSON_2]… | Yes, in one step | Low, you check the mapping |
Find and replace by hand
Word’s Replace All works for a short document with three names. The trouble is the variants. “Claire Martin” is also “Ms Martin”, “Claire”, “MARTIN” in a table and claire.martin@ in a footer. Miss one and the name goes to the AI. If you choose this route, use numbered tags rather than one placeholder, and keep your list of replacements.
Redaction
Redaction blacks out the text. It is the right tool for a document you publish. It is a poor fit for an AI, because “████ agreed to pay ████ before ████” leaves the AI nothing to work with, and the names cannot come back. A badly made redaction can also leak the text. In January 2019, the redacted passages of a court filing by Paul Manafort’s lawyers could be read by copying them into another document (ABA Judges’ Journal). A black rectangle drawn over text is not a redaction; the tool has to delete the text underneath. Our guide on how to redact a PDF gives the steps in Acrobat and free tools.
Scripts and open-source libraries
Developers can use a library such as Microsoft’s open-source Presidio, which finds personal data in text and can replace, redact, mask, hash or encrypt it. Presidio can decrypt the encrypted values later with the key (Presidio docs). It is flexible and free, but you write the code, tune the detection, and handle Word, Excel and PDF files yourself.
Generic anonymizers
An online anonymizer takes a text and returns it cleaned. Check two things before you rely on one. First, whether each person gets their own tag. If every name becomes [NAME], the AI can no longer tell the buyer from the seller, and its answer is useless. Second, whether you can edit what it found and get the real values back. Without that, you spend the time you saved putting names back into the AI’s answer by hand. We cover that step in how to de-anonymize an AI’s answer.
Asking an AI chat to anonymize the file for you has its own limits: you upload the original with its real names, and the mapping stays in that one conversation. Our article on anonymizing a file with Mistral Vibe goes through them.
A reversible file anonymizer
This is the approach GoPrivate takes, described in the last section: numbered tags, a list you check and edit before anything is replaced, and a swap back once the AI has answered.
How do you anonymize a file for ChatGPT, Claude or DeepSeek?
The steps are the same whatever tool you use.
- List every value to hide. Go through the types above, including short forms of each name and the places people forget.
- Replace each value with a numbered tag. Use [PERSON_1], [PERSON_2], [COMPANY_1], and the same tag for the same value everywhere, including other sheets of a workbook.
- Check the result. Search the anonymized file for a few real names. Look at headers, comments and the file name.
- Tell the AI to keep the tags. Add a line such as: “Keep every tag such as [PERSON_1] exactly as written.” A tag rewritten as “Person 1” is harder to swap back.
- Swap the real values back. Replace each tag in the AI’s answer with the value it stands for, using the mapping you kept.
Our guides on ChatGPT for lawyers, AI for accountants and AI for HR apply these steps to contracts, ledgers and employee data. A temporary or incognito chat does not replace these steps: our article on why ChatGPT temporary chat is not enough explains what OpenAI still keeps. For DeepSeek, whose stored data sits in China, see is DeepSeek safe for work documents.
What does anonymization not protect?
Anonymizing a file reduces what an AI provider receives. It does not do everything.
- Context can still identify. “The only female partner of a 12-person firm in Lyon” needs no name. Rewrite such details if they matter.
- Detection can miss a value. Software and people both miss things, which is why you check the list before sending the file.
- Pseudonymized data is still personal data for you. You hold the key, so the GDPR still applies to how you handle the original and the list.
- It does not replace your own rules. A client contract or a company policy may forbid sending certain documents to an AI at all, anonymized or not. Our article on shadow AI covers the rules a company can set.
How GoPrivate anonymizes files
GoPrivate replaces the names, companies, emails and bank details of a file with tags, lets you use any AI on it, then swaps the real values back. Here is how it handles the steps above.
- Detection. Rules in code find values by their format: emails, phone numbers, IBANs, national ID numbers, web and IP addresses. Mistral AI, a French model provider, finds names, companies, addresses, client and case numbers and dates of birth. Variants of the same person, such as “Claire Martin”, “Ms Martin” and, when it stands alone, “Claire”, get the same tag.
- A mapping you control. Before anything is replaced, you see the full mapping. Remove a line, add a word GoPrivate missed and it finds every place it appears, or rename a tag, for example [PERSON_1] into [CLIENT].
- Replacement by code. Code replaces the values, not an AI, so it rewrites nothing else in the file. In a spreadsheet, GoPrivate works by column: each client in the Client column gets its own tag.
- Swap back. Save the AI’s answer as a file, upload it, pick the mapping, and download it with the real values. Each tag comes back as the full form of the value, so “Ms Martin” returns as “Claire Martin”.
- What is kept. GoPrivate reads your file in memory and keeps nothing once you have the result. Under zero data retention, Mistral keeps nothing once it has answered and does not train on your file. GoPrivate encrypts the mapping and saves it in your account so that you can swap back later, and you can delete it at any time. The privacy policy gives the details.
- Formats and price. Word, Excel, CSV, PDF, text and Markdown files, up to 4 MB. A PDF comes back as a Word file, and GoPrivate does not read scanned PDFs yet. The preview is free. After that, one credit covers 1,000 words, paid once, from $9 for 60 credits. A 20-page contract is about 10 credits. See the packs.
Drop a file below to see a page of it with the names already replaced, before you pay anything.