Back to Blog
Private & Edge AI

Redacting personal data before prompts leave your network

Prajakta Sawant(Co-Founder & Technical Director)

Summary

PII redaction helps banks and insurers use external AI models without directly exposing customer personal information. By replacing names, account numbers, phone numbers, and other identifiers with reversible placeholders before prompts leave their environment, organisations can reduce data exposure while retaining the context needed for AI processing.

A plain-English guide for banks and insurers that want to use the best AI models on customer correspondence, without sending customer personal data outside their own environment.

If you work at a bank or an insurer, you have probably heard this question in a meeting:

"How do we use ChatGPT-class models without sending customer personal data to them?"

It's a fair question. The best AI models are very good at your teams' daily work, but the documents involved are full of information you are not supposed to send outside. This guide explains one practical answer: remove the personal details before a prompt leaves your environment, and put
them back when the answer comes home. No background in AI or data protection is needed.

01Why AI Prompts Need Personal Data Protection

Banks and insurers receive a constant stream of customer letters and emails. Someone has to read each one, understand it and write a reply, and modern AI models can do much of this in seconds. But look at what is inside a typical letter:

Dear team, I am Sarah Thompson (date of birth 14 March 1986). My claim on policy HL-2291-7781 was rejected, and the refund should go to my account GB82 WEST 1234 5698 7654 32. Please call me on +44 20 7946 0958.

One short paragraph holds a name, a date of birth, a policy number, a bank account and a phone number. (All of these are made up.) The most capable AI models run on another company's computers, often in another country. Using them means sending that paragraph outside your organisation. That is the tension: the business wants the best AI, and privacy rules say customer data should not leave without very good reason and strong safeguards.

The result is familiar in many organisations:

  • AI pilots stall at the privacy review. A promising demo stops when someone asks where the customer data goes.
  • People use public AI tools anyway, with no controls at all.
  • Contracts are promises, not proof. A vendor agreement doesn't stop data from leaving.
  • Simple find-and-replace tools miss things, especially names, addresses and mixed-language messages.
  • There is no evidence to show the data protection team how well any masking actually works.

02Why this matters now

Data protection laws are tightening around the world. In Europe and the UK, the GDPR already sets strict rules on sharing personal data and sending it abroad. India's Digital Personal Data Protection (DPDP) Rules apply their core obligations from May 2027. Many other countries have similar laws.

Faced with this, most teams weigh four options:

The four options teams usually weigh

Redaction doesn't replace contracts or other controls; it sits alongside them. But it changes the question from "Do we trust where the data goes?" to "Did any personal data go at all?"

03The Idea Behind Reversible Data Masking

Before a prompt leaves your environment, swap every personal detail for a label like [NAME_1]. Let the external AI work on the labelled text, then swap the real details back when the answer returns.

Think of asking an expert in another city to review a document without telling them who is involved. You cover every name with a sticker (Person A, Person B) and keep a card in your drawer saying who is who. The expert replies "Person A should write to Person B", and you read it with your card. They gave expert advice without ever learning who anyone was. A redaction layer does the same, in software, for every prompt.

04How the Redaction Process Works

Picture a checkpoint between your applications and any external AI service. Every prompt passes through it on the way out, and every answer passes back through it on the way in.

A privacy filter at the boundary of your environment
  1. Your application sends a prompt, such as "Summarise this complaint and draft a reply."
  2. The redaction layer finds the personal data and swaps each item for a placeholder: Sarah Thompson becomes [NAME_1].
  3. The real values go into a private lookup table that never leaves your environment.
  4. Only the masked prompt goes out. The external model does its work on text with no personal data in it.
  5. The answer comes back and is restored, with each placeholder swapped back for the real value.
  6. Your team gets a normal, ready-to-use reply, and the lookup table is deleted.

Here is the same complaint at each stage:

One complaint, from inbox to reply

The external model did all the useful work: understanding the complaint, setting the tone and drafting the reply. It never saw who the customer was.

05Why Placeholders Must Be Reversible

Why just not replace personal data with **** ? Because that breaks the answer. The model can't tell whether a blank is a name or a phone number, or whether two blanks are the same person, and there is no way to fill the gaps afterwards.

Why placeholders must be reversible

Good placeholders are consistent (the same person is always [NAME_1]), typed ([PHONE_1] tells the model what kind of detail was there) and local (the lookup table stays in your environment).

