Five ways to remove personal data from text before AI, compared
In this guide
There is more than one way to get personal data and secrets out of a text before it goes to an AI model. We make one of them, Scrub for AI, so read this as a comparison written by a maker. For several situations one of the other four is the better choice, and we say so.
The short answer
- One text, now and then: doing it by hand is fine, if you take your time.
- You build software that sends text to a model, or you process many documents: use Presidio or a similar library.
- You have to enforce a rule for a whole organisation: that is what enterprise DLP is for.
- You or your team paste into AI chats every day: a scrubber in the browser is the fastest way to make it a habit.
Side by side
| Method | Good at | Weak at | What it needs |
|---|---|---|---|
| By hand | Context. You know that "the neighbour of the mayor" points to one person | Speed and repeats. The same email address further down is easy to miss, and putting the values back is more hand work | Time and attention |
| Find and replace with patterns | Known shapes such as email addresses and customer numbers, in any text editor | Every pattern is your own work, numbers are not checked, and nothing remembers what to put back | Knowledge of regular expressions |
| Presidio | Names and locations through language models, next to patterns and checksums. Works on text, images and structured data, and is built for pipelines | It has to be installed, run and tuned | A developer, and Python or Docker |
| Enterprise DLP | Enforcing a policy for everyone: logging, warning or blocking when sensitive content is pasted into a website | It stops the paste but does not finish the task. The person still has to remove the data | An IT department, managed devices and licences |
| A scrubber in the browser | One click before you paste, the same placeholder for the same value, and the real values back in the answer. Nothing leaves the browser | It finds patterns. Names are only hidden when you add them as your own terms | A browser extension, or a web page |
Checked on 15 November 2026 against the documentation of the tools named below.
By hand
For a single email this works, and a person sees things no tool sees. The risk is in the second half of a long text, where attention drops, and in the log line you did not read. If you do it by hand, replace values with labels such as [CUSTOMER] instead of deleting them, so the text still makes sense to the model. The steps are in how to remove personal data from text.
Find and replace with patterns
A regular expression for email addresses takes a minute and catches all of them. That makes this a real step up for anyone who is comfortable with patterns. The limits show quickly: a pattern for numbers also hits order numbers, an IBAN pattern without a check accepts typos and random strings, and after the answer comes back there is no map to restore the values. You end up building a small tool.
Presidio
Presidio is an open source toolkit for finding and anonymising personal data. It started at Microsoft and is now a community owned project. It has an analyzer that finds entities, an anonymizer that replaces them, and modules for images and for structured data. It combines named entity recognition with regular expressions, rule based logic and checksums, so it can find names and locations, which patterns alone cannot.
It is a library and a service, not an app. You install it with Python or run it in Docker, choose language models and tune recognisers for your own data. Its own documentation says there is no guarantee that it finds all sensitive information, which is the honest position for every tool in this list.
When Presidio is the better choice: when a program and not a person sends the text, when you process files in bulk, or when recognising names without listing them first matters most.
Enterprise DLP
Data loss prevention products work from the other side: the organisation defines what counts as sensitive, and software on every device watches where it goes. Microsoft Purview, for example, can check content at the moment it is pasted into a browser based application and then log it, warn with the option to continue, or block it. According to Microsoft that works in Edge and, with its extension, in Chrome and Firefox.
When DLP is the better choice: when you must be able to show that a rule is enforced for everyone, and you have the people and the budget to manage it.
What it does not do is help someone finish their work. After a blocked paste the colleague still needs a way to get the data out of the text. That is why the two are often used together.
A scrubber in the browser
This is the approach of Scrub for AI. You select or paste text, and email addresses, phone numbers, IBANs, card numbers, keys and passwords become placeholders such as [EMAIL_1]. IBANs and card numbers are checked, so ordinary numbers stay. The same value always gets the same placeholder, and when the answer comes back the real values are restored from a map that only exists in your browser.
Its weak spot is the one in the table: it works with patterns and your own list of terms, not with a language model, so it does not know a name unless you tell it. If names are your main concern and you cannot list them, Presidio fits better. You can try it at muteware.com/scrub without installing anything.
What to combine
- Freelancer or small team: a browser scrubber for daily use, plus a short AI policy that says what never goes in.
- Product team: Presidio or a similar library in the pipeline, and a scrubber for what developers paste into chats while they work.
- Larger organisation: DLP as the safety net, and a scrubber so that people have a fast, allowed way to do the right thing.
Sources
This guide is general information and not legal advice.
Scrub before you paste
Scrub for AI replaces emails, phone numbers, IBANs, API keys and passwords with placeholders in one click, and puts them back when the answer returns. Free, runs offline, no account.
More: all guides · Scrub for AI · Copy for AI · Tables for AI