Anonymise before prompting: what works

Replacing a name with initials is not enough: the text is then pseudonymised and is still personal data. What works is to replace direct identifiers with roles, coarsen the indirect ones and keep the key outside the tool. This guide explains the difference between anonymisation and pseudonymisation in practice under GDPR, what is enough for which task, where it goes wrong, and when it is simpler to keep the matter out of the tool.

Updated by Nils-Erik Jansson

Two terms that get mixed up

The European Data Protection Board describes pseudonymisation as a security measure that reduces the possibility of linking data to a specific individual, and anonymisation as something that makes it impossible. Fully anonymised data is no longer personal data [1]. GDPR draws the line in Recital 26: data is personal data as long as a person can be identified, directly or indirectly, by means reasonably likely to be used, and pseudonymised data that can be attributed to a person with additional information counts as personal data [2].

For the lawyer, this means that replacing the name does not make the text anonymous. It makes it pseudonymised, which is good, but the processing still needs a legal basis, a processor agreement and an assessment. The text is anonymous only when nobody, including you, can reasonably link it to the person. In an employment matter in a small department, that is almost impossible. In a question about a standard clause in a customer contract, it is easy.

What identifies a person

Direct identifiers: name, personal identity number, email address, phone number, employee number, vehicle registration number. They are easy to find and replace.

Indirect identifiers: job title combined with unit, the date of an event, an amount that applies to only one person, a town, an illness, a counterparty's business name where the counterparty is a sole trader, a case number that also exists in another system. They are harder, and they are why "de-identified" texts still identify people.

Context: a text about "a salesperson in the western region who was dismissed in March" identifies the person to everyone in the company who knows there was only one. Small populations are the problem. The smaller the organisation or the rarer the event, the less it takes.

The method in four steps

  1. Decide what the question requires. A question about grounds for dismissal needs the course of events, not the name. A question about a clause needs the clause, not the parties. Write the question first, then enter only what it needs. This is also the necessity requirement of the legitimate interests assessment applied in practice [3].

  2. Replace direct identifiers with roles: "the employee", "the customer", "the counterparty", "the company", "the supplier". Do not use initials, invented names that can be looked up, or "Person A" if the text then reveals who A is. Roles also give better answers, because the tool reasons about the role instead of guessing about the person.

  3. Coarsen the indirect identifiers. Dates become "in the spring", amounts become orders of magnitude, job titles become levels, towns become "a small town". Keep what matters legally: that the dismissal came within two months of the event is relevant; the exact date seldom is.

  4. The key stays with you. If you need to link the answer back to the matter, record the link in the matter file in your own system, not in the tool. That is what keeps the text in the tool pseudonymised from the vendor's side, even though it is personal data from yours.

Read the text once more and ask: would anyone at the company who reads this know who it is about? If so, it is not finished.

What is gained

Legally: the necessity requirement is easier to meet, the balancing exercise is easier to document, and the consequences of an incident or of a request from an authority to the vendor are smaller. See the guide on personal data in prompts.

Practically: some types of matter on the excluded list can be entered in de-identified form. One way to handle this is to give the excluded list two columns: excluded entirely, and excluded unless de-identified.

For law firms: the guidance of the Swedish Bar Association (Sveriges advokatsamfund) requires that client information is not disclosed in breach of professional secrecy, and that the risk assessment is made per client, matter and task [4]. De-identification is one of the measures that affect that assessment, but it does not replace the contract with the vendor.

What does not work

Asking the tool to anonymise the text: by then it has already been entered. Assuming that pseudonymised text is anonymous and skipping the assessment. De-identifying the direct identifiers and leaving the indirect ones. Keeping the key in the same chat as the text. And de-identifying texts where the context identifies the person anyway, when the matter should have been kept out.

When it is simpler to keep the matter out

Keep the matter out when the person can be identified from the context whatever is removed, when de-identification takes longer than the answer is worth, when the data is special category data under Article 9 and the answer needs it, and when the matter is on the excluded list for a reason unrelated to personal data, such as a request from an authority or the client's instructions. Then the answer is not to enter it, and that is an acceptable answer.

HOVR Legal teaches the method in the AI literacy training using the department's own texts. The list of excluded matters, with the column for de-identified form, is drawn up in the risk assessment in the data protection package. For Claude, it is part of the setup. De-identification at volume, with local tools, is covered in on-premise or cloud AI.

Frequently asked questions

Is the text anonymous if I replace the name with initials?
No. Initials, job title, unit, dates and context usually identify the person to anyone who knows the organisation, and GDPR treats data as personal data as long as the person can be identified, directly or indirectly, by means reasonably likely to be used [2]. Replacing the name is pseudonymisation. It is a safeguard that reduces risk, but the data is still personal data, and the processing still needs a legal basis, a contract and an assessment.
Is it worth anonymising if the processing is permitted under the contract anyway?
Yes, for three reasons. The necessity requirement in the legitimate interests assessment is easier to meet when only what is needed is entered. The consequences of an incident, a request from an authority or an error at the vendor are smaller. And some types of matter that would otherwise be on the excluded list can be entered in de-identified form. The cost is work on each matter and a key to keep in order.
Can the tool anonymise the text itself?
Not without reading it first. Asking the tool to remove names means the names have already been entered. De-identification has to happen before the text leaves your environment: by hand for short texts, and with a local tool or a function in your document system for longer ones. A local model can be used for this step; see the guide on on-premise or cloud AI.

Sources

  1. [1]Anonymisation and pseudonymisation, European Data Protection Board
  2. [2]Regulation (EU) 2016/679 (GDPR), Articles 4(1) and 4(5) and Recital 26, EUR-Lex
  3. [3]Intresseavvägning, IMY, in Swedish; the Swedish Authority for Privacy Protection (IMY) on the legitimate interests assessment
  4. [4]Vägledning om användning av generativ AI i advokatverksamhet, Sveriges advokatsamfund, 12 juni 2025, in Swedish; Swedish Bar Association guidance on generative AI in law practice

Back to AI for legal

More under AI for legal