How to anonymize data for ChatGPT, and restore the answer
Most prompts that cause trouble aren't secret on purpose. Someone pastes a customer email to get a polite reply drafted, or a log file to find a bug, and with it go names, addresses, account numbers and keys. Here is a routine that keeps the useful part of the text and leaves the personal part at home.
Why it matters
Whatever you paste into an AI chat is sent to the provider's servers. Depending on the product and your settings it may be stored, reviewed or used for training. For your own text that is your call. For other people's data, such as customers, colleagues or patients, data protection law (the GDPR in the EU and UK), your contracts and your employer's rules usually decide for you, and they rarely allow it.
The AI rarely needs the real values. To draft a payment reminder it needs to know that there is a client, an amount and an account, not who the client is or which account it is.
The routine
- Paste the text into a local anonymizer. Use a tool that runs in your browser, not one that uploads the text: an online "anonymizer" that sends your text to its server has the same problem as the AI chat. You can check this in the browser's developer tools: the network tab should show no request carrying your text.
- Review every finding. Automatic detection finds emails, phone numbers, IBANs, card numbers and keys reliably because they have fixed formats and check digits. Names and addresses are harder. Read the highlighted text and add anything that was missed, such as a company or project name, to the custom terms list.
- Replace with placeholders. Placeholders such as
[PERSON_1]or[EMAIL_2]keep the structure of the text, so the AI still understands who is who, and the same value always gets the same placeholder. - Paste the result into the AI chat and ask your question. Tell the model to keep the placeholders unchanged, for example: "Keep placeholders like [PERSON_1] exactly as they are."
- Restore the answer. Paste the AI's reply into the Restore view. Every placeholder it kept is swapped back for the original value, locally, using the mapping held in your browser tab.
What to look out for
- Indirect identifiers. A job title plus a town plus a date can identify someone without any name. Generalize such details by hand where it matters ("a manager in a small town" instead of the exact role and place).
- Attachments and screenshots. Images and PDFs carry data too. Copy the text out and clean it, or leave them out.
- Keys and passwords. Even with a placeholder, a key that was ever pasted somewhere should be rotated. Better not to paste it at all.
- Placeholders are pseudonymization, not anonymization. Whoever has the mapping can reverse them. That is the point for restoring the answer, but it means the result is still personal data in the legal sense. See pseudonymization vs. anonymization.
Which replacement to choose
| Mode | Example | Use it for |
|---|---|---|
| Placeholders | [PERSON_1] | AI prompts whose answer you want to restore |
| Fake data | Laura Hensley | Text that should still read naturally: tickets, examples, test data |
| Hash | EMAIL_3f9a01bc | Logs, where the same user should stay recognizable across lines |
| Mask | ***** | Anything you never need back |