Data privacy and AI: what happens to the documents we hand over
Using AI on contracts and confidential documents means deciding where the data goes. The options, from local models to pseudonymization, and what each one costs.

A supply contract, a payslip, an employee’s medical certificate, a confidential offer to a client. Documents like these cross the desks of law firms, accounting firms and company HR departments every day. And documents like these are exactly where an AI assistant comes in handy: it summarizes a forty-page contract in ten lines, finds every termination clause in an archive, compares two versions of the same agreement.
Sooner or later, though, someone stops and asks where those documents end up once they’ve been uploaded.
When the answer isn’t clear, there are two options left: give up, or use AI anyway, maybe from a personal account and without telling anyone. The first means losing a useful tool, the second puts the data at a risk nobody has taken responsibility for. Fortunately, those aren’t the only two options.
What’s inside a document
A lease contains the names of the parties, their tax codes, their addresses, the IBAN the rent is paid into. A personnel file may contain medical certificates, which means health data, one of the categories the GDPR asks to protect most carefully. A sales offer may contain no personal data at all, but it has prices, discounts and terms a company would never want to see circulating.
When these texts are pasted into an external AI service, they leave the organization. They land on the servers of whoever provides the model, which may be outside the European Union, and stay there for a time that depends on the service and the plan: in logs, in conversation history, in some cases among the data used to train later models.
On top of the GDPR, everyone has obligations of their own: professional secrecy for lawyers and accountants, confidentiality agreements with clients and suppliers for companies.
Yet the AI hardly ever needs that data to do its job. To find the termination clauses in a lease, it doesn’t need to know the landlord is called Mario Rossi. It needs to know there is a landlord, there is a tenant, and which of the two can do what.
The options, and what they cost
There are four ways to protect the data, and none of them comes free: each has its own complexity and its own costs. To compare them, let’s take a sentence like this one:
Mario Rossi (tax code RSSMRA80A01H501U) transfers a 30% stake in Rossi Impianti S.r.l. to Laura Bianchi.
Keep everything in-house. The model runs on the organization’s own servers, or in a cloud it controls, and the documents never leave. Nothing needs to be removed: the sentence stays as it is and privacy is complete. The cost is in the infrastructure, because you need machines capable of running a model and someone to manage them. And the largest, most capable models are often only available as an external service.
Redact. The data is blacked out, the way court rulings are before publication:
[REDACTED] (tax code [REDACTED]) transfers a 30% stake in [REDACTED] to [REDACTED].
It’s simple and safe, but for the AI the sentence no longer means anything: you can’t tell who is selling and who is buying, or whether two [REDACTED]s refer to the same person.
Anonymize. Under the GDPR, this means making it impossible to trace the data back to a person by any reasonable means, for anyone, including whoever did the anonymizing. Truly anonymous data falls outside the regulation, but getting there is much harder than it looks: sometimes a single detail (“the only partner in an installation company in Ferrara”) is enough to identify someone. And once the data is anonymized it can no longer be linked back to the people, which is usually something you need.
Pseudonymize. The data is replaced with placeholders:
PERSON_1 (tax code TAX_ID_1) transfers a 30% stake in COMPANY_1 to PERSON_2.
The real data goes into a lookup table kept separately. The text stays readable: the AI understands there is a transfer, who is selling and who is buying, and if PERSON_1 turns up again ten pages later it knows it’s the same person. At the end, whoever holds the table puts the names back. This makes it possible to use even the most powerful external models. The complexity lies in recognizing the data to replace, and we’ll come back to that shortly.
The GDPR defines pseudonymization in Article 4 and mentions it several times as a measure to adopt when designing a system that processes personal data. On one point, though, it’s clear: for whoever holds the table, pseudonymized data is still personal data, because the table makes it reversible. The risk goes down, the obligations stay.
How it works in practice
Take an email that has just reached a company’s purchasing department:
Good morning, I’m writing on behalf of Mario Rossi, owner of Rossi Impianti S.r.l. Mr. Rossi intends to terminate the supply contract by March 31 and asks for the security deposit to be returned to account IT60X0542811101000000123456.
Before it’s sent to an external model, three things happen. The text is searched for data to protect: a name, a company, an IBAN. For each one, a decision is made: the IBAN is redacted, because the AI doesn’t need it, while the name and the company are replaced with placeholders, because they’re needed to understand who is asking for what. And the replacement is consistent: “Mario Rossi” and “Mr. Rossi” are the same person, so they become the same placeholder.
Good morning, I’m writing on behalf of PERSON_1, owner of COMPANY_1. Mr. PERSON_1 intends to terminate the supply contract by March 31 and asks for the security deposit to be returned to account [IBAN].
If we ask the model to summarize the request, it replies with something like “PERSON_1, owner of COMPANY_1, wants to terminate by March 31 and is asking for the deposit back”. Before it reaches the person who asked, the answer goes back through the table, and Mario Rossi and Rossi Impianti S.r.l. reappear on screen.
Put like this it sounds mechanical, but every organization has its own documents and its own data to protect. Besides names and IBANs there are employee ID numbers, internal customer codes, case numbers, license plates, the code name of a project. And a contract is written differently from an email or a medical report. That’s why recognition has to be tuned and customized to each client’s documents: you start from a sample of real documents, decide what needs protecting and how, and check the results before using it for real.
How our agentic document platform works
Our agentic document platform answers questions about the documents of a company or a professional firm. Agentic means it doesn’t stop at a single search: it can open other documents, compare them, and search again with different words until it finds what it needs to answer.
Inside the platform, documents stay in their original form and are used in complete privacy. The platform can be installed in the cloud or on the client’s own servers, and the model runs inside it: in that case the data never leaves and there’s nothing to anonymize. It’s the first of the options we’ve seen.
When a local model isn’t enough, or can’t be installed, the platform connects to external models. At that point it intercepts everything that’s about to leave (the question, the document excerpts, the agent’s intermediate messages) and redacts or pseudonymizes it before sending it. The answer comes back with placeholders, and the platform puts the real data back before showing it. The lookup table never leaves.
Here’s an example. The purchasing department asks: “Which contracts with Rossi Impianti expire by March and include a penalty for early termination?” The agent searches the archive, which holds the original documents, and finds six contracts. The external model only receives the clauses it needs, with COMPANY_1 in place of the supplier’s name. The model compares dates and penalties and answers, and the purchasing department reads the answer with the real names.
In short
Privacy and AI can coexist. The model hardly ever needs to know who the people in the documents are: it’s enough to know they’re different people and what role each one plays. If the model runs in-house, privacy is complete without touching anything, and if an external model is needed, redaction and pseudonymization protect whatever goes out. Which option to choose depends on the documents, where they need to stay and how much you’re willing to invest.
If you have documents like these and want to figure out which option suits you, get in touch: we’ll be happy to talk it through.