, Nils-Erik Jansson
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
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].
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.
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.
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.
How HOVR Legal works with this
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]Anonymisation and pseudonymisation, European Data Protection Board
- [2]Regulation (EU) 2016/679 (GDPR), Articles 4(1) and 4(5) and Recital 26, EUR-Lex
- [3]Intresseavvägning, IMY, in Swedish; the Swedish Authority for Privacy Protection (IMY) on the legitimate interests assessment
- [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
Insights on the topic
Back to AI for legal
More under AI for legal
- Data protection package for AI tools in legal work
Fixed-scope engagement: transfer impact assessment, impact assessment where needed, draft addendum, policy and training. For the AI tool you use or consider.
- AI operating model for the legal department
Fixed-scope engagement for legal departments. You get an operating model for how AI is used, governed and followed up, whatever the tool.
- AI literacy training for lawyers: two hours
Two hours of training for your legal department or firm on your own tools and documents, documented as a measure under Article 4 of the AI Act.
- Data protection checklist for generative AI in legal work
A checklist for law firms and legal departments: five questions to answer before the first client data goes into an AI tool, and what counts as a pass.
- AI policy for the legal department: what it should contain
Outline of an AI policy for a legal department or law firm: permitted tools, what may be entered, review, responsibility, excluded matters and training.
- AI policy template for the legal department
An editable AI policy template for a legal department or law firm in nine sections, with comments on what to adapt and why.
- The EU AI Act for in-house counsel: what applies to users
What the EU AI Act requires of a legal department that uses generative AI: AI literacy since 2025, transparency since 2026 and when the high-risk rules apply.
- Transfer impact assessment for AI tools, step by step
The six steps of a transfer impact assessment for a US AI tool: map, choose a transfer tool, assess the country, supplement, document, review.
- DPIA for generative AI: when it is required and how
When a legal department or law firm must carry out a DPIA under Article 35 GDPR for an AI tool, using the Swedish regulator IMY's nine criteria.
- Personal data in prompts: legal basis and information
When a lawyer writes about an employee, a counterparty or a customer in an AI tool, personal data is processed.
- AI incident response for legal teams
What a legal department does within 72 hours when a member of staff has entered data into an AI tool that should not have gone in.
- Swedish MBL and AI tools: must you negotiate first?
Swedish law: when an AI tool triggers the duty to negotiate under section 11 MBL, when informing under section 19 is enough, and with no collective agreement.
- Shadow AI in the legal department: one week of work
Staff use ChatGPT and Claude on private accounts for work. The legal department's week: map it, stop the worst, offer an approved tool, write the rule.
- Legal privilege and AI: the Swedish Bar guidance
What the Swedish Bar Association's guidance on generative AI requires for confidentiality: tools that do not train on client data, and terms read in full.
- Contracts with AI vendors: asking beyond standard terms
What a legal department or law firm asks of an AI vendor beyond the standard terms: authority requests, sub-processors, deletion, anonymisation, exit.
- On-premise or cloud AI for legal work
When a legal department or law firm should run AI locally and when the cloud is right: what local operation solves, what it costs, what it leaves open.
- Reviewing an AI answer in ten minutes: five steps
How a lawyer reviews an answer from Claude, Legora or ChatGPT before using it: sources, case law and statutes, figures, what is missing, and tone.
- AI literacy training for the legal department
What a two-hour training for lawyers using generative AI covers: what the tool does and does not do, your rules, practice on your own documents.
- AI guidance for lawyers in the EU and the UK
What the CCBE, the SRA, the Law Society, the Bar Council and the Swedish Bar Association require of lawyers using generative AI, and where they differ.
- The general counsel's AI report to the board: two pages
What the board needs to know about the company's AI use once a year, and what the general counsel can answer for.