
Pseudonymize PDFs reversibly, keeping the format and storing the mapping table in an encrypted vault, before anything is sent to an LLM. Article 4(5) of the GDPR recognizes this approach as a minimization measure, and the CNIL (in French), France's data protection authority, clearly distinguishes it from irreversible anonymization. A tool that processes the document without keeping it meets that requirement directly.
In short:
- Reversible pseudonymization is the right choice when data must be restored for internal use or a controlled analysis; irreversible anonymization suits external sharing.
- Actually removing sensitive data requires purging the PDF's text layer, not just masking it visually or obscuring it on the surface.
- Implementation needs strict governance: encryption, access control, logging and documentation, to comply with the GDPR and prove traceability.
- A reliable pipeline includes OCR extraction, accurate detection of sensitive entities, replacement with stable aliases, and secure storage of the encrypted mapping.
- A tool that processes PDFs without keeping them removes one more copy you would otherwise have to protect and justify in an audit.
Table of contents
- Reversible pseudonymization or irreversible anonymization: how to decide
- How to pseudonymize a PDF without losing its usefulness
- Which technical traps make pseudonymization ineffective?
- Which checklist to follow when rolling pseudonymization out in production
- What to produce to prove compliance in an inspection
- Why Shadow AI makes this urgent
- Safe-doc: processing sensitive PDFs without storing them
- Further reading
- Sources
- Recommended reading
Reversible pseudonymization or irreversible anonymization: how to decide
The choice depends on a single question: will you need to get back to the real data? If a lawyer has to review a contract after it has been through an AI assistant, or an auditor has to trace a transaction, reversible pseudonymization is the answer. It replaces data with stable aliases and keeps a mapping table that allows controlled restoring. Safe-Doc offers a setup dedicated to legal departments.
Irreversible anonymization suits documents meant to leave the company's perimeter for good, with no way back to the original identities. The CNIL does not require it across the board: it requires minimization, not necessarily irreversibility, and recognizes pseudonymization as a compliant measure in its own right.
Four practical criteria help decide. The first is the need to restore: internal use or a temporary AI analysis points toward pseudonymization. The second is the final destination: public release or sharing with an outside third party points rather toward anonymization.
The last two concern risk. The larger and more linkable the corpus, the more the residual risk of re-identification weighs. And the longer the mapping is kept, the greater the exposure if the vault that holds it leaks. This no-storage design is explained in stateless vs stateful: which architecture to choose.
Recording that choice in the record of processing activities remains the best protection in an inspection.
How to pseudonymize a PDF without losing its usefulness
The workflow that preserves both confidentiality and the document's real use follows a simple logic, but every step counts.
The starting point is an inventory: contracts, HR files and due diligence documents do not call for the same level of care, and they need to be sorted by sensitivity. The second step is text extraction, using optical character recognition for scanned documents; without it, sensitive data stays invisible to automatic processing.
The core of the work is to detect sensitive entities (names, addresses, file numbers, financial data) and then replace them with stable aliases. The resulting mapping, typically in JSON format, ensures that the same person carries the same alias from one related document to the next.
Next, export the pseudonymized version while keeping the original layout, and isolate the mapping in an encrypted vault with restricted access. That version is what you send to the LLM; the output is retrieved, and the real values are only restored in the secure environment, never at the AI provider.
This kind of document preprocessing before a language model ingests anything limits the risk of a leak while keeping analysis workflows working.
Pro tip: Generate one mapping per set of related documents (a client file, a merger) rather than one per isolated file. You gain consistency for cross-document analysis, and you limit the number of vaults to secure.
Which technical traps make pseudonymization ineffective?
A black rectangle drawn on a PDF removes nothing: it hides the text visually, but the underlying text layer can still be indexed and copied. It is the most common and the most dangerous mistake: only a real purge of the text layer, through a proper redaction function, actually removes the data.
Other blind spots deserve equal attention. Scanned PDFs depend entirely on the quality of character recognition: an imperfect rate lets whole identities through without triggering any alert, which justifies manual review of high-risk batches. PDF form fields, with their hidden values and comments, often escape tools that only process visible text.
Electronically signed documents raise an integrity problem: changing the content after signing invalidates the signature. You therefore need to pseudonymize before signing, or work on a copy reserved for analysis. Production metadata (export software, version history) can reintroduce information that the main processing had neutralized.
A pipeline that neglects even one of these points gives the company a false sense of compliance, the worst possible position in an inspection.
Which checklist to follow when rolling pseudonymization out in production
Moving from a pilot to general use requires clear governance, not just a good tool.
The first step is organizational: define roles and access to the mapping, meaning who can view, restore or delete it, and with what approval. On the technical side, flows and temporary storage must be encrypted (AES-256 at rest, TLS 1.3 in transit), and intermediate files deleted automatically after processing.
Then set a retention policy for the mapping, consistent with the real purpose of the processing and never left on default. Detection quality is checked by regular sampling, especially when new document types arrive. Any LLM provider used downstream must sign a data processing agreement with a clause prohibiting training on your data.
A GDPR compliance checklist for PDFs would add encryption, retention periods, logging and eIDAS compliance for signatures. Proof of accountability does not depend on storing the content itself, but on cryptographic fingerprints of the input and output tied to each operation, a distinction the CNIL highlights in its guidance on anonymization.
What to produce to prove compliance in an inspection
A regulatory inspection or an internal audit request is answered with specific artifacts, not statements of intent.
The evidence file rests first on timestamped operation logs, showing who launched which processing and when, and on a cryptographic fingerprint of each input and output document, without keeping the content itself. An exportable audit report summarizes the processing carried out over a given period.
Add the record of processing activities, which documents the purpose, legal basis and technical measures applied, and the criteria that trigger a data protection impact assessment (DPIA), notably the volume processed and the sensitivity of the data categories.
Why Shadow AI makes this urgent
Shadow AI carries on in parallel, often invisible to security teams, because staff and contractors paste sensitive PDFs into consumer assistants without a second thought. Formalizing a traceable pseudonymization pipeline is no longer a methodological nicety. It has become a compliance control as fundamental as encrypting workstations was ten years ago.
Safe-doc: processing sensitive PDFs without storing them

Safe-doc extracts the text of your PDFs, pseudonymizes it and sends it back to you with its mapping table. The original file is not kept, and its metadata (author, software, history) does not go to the AI: what is sent is the protected text, not the PDF.
Because the tool does only that, it is easy to integrate: from the browser for a single document, through the API or the MCP server for a stream of contracts or files. A residual risk report comes with each run. See the security page and the integrations.
Further reading
- Pseudonymizing PDF contracts: the complete guide for legal teams and DPOs
- Document pseudonymization API: the guide for developers and CISOs
- Stateless vs. stateful: which architecture should you choose?