One legal caveat: masked data that can be mapped back to a person is "pseudonymised", not "anonymised". Under the GDPR it is still personal data in your hands. So redaction is a strong safeguard, not a legal exemption, and one control among several.

06PII Detection: Rules vs. Small Language Models

Everything depends on finding the personal data reliably. There are two ways to do it.
Rules look for fixed patterns. They work very well for details with a predictable shape, such as email addresses, card numbers and bank account numbers. They struggle with anything that needs understanding.

Where rules work, and where they fall apart

A small language model fills that gap. Instead of matching patterns, it reads the context the way a person would. It knows that "Rose" in "Rose called about her claim" is a name, and that "flat 4B, behind the old station" is part of an address.

07"What Makes a Language Model 'Small', and Why It Matters."

  • It is deployed in your own environment: your own private cloud account or your own data centre (on-premises). The raw customer data never has to leave to be checked.
  • Finding personal data is a narrow job, so a small model can do it well. It is far cheaper and faster to run than the large "frontier" models from the big AI companies.
  • The frontier model is still used for the hard part, the reading and writing, but it only ever sees
    masked text.

The likely best answer is rules and a small language model together: rules for the neat, fixed-format details, and the model for the messy, human ones. That's a sensible starting point, but it should be tested on your own documents.

08Key Components of a Redaction System

A redaction layer is a few simple parts working together. Everything except the external AI model runs in your own environment.

What a redaction layer is made of
  • AI gateway: one checkpoint every request passes through, so nothing slips past.
  • Rules and a small language model: together they find the personal data.
  • Placeholder vault: holds the lookup table for a single request, then deletes it.
  • Restore and check: puts the real values back and checks the reply for anything unexpected.
  • Testing: made-up test letters and accuracy reports, before and after go-live.

09How to Measure it's Accuracy

"It seems to work" won't satisfy a data protection officer. You need two simple numbers.

Measure what your data protection officer will ask about
  • Recall (most important): of all the personal data really there, how much did the filter catch? If a letter holds 10 personal details and the filter catches 9, recall is 90%. The one it missed would have reached the external model.
  • Precision: of everything the filter hid, how much really was personal? Hiding "London" in "our London branch" makes answers slightly worse, but nothing leaks.

Report results for each type of detail (names, addresses, account numbers and so on), never as one average, because one weak type can hide inside a good overall score. Agree the pass mark before testing, and test on realistic made-up letters so no real customer data is needed.

10How to Implement PII Redaction

The safest path is to prove the approach on your own document formats first, then put it in front of real traffic.

A practical path to a redaction layer you can trust

Start small: one workflow, such as drafting replies to complaints, with a test set that looks like your real letters and languages.

11Limitations of Data Redaction

  • It doesn't replace other controls, such as vendor agreements, access controls and privacy reviews.
  • Some details identify people indirectly. A rare medical condition plus a small town can point to one person even without a name.
  • Accuracy can drift as new document types, languages or formats appear, so keep re-testing.

12Key terms in plain words

TermWhat it means
Personal data (PII)Any detail that can identify a person: name, date of birth, phone, address, account or ID number.
Redaction / maskingHiding personal details before text is shared, here by swapping them for placeholders.
PlaceholderThe stand-in label, such as [NAME_1] or [PHONE_1].
Lookup tableThe private list that maps each placeholder back to its real value.
Frontier modelOne of the newest, most capable AI models from the big AI companies, used as a cloud service.
Small language modelA compact AI model deployed in your own environment (private cloud or onpremises) and good at narrow tasks.
RecallOf all the real personal data, the share the filter caught. Misses are potential leaks.
PrecisionOf everything the filter hid, the share that really was personal data.
PseudonymisedMasked, but reversible by whoever holds the key. Still personal data under the GDPR.
GDPR / DPDPData protection laws in Europe and the UK, and in India (core obligations from May 2027).

Want frontier AI without sending customer data out?

GenAI Protos helps banking and insurance teams design and test redaction layers on their own document formats, so they can use frontier AI with evidence their data protection officer can sign off.

Frequently asked questions

Often yes, with the right contract sand controls. Redacting first means the external model never receives the personal data, which removes a large part of the risk.

For fixed-format details like emails and account numbers, rules work very well. For names, addresses and mixed-language text, they miss too much. That's where a small language model helps.

Usually not much, because typed, consistent placeholders keep the meaning of the text.

No. It's a strong safeguard that reduces how much personal data leaves your environment. Compliance still depends on your full set of legal and technical controls.