· Updated · Damien B., Founder of Redact PDF AI

How to Analyze a Confidential Document With Claude or ChatGPT Without the AI Seeing a Name (2026)

Is Claude, or ChatGPT, safe for confidential information? Business plans that do not train on your data make it safer, but they do not change one fact: once you upload a lease, a medical file or an HR record, the provider has every name in it. The only way an AI provider never sees the names is that the names never leave your machine. That is now possible with a local agent: the document is pseudonymized before the agent reads it (every person, company and address becomes a tag such as [Person 1]), the agent works on the tagged text, and a local tool puts the real names back into its answer without them ever entering the conversation.

This guide shows that loop end to end on a residential lease, with redact-pdf-mcp 0.4.0 in Claude Code, Claude Desktop, Cursor or Codex CLI. It also says plainly where the method does not work, because that is the part most "privacy" guides leave out.

The names become tags before the agent reads the lease; its answer comes back about [Person 1] and [Org 1], never about the real people.

When it protects you, and when it cannot

The whole method rests on one rule: the names must be replaced before the file reaches the AI provider. Whether that is possible depends on where the AI reads the file.

Where you workAre names kept from the AI provider?Why
Claude Code, Claude Desktop (local MCP server), Cursor, Codex CLIYesThe MCP server runs on your computer, reads the file by path and returns only tagged text to the model
Any chatbot, after anonymizing in the web app firstYes, for the documentYou upload the pseudonymized PDF, not the original; you put the names back yourself
A file already uploaded to claude.ai or chatgpt.comNoThe provider received the original the moment you uploaded it. Anonymizing afterwards changes nothing
A hosted (remote) MCP connectorNoThe document has to be sent inline, and the tag → name table comes back inside the conversation

Two things to know before you start:

  • The document does go to Redact PDF AI. Detection and OCR run on our servers in the EU and Switzerland, encrypted, with the original deleted after processing and nothing used to train AI models. What stays out is the AI assistant's provider: Anthropic or OpenAI receive tags, never names.
  • The ChatGPT app is not a local agent. At the time of writing it connects to remote MCP connectors, not to a server running on your computer, so the local re-identification step is not available there. On OpenAI's side, use Codex CLI, or anonymize in the web app and upload the result.

The loop in three tool calls

The local server (npx redact-pdf-mcp) exposes everything an agent needs:

  1. Pseudonymize. The agent calls redact_pdf_and_wait with the file's path and mode: "pseudonymize". It never opens the file. The server writes a redacted PDF where each person, company, address, email, phone number, date, IBAN and card number is replaced by a consistent tag, writes the tag → original correspondence table as a CSV next to it, and returns document_text: the document as text, tags in place of names.
  2. Work. The agent reads document_text (for a long document, the file at document_text_path) and does the job: summary, clause review, draft letter. It writes the result to a .md, .txt or .docx file, keeping every tag exactly as written.
  3. Re-identify. The agent calls restore_names with its file and the correspondence_path. The tool runs entirely on your machine, writes <name>-restored.<ext> next to the agent's file, and returns only the path and counts, never a name. You open that file; the agent does not.

The same tag is used on every page and for every variant of a name: "Daniel Whitmore", "Mr Whitmore" and "D. Whitmore" all become [Person 1], so the agent can follow who did what. In a French or German document the tags follow the document's language ([Personne 1], [Person 1]).

Worked example: reviewing a residential lease

A property manager has a 14-page lease and wants to know what the tenant owes at the end of the tenancy, plus a draft reminder letter about the deposit. The landlord is a company, the tenants are two people, and the file sits in ~/Leases/maple-court-12.pdf.

1. Install the server once

Claude Code:

claude mcp add redact-pdf --env REDACT_PDF_API_KEY=your_key -- npx -y redact-pdf-mcp

Codex CLI, in ~/.codex/config.toml:

[mcp_servers.redact-pdf]
command = "npx"
args = ["-y", "redact-pdf-mcp"]
env = { REDACT_PDF_API_KEY = "your_key" }

Claude Desktop and Cursor take the same npx -y redact-pdf-mcp entry in their MCP config (Claude Desktop also installs it as an extension); the developer page has each snippet. A free account redacts its first document (up to 5 pages) in full, no card.

2. Ask without letting the agent open the file

The prompt matters. Agents habitually read a file before acting on it, and that one read is the leak. Say it explicitly:

Pseudonymize ~/Leases/maple-court-12.pdf with redact-pdf (mode pseudonymize). Do not open the PDF yourself. From the pseudonymized text, list what the tenants must do before moving out, and draft a short letter to them about the deposit return. Write both to ~/Leases/maple-court-12-review.md, then restore the names with restore_names. Do not read the CSV or the restored file.

