Guide

How to use AI with client documents without leaking personal data

To use ChatGPT, Claude or Gemini with client documents safely, replace every piece of personal data with a neutral token such as [PERSON_1] before sending, confirm nothing identifying is left, send only the tokenised text to the AI, then restore the real names and details in the answer on your side. The AI sees tokens instead of the client's details.

LEXARIS teamUpdated 5 min read

Key points

  • Replace names, IDs, addresses and contact details with tokens before anything leaves your hands.
  • Run a GO/NO-GO check: when you send through LEXARIS, an unchecked document cannot be sent.
  • The AI works on tokens like [PERSON_1]; you restore the real data in one click.
  • Headers, footers, metadata and attachments are where manual redaction usually fails.

Why client documents need care before they reach an AI

When you paste a client document into ChatGPT, Claude or Gemini, everything in it is sent to the provider. That includes names, dates of birth, account numbers and anything else the document happens to contain.

For most professional work, that raises three separate questions:

  • Confidentiality. Lawyers, accountants, doctors and consultants usually owe clients a duty of confidence. Sharing identifiable information with a third party can breach it, whatever the provider promises.
  • Transfers. Many AI providers process data outside the UK and the EU. Sending personal data to them can be an international transfer, which under the GDPR and UK GDPR needs a lawful basis and safeguards.
  • Retention. Depending on the plan and settings, a provider may keep prompts for a period, for abuse monitoring or other purposes. Once the text has left, you no longer control it.

The simplest way to reduce all three is to make sure the AI never receives the personal data in the first place.

How to use AI with client documents: four steps

The safe workflow is anonymise, check, send, restore. Each step has a clear purpose, and none of them requires you to change how you write prompts.

1. Anonymise the document

Upload the document or paste the text. LEXARIS detects more than 116 types of personal data, including names, national ID and passport numbers, addresses, phone numbers, email addresses, bank details such as IBANs, and medical codes. Each item is replaced with a token that names its type and a number, so the same person is always [PERSON_1] throughout the document.

Tokens are only one of seven replacement modes. For AI work they are usually the right choice because they are reversible and easy for the model to follow. The seven replacement modes are compared in detail in our guide to ways of replacing personal data.

2. Check before sending

Before anything goes to an AI, a GO/NO-GO check reviews the result. When you send through LEXARIS, an unchecked document cannot be sent. The check reduces risk; review the result before sharing. If something looks wrong, you can adjust the detection and run it again.

3. Send the tokenised text

Send the anonymised text to the AI you prefer, and write your prompt as usual: "Summarise the obligations of [PERSON_1]" works just as well as the original. The AI sees only tokens.

4. Restore the answer

Paste or receive the AI's answer, and restore it in one click. Every token is replaced with the original value, so the draft or summary reads as if the AI had worked on the real document.

A before-and-after example

Here is how a short passage from a client file looks before and after anonymisation.

Before

Our client John Smith, of 14 Harbour Road, Bristol BS1 5TT, can be reached on +44 20 7946 0958 or john.smith@example.com.

After

Our client [PERSON_1], of [ADDRESS_1], can be reached on [PHONE_1] or [EMAIL_1].

The AI receives only the second version. The link between each token and its real value stays with you.

The sentence keeps its meaning. The AI can tell that [PERSON_1] is the client, that there is an address and a phone number, and it can reason about them without knowing what they are.

Handling the AI's answer

Treat the AI's output as a draft that you restore and then review. Restoration puts the real data back; it does not check whether the AI was right.

  • Keep tokens intact in follow-up prompts. If you ask further questions, refer to [PERSON_1] rather than the real name, so nothing identifying slips into the conversation.
  • Watch for invented tokens. Occasionally an AI will write a token that was not in your document, such as [PERSON_7]. A token like that has no original value behind it, so read the restored text for any leftover brackets.
  • Review the restored text. Read the final version with the real names in place. That is where errors of fact or tone become obvious.

Common mistakes when redacting by hand

Most leaks happen not because people are careless, but because personal data hides in places that are easy to overlook.

Manual find-and-replace

Searching for "John Smith" will not find "J. Smith", "Mr Smith", "Smith's" or a misspelling in an email thread. National insurance numbers, IBANs and phone numbers appear in many formats. Pattern-based detection catches variants that a simple search misses.

Headers, footers and metadata

Word and PDF files carry text outside the main body: headers, footers, footnotes, comments, tracked changes and document properties such as the author name. If you copy only the body text, you may be fine; if you upload the whole file, those parts travel with it.

Attachments and scans

An email often contains more personal data in its attachments than in the message itself, and a scanned PDF has no text for find-and-replace to find. LEXARIS handles EML and MSG emails together with their attachments, and scanned PDFs through OCR with the redaction burned into the image. The supported formats and their limits are covered in our guide to scans, audio and video.

Are tokens enough for data protection law?

Tokenised text is pseudonymised, not anonymised, as long as someone holds the key to reverse it. Under the GDPR, pseudonymised data can still be personal data, although whether it is personal data for a particular recipient, such as an AI provider without the key, is a question recent case law has addressed.

In practice, tokenisation is a strong safeguard: it keeps identifying details away from the provider and is named in the GDPR as a security measure. It does not remove the need to think about your lawful basis, your contracts and your records. Our guide on pseudonymisation versus anonymisation under the GDPR explains where tokens stand.

Getting started

You can try the workflow on the free tier, which covers five documents a day. For teams, the Cloud adds shared workspaces, history and an audit log, and developers can build the same steps into their own tools with the REST API, LLM proxy, Python SDK or CLI described in the developer section of the main page.

If you advise on data protection, the section for lawyers and DPOs sets out the compliance profiles and contractual terms. For more guides, see the guides hub.

Frequently asked questions

Is it safe to paste client documents into ChatGPT?

Not as they are. Pasting a contract or case file sends every name, address and identifier to the provider. Replace personal data with tokens first, so the provider only receives text in which direct identifiers are replaced.

Will the AI still give a useful answer if names are replaced with tokens?

Yes. Tokens such as [PERSON_1] and [PERSON_2] keep the structure of the document, so the AI can still tell the parties apart, summarise, draft and compare. You then restore the real names in its answer.

Can I just use find-and-replace in Word instead?

It is easy to miss spelling variants, initials, headers, footers, comments, document properties and attachments. A detection tool that covers these places and a check before sending is far more reliable.

Which AI providers can I use this with?

LEXARIS works with six AI providers, including ChatGPT, Claude and Gemini. Because the anonymised text contains only tokens, the workflow is the same whichever provider you choose.

Sources

  1. General Data Protection Regulation (EU) 2016/679
  2. European Data Protection Board
  3. Information Commissioner's Office (UK)

This guide is general information, not legal advice. Check the current text of the law and regulator guidance for your situation.

Try it on your own document

The demo runs entirely in your browser. Nothing is sent anywhere.

Related guides