Guide · checked
How to keep personal information out of Claude and ChatGPT when you ask about your data
There are three ways, and you can mix them column by column: leave the column out, replace its values with stand-ins, or share totals only. All three have to happen before the rows reach the chat, because whatever your AI receives is sent to the AI company.
Portward wrote this page and makes one of the tools it mentions. Each claim about another company links to the page it came from. Found an error? Write to admin@portward.ai and we'll correct it and update the date.
01Three ways
Leave it out, replace it, or share totals only
Leave the column out
The value never leaves your database. Use it for anything the AI does not need to answer the question: emails, phone numbers, street addresses, dates of birth, and free-text notes, which can hold anything. This is the strongest of the three and the simplest to check.
Replace values with stand-ins
Each value is swapped for a made-up label, and the same value always gets the same label. The AI can still count customers, group orders by customer and join two tables on the customer, without learning who anyone is. Use it when the question is about people but not about a named person. This is what most people mean by anonymizing a column.
Share totals only
The AI gets sums, averages and counts for groups, never one person's row. Use it for numbers that are sensitive one by one and harmless added up, such as salaries or order values. Groups must be big enough: an average over one person is that person's number.
02Stand-ins
What a stand-in is, and what it does not protect against
A stand-in is a label with no meaning of its own, such as anon_3f9a1c20b7e4d815, shown in place of a real value. It is worked out from the value and a secret key, so the same email gives the same stand-in every time, and nobody without the key can work the email back out from the label.
What it does not protect against:
- The other columns. A stand-in hides one value. If the row beside it says “chief executive, joined 2019, Leeds office”, the person is still identified. Check what the visible columns say together.
- Small groups. If only one customer bought a product, a question about that product is a question about that customer.
- Text inside a column. A note that says “call Maria on her mobile” is personal whatever the column is called. Leave free-text columns out.
- Whoever holds the key. The key links a stand-in back to its value, so this is not the same as deleting the data. Treat anonymised rows as personal data that is harder to read, not as data about nobody.
03By hand
Doing it yourself in SQL
You can do the first and third ways with views, in any tool that connects an AI to your database. Put the views in a schema of their own and give the AI's login that schema and nothing else. In PostgreSQL a view reads its tables with its owner's rights, so the login needs no grant on the tables underneath.
-- A schema that holds only what the AI may read. CREATE SCHEMA ai; -- Leave columns out: no name, email or phone. CREATE VIEW ai.customers AS SELECT id, region, signup_date FROM public.customers; -- Totals only: no row for one person, and no group smaller than five. CREATE VIEW ai.salary_by_team AS SELECT team, count(*) AS people, round(avg(salary)) AS average_salary FROM public.staff GROUP BY team HAVING count(*) >= 5; -- The AI's login reads the views and nothing underneath them. GRANT USAGE ON SCHEMA ai TO claude_ro; GRANT SELECT ON ALL TABLES IN SCHEMA ai TO claude_ro;
For the second way, the simplest stand-in is an id you already have: show customer_id and leave the email out. Hashing the email inside a view is weaker than it looks. An email can be guessed and hashed again to see if it matches, and a secret written into the view is readable by any login that can read the database's catalog.
The cost of doing it by hand is upkeep: every new column is visible or hidden by whoever wrote the view, and nothing tells you what the AI was actually sent.
04In Portward
Doing it in Portward
Portward is a hosted connector for PostgreSQL and MySQL databases on the internet. When you connect a database, it lists the columns and ticks the ones whose names look personal, such as email, phone, address or date of birth, for you to check. It reads names to suggest them, never rows, and nothing is kept back until you confirm.
- On Free and on Team, each column has a level: Full, Anonymised, Totals only or Hidden. An anonymised column reaches your AI as stand-ins, made inside your database with a key kept for your account, so filters, groups and joins still work. A totals-only column gives sums, averages and counts in groups big enough, never one row.
- Under every answer is a receipt of what your AI was sent.
Portward runs the engine that reads your database, so Portward can technically see what passes through it. Portward holds your account email, your database login (sealed to your engine's key), your rules and notes, the questions and SQL your AI ran, receipts and usage counts, and the AI log of what the AI was sent. Rows pass through your engine to the AI and are not stored by Portward, except in that AI log, which deletes them after 30 days, and in the results panel, which deletes them after 24 hours. Your engine is separate from every other account's. The detail is on the security page.
05Limits
What none of this covers
- What you type. A name or a number you paste into the chat goes straight to the AI company. No connector sees it.
- Files you upload. A spreadsheet attached to a chat is sent whole.
- The AI company's own handling. Rows your AI receives are handled under your plan's terms and settings. Anthropic and OpenAI each publish what they use for training and how to change it.[1][4]
- Your legal duties. Whether a use of personal data is allowed depends on your law and your contracts, not on a tool. This page is not legal advice.
Is it safe to connect Claude or ChatGPT to your database? covers the other half: read-only logins, what the AI apps' settings do, and a checklist.
Sources
Each read on . First published .