The server's own instructions tell the agent the same thing, but saying it in the prompt removes any doubt. In Claude Code you can go one step further and add a permission rule that denies Read on the folder holding the originals: the MCP server is a separate process, so it can still read the file, while the agent's own Read tool cannot.

3. What the agent actually sees

document_text looks like this, and nothing more:

This Residential Tenancy Agreement is made between [Org 1] ("the Landlord") and [Person 1] and [Person 2] ("the Tenants") for the property at [Address 1]. The Tenants shall pay a security deposit of $2,400 to [Org 2] … At the end of the tenancy the Tenants must return all keys to [Person 3], the building manager, and have the carpets professionally cleaned.

Amounts, clause numbers and obligations are untouched, because the agent needs them. Who the people are is gone.

4. What the agent writes

Before moving out, [Person 1] and [Person 2] must: give 60 days' written notice to [Org 1] (clause 4.2); have carpets professionally cleaned and keep the receipt (clause 11.3); return all keys to [Person 3] (clause 11.5).

Dear [Person 1] and [Person 2], your deposit of $2,400 is held by [Org 2] and will be returned within 14 days of the final inspection…

5. Names back, locally

restore_names writes maple-court-12-review-restored.md with the real landlord, tenants and building manager, and returns something like { "status": "restored", "replacements": 9, "tags_restored": 6 }. The agent hands you the path. If it reports unresolved_tags (a tag it wrote that the table does not contain, usually a typo such as [Person1]), fix the tag and run it again.

The tag → name table stays on your disk. Only the restore tool reads it, and it never sends a name back to the agent.

Without an agent: anonymize first, then paste

No local agent? The protection still holds if you anonymize before the upload:

  1. Pseudonymize the PDF on redact-pdf.ai/anonymize-pdf, check the tags in the editor (rename [Person 1] to [Tenant] if that helps the AI), and download the PDF and the correspondence table.
  2. Upload the pseudonymized PDF to Claude, ChatGPT or Gemini. The names were removed from the file, not covered, so there is nothing underneath to extract.
  3. Map the tags in the answer back to names yourself, using the table.

Step 3 is manual here; the automatic re-identification is what the local agent adds. The general method, including hidden metadata and what to do with descriptive details, is in how to anonymize a document before ChatGPT.

Limits worth knowing

  • Context can still identify. Tags remove names, not facts. "The only ground-floor unit with a wheelchair ramp" may point to one tenant. Read the tagged text once with that in mind.
  • Not every category gets a tag. People, companies, addresses, emails, phone numbers, dates, IBANs and card numbers become tags. National ID numbers and custom terms you add stay black boxes.
  • The agent must keep the tags verbatim. [Person 1] restores; "Person One" does not. The tool reports unresolved tags instead of guessing, and leaves ambiguous ones (two people given the same rename) as tags.
  • It is pseudonymization, not anonymization. Whoever holds the CSV can re-identify everyone. Keep it with the file, never in the chat. The legal difference is explained in pseudonymization vs anonymization.

Frequently asked questions

Is Claude safe for confidential information? Claude's commercial plans do not train on your content by default, but anything you upload is still received and processed by Anthropic. If the document contains names you are not allowed to share, pseudonymize it first: with the local MCP server in Claude Code or Claude Desktop, Claude only ever receives tags such as [Person 1].

Is ChatGPT safe for confidential information? The same logic applies: a business plan limits how OpenAI uses your data, but the document still reaches OpenAI. Upload a pseudonymized PDF instead of the original, or use Codex CLI with the local MCP server so the names never leave your computer.

I already uploaded the file to claude.ai or chatgpt.com. Can I anonymize it now? No. The provider received the original when you uploaded it. Pseudonymizing protects the next upload, not past ones; delete the conversation and check the provider's retention settings.

Does the AI ever see the correspondence table? Not with the local server. The table is written to your disk, and restore_names reads it on your machine and returns only a file path and counts. The hosted remote server is different: it returns the table inline, so use the local one when names must stay out.

Which file types can restore_names fill in? Markdown (.md, .markdown), plain text (.txt) and Word (.docx). It never overwrites a file: it writes a new copy with "-restored" in the name.

Does it work on scanned leases or photos? Yes. The document is read with OCR in more than 100 languages before detection, and PDF, JPEG and PNG are all accepted.

Can the agent cheat and read the original anyway? A local agent has file access, so the protection relies on it not opening the file. The tool descriptions forbid it, your prompt should too, and in Claude Code a permission rule that denies reads on the folder makes it a hard block.

Try it

Anonymize a PDF with placeholders in the browser, or install the MCP server and run the loop above on your own lease. Choosing a tool? See the tools compared. Doing this across a whole file of documents? How AI agents redact PDFs covers the batch API.


Using Claude in the browser or the app? Redact PDFs in Claude with the Redact PDF AI connector