All articles

How to Anonymize a Legal Document Before Using AI

· 6 min read

To anonymize a legal document before using AI, work on a copy, remove every name, address, number and clue that points to a person, and check the result before you send it. Replacing names with labels is only pseudonymization, which still counts as personal data under the GDPR.

This article is general information, not legal advice. Always follow the rules of your bar or chamber and your own office policy.

Why should you anonymize a document before using AI?

Two things are at stake.

Professional secrecy. Notaries, lawyers and other legal professionals owe their clients confidentiality. Sharing a client's file with an outside service can be a problem, even if the service is useful. Your professional body may have rules on this, so read them.

Data protection (GDPR). Names, addresses, ID numbers and similar details are personal data. The GDPR sets rules on who may process them and why. If a document contains no personal data, those rules do not apply to it. That is the main reason to anonymize first: less personal data goes out, so less can go wrong.

What is the difference between anonymization and pseudonymization?

These two words are often mixed up, but under the GDPR they are not the same.

  • Anonymization means nobody can identify a person from the data anymore, by any reasonable means. The link to the person is gone for good. Anonymous data is not personal data.
  • Pseudonymization means you replace identifying details with a code or a label, for example "Client A" or "Buyer 1", and you keep a separate key that links the code to the person. The GDPR is clear that pseudonymized data is still personal data, because someone can reverse it.

In daily work you will often do pseudonymization: you swap names for labels, keep a key in your own file, and put the real names back in the AI's answer. That is fine as a working method, but do not call it anonymization, and do not treat the result as free of personal data.

True anonymization is harder than it looks. A rare job title, a small village and a date can point to one person, even with the name removed.

What should you remove from a legal document?

Go through the document with this list.

  • Names of people, companies, associations and trusts. Do not forget names inside signatures, stamps and letterheads.
  • Addresses, including the street, the number and often the town if it is small.
  • Dates of birth, and places of birth.
  • National ID numbers, passport numbers, tax numbers and social security numbers.
  • Bank account numbers (IBAN), card numbers and other account references.
  • Email addresses and phone numbers.
  • Case and file numbers, including your own office's references and the court's.
  • Land register references, plot numbers and property descriptions that point to one place.
  • Amounts when they could identify someone, such as an exact price for a known property or an unusual sum.
  • Signatures and handwritten notes.
  • Indirect clues. A job title, an employer, a rare family situation, a date of death or a news story anyone could link to the person. Ask yourself: could someone who knows the people involved guess who this is?

How do you anonymize a document by hand?

If you do this by hand, work in a copy, never in the original.

  1. Copy the document. Keep the original untouched and unshared.
  2. List what must go. Read the whole document once and write down every name, number and clue from the list above. Include variants: "Mr. Dupont", "Dupont", "M. J. Dupont".
  3. Choose a label for each. Use clear labels like "Seller", "Buyer", "Property 1". Keep the same label for the same person all through the document.
  4. Replace each item. In Word, use find and replace, and check every hit. Do not use "replace all" without looking.
  5. Check the headers, footers and footnotes. Find and replace often skips them, or treats them differently.
  6. Clean the file itself. Remove comments and tracked changes, and then check the document properties for the author name and the title.
  7. Save in a safe format. If you export a PDF, make sure the text is really gone and not just hidden.
  8. Keep the key apart. If you used pseudonyms, store the key in a separate file with the client's file, not with the anonymized text.

The limits of doing it by hand

Manual anonymization takes time, and it fails in quiet ways. These are the usual traps.

  • Scans and photos. Find and replace cannot see text inside an image. A scanned page stays fully readable.
  • Headers, footers and text boxes. A name in a header on page 12 is easy to miss.
  • Metadata. Word and PDF files carry the author, the office name, the file path and sometimes earlier versions.
  • Tracked changes and comments. The old text can still sit in the file, even if you cannot see it on screen.
  • Black boxes in PDFs. Drawing a black rectangle over a name does not remove the name. The text is still underneath, and anyone can select it and copy it. The text must be deleted, not covered.
  • Spelling variants. "Müller", "Mueller" and "MULLER" are three different strings for a search tool.
  • Long documents. After page 40, people get tired and miss things.

How do you check that a document is really anonymous?

Never trust a single pass.

  • Search for what you removed. Try every name, every first name, every number and every variant.
  • Try the copy test. Open the PDF, select all, copy, and paste into a plain text editor. If a name shows up, it was only covered.
  • Look at the metadata. Open the file properties and check the author and title fields.
  • Read it as a stranger. Read the final text and ask whether you could work out who is meant from the clues that are left.
  • Ask a colleague. A second pair of eyes finds what you stopped seeing.

When should you not use AI at all?

Sometimes the best choice is to keep the document away from AI tools.

  • When the facts themselves identify the person, so that no amount of editing can hide them.
  • When your bar, chamber or office policy forbids it.
  • When the client has asked you not to, or has not agreed.
  • When the document is highly sensitive, for example in a criminal case or a family matter with a vulnerable person.
  • When you cannot check the result with enough care.

If in doubt, ask your professional body or your data protection officer before you send anything.

How Acta can help

Doing all this by hand for every file is slow. Acta is a web app for notaries, lawyers and law firms, and its Anonymization feature does the first pass for you. It finds personal data in 13 categories (some, like prices and reference numbers, start switched off) and hides the words your office lists as always to be hidden. Scanned pages and photos are read with OCR, and a PDF with even one scanned page is redrawn as a whole, so no page keeps visible personal data.

You then review the work on the document page. You see every removed item, you can keep some visible, add more words (typed, or selected in the viewer) and apply the changes. The original can be viewed in Acta but not downloaded. A person should always check the result, as no tool is perfect.

Acta runs on a server in Germany and uses OpenAI's models for its AI features, including finding the personal data. Each office's data is private to its workspace. Acta is free during the pilot. If you want to see how it works on your own kind of documents, request a demo.

Frequently asked questions

How do you anonymize a legal document before using AI?
Work on a copy, never the original. List every name, address, number and indirect clue, replace each one with a clear label or remove it, check headers, footers and file properties, and then search for everything you removed. A person should always check the final result.
What is the difference between anonymization and pseudonymization?
With anonymization, nobody can identify a person from the data anymore, so it is no longer personal data. With pseudonymization, you replace names with codes such as Client A and keep a key, so the data is still personal data under the GDPR.
Is a black box over a name in a PDF enough?
No. A black rectangle only covers the name. The text stays underneath, and anyone can select and copy it. The text must be deleted. To test it, select all, copy, and paste into a plain text editor. If a name shows up, it was only covered.
What personal data should I remove from a legal document?
Remove names, addresses, dates and places of birth, ID, passport and tax numbers, bank account numbers, emails, phone numbers, case and file numbers, land register references, signatures and amounts that could identify someone. Also remove indirect clues such as a rare job or a small village.
Does the GDPR apply to an anonymized document?
If the data is truly anonymous, so that nobody can identify a person by any reasonable means, it is no longer personal data. Pseudonymized data is still personal data. This is general information, not legal advice, so follow the rules of your bar or chamber.

Written by Ala Baganne, software engineer and founder of Acta.

About the author

See what Acta can do for your office

Tell me which tasks take your office the most time, and I’ll tailor a free demo to them.

Request a demo