To anonymise text before you paste it into an AI assistant, you remove or replace everything that could identify a person or reveal something confidential, while keeping the meaning the assistant needs to help you. Done well, it lets you use AI on real work, such as a customer complaint, a contract clause or a patient-style case note, without sending the names, numbers and details that should stay private. Done badly, it gives a false sense of safety, because people can often be identified by details that are not names.
This guide gives you a simple three-pass method, a table of what to replace with what, and a short script you can run on your own computer, so the sensitive text never leaves it.
Why you should anonymise text before using AI
Most useful work involves information about real people and real companies. Pasting it into any online tool means that the text travels to a service you do not control. Even when that service has strong privacy terms, anonymising first is the cheapest protection you have.
- Less to lose if something goes wrong. A mistake, a shared screen or a leaked history exposes placeholders, not people.
- Easier compliance. Under the GDPR, information that can no longer identify a person is outside the regulation, but it must be truly anonymous. See Recital 26 for the test.
- Same quality of help. An assistant does not need a real name to improve a letter, summarise a dispute or find a logic gap.
It is not a substitute for your company’s rules. If your policy forbids pasting a category of data at all, anonymising does not change that. Check it first, and see our list of what not to share with AI.
Anonymisation, pseudonymisation and redaction are different things
People use the words loosely, but the differences matter.
| Term | What it means | Can the person be identified again? | Good for |
|---|---|---|---|
| Redaction | Black out or delete the sensitive parts | Not from the text itself, but context may reveal them | Quick removal of obvious identifiers |
| Pseudonymisation | Replace identifiers with consistent placeholders such as [CLIENT_A]; keep a key elsewhere | Yes, by whoever holds the key | Letting the assistant follow who did what |
| Anonymisation | Remove or generalise so that identification is no longer reasonably possible | No, including by combining details | Sharing data or analysis widely |
For pasting into an assistant you will usually do pseudonymisation: replace names with placeholders, keep your own key and swap the real names back into the answer afterwards. That is practical and safe enough for most tasks, provided you also deal with the indirect clues described below. The UK regulator’s guide to anonymisation explains the distinction in depth.
Pass 1: find everything that identifies
Read the text once only to find identifiers. Do not edit yet. Mark every item in these groups.
Direct identifiers
- Names of people, companies, products that are unique to a client, and places such as a specific branch or address.
- Email addresses, phone numbers, usernames and social media handles.
- Identity, passport, tax, social security and customer numbers.
- Bank, card and account details, invoice and order numbers.
- Login details, API keys and anything that looks like a password.
Indirect identifiers
These are the details that identify someone when combined: a job title in a small team, an exact date, an unusual event, a rare diagnosis, a small town, an exact salary or a distinctive phrase. A person who knows the situation can often recognise it from these alone.
Confidential business details
- Prices, margins, unreleased product names and plans.
- Internal URLs, server names and file paths.
- Contract terms and negotiation positions.
Pass 2: replace with consistent placeholders
Replace each item with a label that keeps the logic of the text intact. The golden rule is consistency: the same person gets the same placeholder every time, so the assistant can still follow the story.
| Original | Replace with | Note |
|---|---|---|
| Anna Kowalska | [PERSON_1] | Use the same label for every mention |
| Northwind Logistics Ltd | [COMPANY_A] | Keep a different letter per company |
| [email protected] | [EMAIL_1] | Also remove names inside email addresses |
| +44 20 7946 0000 | [PHONE_1] | Remove all digits |
| 14 March 2026 | [DATE_1] or “mid-March” | Keep the order of events if it matters |
| 12 Baker Street, Leeds | [ADDRESS_1] or “a city address” | Generalise if the place is not needed |
| Invoice 2026-0417 for 18,400 EUR | [INVOICE_1] for about [AMOUNT] | Keep the size only if it matters to the task |
| Chief Financial Officer of a 9-person firm | “a senior finance manager at a small firm” | Widen job titles that point to one person |
Write the mapping in a separate note kept on your computer, not in the same chat: [PERSON_1] is Anna Kowalska, and so on. After the assistant answers, you replace the placeholders with the real names yourself.
Keep what the task needs
Do not remove everything. If you ask for help with a delivery dispute, the assistant needs to know that the goods arrived late and what was promised. It does not need the customer’s name. Strip identity, keep the facts that carry the problem.
Do the replacement locally with a short script
For long texts, doing this by hand is slow and error-prone. A small script that runs on your own computer finds the common patterns for you. Because it runs locally, the original text never goes to any service.
An assistant can help you write such a script. Ask it for one using made-up sample text only, never the real data. A basic version in Python looks like this:
import re
PATTERNS = {
"EMAIL": r"[\w.+-]+@[\w-]+\.[\w.-]+",
"PHONE": r"\+?\d[\d\s().-]{7,}\d",
"IBAN": r"\b[A-Z]{2}\d{2}[A-Z0-9]{10,30}\b",
}
NAMES = ["Anna Kowalska", "Northwind Logistics Ltd"] # add yours
def anonymise(text):
mapping = {}
for label, pattern in PATTERNS.items():
for i, m in enumerate(dict.fromkeys(re.findall(pattern, text)), 1):
tag = f"[{label}_{i}]"
mapping[tag] = m
text = text.replace(m, tag)
for i, name in enumerate(NAMES, 1):
tag = f"[NAME_{i}]"
mapping[tag] = name
text = text.replace(name, tag)
return text, mapping
The script returns the cleaned text and the mapping, which you keep private. It will miss things: nicknames, misspelt names, identifiers that follow no pattern and indirect clues. That is why the next pass is not optional.
Pass 3: check before you paste
Treat the cleaned text as untrusted until you have read it with fresh eyes.
- Search for what you meant to remove. Search for each real name, surname, company, city and a few digits from phone and account numbers. Include nicknames and misspellings.
- Read it as a stranger. Could someone who knows the case recognise it from the story alone? If yes, generalise the distinctive details.
- Check hidden content. Documents can carry names in file properties, comments, tracked changes and headers or footers. Copy the visible text only, or export a clean version.
- Check images and screenshots. Names hide in screenshots, tab titles and file names. Crop or blur before uploading.
- Check the filename. A file called “Contract_Kowalska_final.pdf” reveals what you removed from the text.
- Paste a small part first. Test with one paragraph and see what the assistant needs.
When anonymising is not enough
Some data cannot be made safe by replacing names, and some should not be pasted at all.
- Special categories such as health, biometric data, political opinions and similar topics carry high risk, and small details can identify a person. Use extra caution and your organisation’s approval.
- Small groups. In a team of five, a job title and a date identify one person even without a name.
- Credentials and keys. Never paste them, with or without placeholders. If you already did, follow the steps in what to do if you pasted something sensitive.
- Legal duties. Professional secrecy, contracts and sector rules may forbid sharing even anonymised content. Ask your compliance or legal contact.
For organisations, a written rule helps everyone. Our guide to a company AI use policy shows how to describe what may be pasted and what may not.
Worked example: a customer dispute
Suppose you want help writing a reply to an angry customer. The original notes read: “Anna Kowalska of Northwind Logistics ordered 40 pallets on 14 March, invoice 2026-0417, paid 18,400 EUR. Delivery was due 20 March and arrived 29 March. She wants a full refund and threatened to contact the press.”
After the three passes, the version you paste is: “[PERSON_1] of [COMPANY_A] ordered a large quantity of goods in mid-March and paid in full. Delivery was due after about one week and arrived nine days late. [PERSON_1] wants a full refund and mentioned going to the press.”
The assistant still has everything it needs: the cause, the delay, the demand and the risk. It can draft a calm reply that acknowledges the delay, states what you can offer and avoids defensive language. You keep the amount and the exact dates out of the chat. Afterwards you replace [PERSON_1] with the name, add the real figures and send it. The same pattern works for HR cases, support tickets and contract questions. Our guide to AI for customer support teams shows more replies of this kind.
Anonymising in Ask Mio
With Ask Mio, the same method applies. Anonymise first, then paste the cleaned text into a chat and ask for what you need. The Legal assistant and the Editor and proofreader experts are useful for contract clauses and letters, and the Summarizer expert turns a long case into short notes using placeholders. A project can hold your instructions, such as “treat anything in square brackets as a placeholder and never guess the real name”.
Mio’s policy is that chats and files are yours, you can export or delete them at any time and your data is not used to train models. That is a good reason to trust the service, and still not a reason to skip anonymising what does not need to be shared. The free plan covers Chat and Write modes and 600 points a month, which is enough to try the method. Details are on the pricing page.
A short routine you can reuse
- Decide whether the task needs this data at all.
- List identifiers: direct, indirect and confidential.
- Replace with consistent placeholders and keep the key offline.
- Run the script on long texts.
- Search and read the result as a stranger.
- Paste, ask and restore the real names yourself.
Frequently Asked Questions
Is replacing names with placeholders enough to anonymise text?
Not always. It is pseudonymisation, which still allows identification by anyone who holds the key or knows the case. Indirect details such as dates, job titles in small teams and unusual events can identify people too. Check the text as a stranger would before you paste it.
Can I ask the AI to anonymise my text for me?
That means sending the original text to the assistant first, which defeats the purpose. Instead, anonymise locally, for example with a short script, or ask the assistant to write the script using invented sample text. Then run it on your own computer.
What should I never paste into an AI assistant?
Passwords, API keys, payment card numbers, identity numbers and confidential client documents should stay out entirely. Placeholders do not make credentials safe. If your organisation has a policy, follow it before relying on any anonymising method. When in doubt about a category of data, leave it out and ask your data protection contact.
Does anonymising reduce the quality of the AI’s answer?
Usually not. The assistant needs the facts and the structure, not real names. Use consistent placeholders so it can follow who did what, and keep any detail the task truly depends on, such as an amount range or a sequence of dates.
How do I put the real names back afterwards?
Keep a mapping from each placeholder to the real value in a separate file on your computer. After the assistant replies, replace the placeholders yourself, either manually or with a small script. The mapping never needs to enter the chat.
Does the GDPR apply to anonymised text?
The GDPR does not apply to information that is truly anonymous, meaning a person can no longer be identified by reasonable means. Pseudonymised data is still personal data. Because the test is strict, ask your data protection contact when the content is sensitive.
The Bottom Line
To anonymise text before using an AI assistant, find every identifier, replace it with a consistent placeholder, keep the key on your own machine and check the result as a stranger would read it. Use a local script for long texts, and never paste credentials or content your policy forbids. Anonymising costs a few minutes and keeps real people and clients out of the chat. Try the method on the free Ask Mio plan; no card is needed.
