A contract to summarise, an expert report to translate, a staff attendance sheet to tidy up. ChatGPT and the other online assistants do it in seconds. The catch is that those documents contain names, tax codes, IBANs and addresses of people who never chose to end up on the servers of an American provider.
This guide explains how to remove personal data from a document before you upload it, how to put the data back into the answer, and where the method stops working. You can do it by hand, with a text editor and some patience. At the end you'll also find how we do it with PAIS, our app.
What happens to a document when you upload it to an online chatbot?
The text leaves your computer and is processed on the provider's servers. What happens next depends on the service and the type of account: some plans use conversations to train models, others exclude this by contract, and almost all keep the data for a while. The terms change often, so read them on the provider's website instead of relying on memory.
For a firm or an office the question isn't only technical. If the document contains data about clients or employees, uploading it is processing of personal data, with the rules that come with it: a legal basis, a privacy notice, a contract with the provider. Removing the data first reduces what goes out. The rules still apply, though, and it's worth discussing them with your DPO or a lawyer.
Does removing the names make a document anonymous or only pseudonymised?
Only pseudonymised. This is the most common misunderstanding. Article 4 of the GDPR defines pseudonymisation as processing that means the data can no longer be attributed to a specific person without additional information, provided that this information is kept separately and protected. Recital 26 adds that pseudonymised data is still information about an identifiable person.
In practice: if you replace "Mario Rossi" with [PERSON_1] and keep a table that says who [PERSON_1] is, you have pseudonymised the document, you have not made it anonymous. Even without the table, the rest of the text can be enough. "The mayor of a small town south of Rome, admitted to hospital in March" identifies a person better than many tax codes.
For work with AI, pseudonymisation is fine. It's exactly what you need: you want the assistant to understand who does what, and then you want the real names back in the answer.
Which data should you remove first?
The data that directly identifies a person or a company:
- first names and surnames, company names;
- tax codes, VAT numbers, IBANs, card numbers;
- addresses, email addresses, phone numbers;
- dates of birth;
- ID document numbers, number plates, land registry data, internal case or reference numbers.
Then there's the context, which no program removes on its own: very specific roles, small places, dates of events, illnesses described in words, unusual amounts. You have to check these by hand, one line at a time.
One thing people often forget is metadata. The properties of a docx file or a PDF can contain the author's name, the name of whoever made the last change, sometimes the revision history. It happens: you remove the client's name from the text and leave it in the document title.
How do you do it by hand, without special software?
For a short document, a text editor with "find and replace" is enough.
- Make a copy of the document and always work on the copy.
- Open a second file, the mapping table, and save it in a different folder. Every time you replace a piece of data, write the pair there: [PERSON_1] = Mario Rossi.
- Use numbered placeholders and keep them the same for the same person. If Mario Rossi becomes [PERSON_1] on page 1 and [PERSON_3] on page 4, the AI will think they are two different people.
- Replace in this order: names, codes, addresses and contacts, dates of birth, internal numbers.
- Read everything again, looking for context that identifies someone: roles, places, facts. Generalise where needed ("a town in central Italy" instead of the town's name).
- Remove the metadata from the file properties, or copy the text into a new document.
- Only now upload the text to the online assistant.
The weak point of the manual method is fatigue. In a thirty-page deed, a tax code inside a table or a name written in capitals slips through easily. And the mapping table contains exactly the data you wanted to protect: keep it as safe as the original.
How do you put the real data back into the AI's answer?
With the same table, in reverse: copy the answer into a document and replace each placeholder with the original data. The trouble is that the assistant sometimes damages the placeholders. It writes "Person 1" instead of [PERSON_1], drops the brackets, translates them. Before replacing, search for the variants too, or a few placeholders will stay in the final text.
A simple trick: in the prompt, ask the AI to leave the placeholders in square brackets exactly as they are. It doesn't solve everything, but it helps.
Can you automate the work without sending the document online?
Yes, as long as the tool that removes the data runs on your computer. Using an online service to pseudonymise a document, before sending it to another online service, makes little sense. In PAIS this job is done by the ANONIMYZE module, which runs on the Windows PC where it is installed. The procedure goes like this:
- Load the file in phase 1: PDF, docx, Excel, CSV, text, XML and JSON (for example an Italian FatturaPA e-invoice), pptx and odt.
- Open the Review: on the left the list of data found, in the middle the original, on the right the preview with placeholders. Decide item by item what to remove.
- PAIS produces the file with placeholders such as [DFT-PERS-1] and saves the mapping in the project vault, on your PC.
- Read the file again and remove by hand any context that could still identify someone.
- Use it with the online assistant.
- Paste the answer into "Paste and restore": the real data goes back in place, even if the AI changed the case, spaces or brackets of the placeholders.
There is also an irreversible mode, which saves no mapping at all: useful when the document doesn't need to come back. Metadata cleaning is always on.
Two limits, stated plainly. The vault is a file in the project folder and it is not encrypted: anyone who can copy that folder can read the real data, so protect the PC and its backups. And the context stays, because the program replaces names and codes, not roles and facts. For client documents, in our view, you should always use the Review, even when it costs a few extra minutes. ANONIMYZE is part of the PAIS PRO licence.
If you want to try PAIS, you'll find everything on the dedicated page.
Frequently asked questions
Can a pseudonymised document be uploaded online without further checks?
No. It is still personal data and the GDPR keeps applying: you need a legal basis, a contract with the provider and care with transfers outside the European Union. Pseudonymisation reduces what goes out; it doesn't remove the obligations.
What happens if I lose the mapping table?
You can no longer put the real data back into the answer, except from memory. With PAIS the same goes for the vault: to work on another computer you need to copy the projects folder, or export the encrypted map (a password-protected .paismap file).
Does it work with scanned PDFs?
By hand, yes, if you can read the text. With PAIS the text is read with OCR and the result comes out as docx. Pages that are only images can't be covered in the original PDF, and the program tells you so. Signatures and ID documents pasted in as images need to be checked by hand.
Sources
- Regulation (EU) 2016/679 (GDPR), Article 4 and Recital 26, EUR-Lex
- EDPB, Guidelines 01/2025 on Pseudonymisation (version for public consultation)
This article is written partly with the help of artificial intelligence models, starting from the PAIS documentation and the sources listed, and it is reviewed before publication.
