Topic 4 of 5 · 5 min read
Anonymizing and aggregating before upload
Goal: Prepare a safe version of a dataset by removing identifiers and aggregating, and judge whether it could still identify people.
When you need AI help with sensitive data, send a safer version: remove identifiers, group the rows into totals, or use made-up sample data. Then check that no one could still work out who is who.
Check yourself · 1 of 3
You need a spreadsheet formula built. What is the safest way to get AI help if the real file holds customer data?
Why it matters
Most of the time the AI does not need real names to do the job. It needs the pattern, the structure or the problem. If you can get the same help from a safe version, you remove the risk instead of managing it.
Your options, from safest to riskiest
- Synthetic sample. Write or generate invented rows that have the same columns and shape as the real data. Ask the AI to build your formula, chart or cleaning steps on the sample, then run them yourself on the real file.
- Aggregate. Replace rows with totals, averages or counts: sales per region per month instead of every order. Very small groups are risky. A group with one person in it is that person.
- Remove identifiers. Delete direct identifiers such as name, email, phone, address, account number and ID photo. Check free-text columns too.
- Pseudonymize. Swap each name for a code such as C-0417 and keep the key list somewhere private. This is weaker than removal. Under the GDPR, pseudonymized data is still personal data, because the key can reverse it.
- Use an approved tool. If your employer runs a tool under a proper data agreement, using it may be allowed where a public tool is not. Confirm with the owner of that tool first.
The re-identification risk
Removing names does not guarantee anonymity. A few ordinary facts together can point to one person: job title, workplace, birth date, postcode and gender. A row that reads "female, 58, head of legal, 2021 hire" may name exactly one person in a company of 200. Rare values, unusual dates and small groups are the usual weak points. To lower the risk, blur details: age bands instead of exact ages, region instead of postcode, month instead of day.
A quick check
Ask yourself: could a colleague who knows this team pick out a person from the file? If yes, reduce it further or stop.
Before and after
Before: Upload a staff survey with name, team, age, start date and written comments, and ask for themes.
After: Upload only the comments with names and team removed, plus a note on which comments mention a person by name so you can edit those out by hand. Ask for the themes from the comments alone.
What goes wrong
- People remove the name column and call the data anonymous while leaving a rare job title.
- People pseudonymize and assume the law no longer applies.
- People aggregate to groups so small that each cell is one person.
- People trust the AI to anonymize the file for them, which means uploading the raw file first.
Examples
Sample instead of the real file
You want a formula that flags late invoices. Instead of uploading 4,000 real invoices, you type six invented rows with the same columns: invoice_id, customer_code, due_date, paid_date.
The AI writes the formula on the sample. You test it on the real file on your own machine.
Too small to be anonymous
A table of average salary by team looks safe. The Legal team has one person in it, so the average is that person's salary.
Fix: merge small teams into larger groups, or drop cells that cover fewer than a handful of people.
Key points
- A synthetic sample often gets you the same help with no real data at all.
- Aggregated groups that are very small can still identify one person.
- Pseudonymized data is weaker than removal and, under the GDPR, still counts as personal data.
- A few ordinary facts such as job title, age and postcode can single someone out together.
- Do not ask an AI to anonymize a file by uploading the raw file first.
Common mistakes
- Deleting only the name column and leaving rare job titles and exact dates.
- Treating pseudonymized data as if it were anonymous.
- Aggregating into groups so small that one person is the group.
- Uploading the raw data to ask a tool to remove the identifiers.
Check yourself · 2 of 3
A table of average pay by team has one team that contains a single employee. What is the problem?
Check yourself · 3 of 3
Which change gives the strongest protection to a customer table?
Practice items, not counted towards your mastery.
Start here
- Data controls in ChatGPT (OpenAI Help) (opens in a new tab)ArticleFree
Shows where the training switch, history and temporary chats live.
- How your data is used to improve model performance (OpenAI Help) (opens in a new tab)DocsFree
Which products use content for training by default and how to opt out.
- Anthropic Privacy Center (opens in a new tab)DocsFree
Anthropic's answers on how Claude handles and retains data, by plan.
More for this topic
- Microsoft Presidio: PII detection and anonymization (opens in a new tab)ToolFree
Open-source tool that finds names, emails and card numbers in text so you can mask them locally before sharing.
Where to go in your country
- General Data Protection Regulation (GDPR) full text (opens in a new tab)StandardFreeEU
Searchable EU law text with the definition of personal data and the special categories.