ExtraTunnel
Book a back-test Download

Blog · 5 min read

Redaction vs masking vs tokenization for AI prompts

Redaction removes a private detail for good. Masking hides all or part of it behind a fixed pattern. Tokenization swaps it for a placeholder that can be mapped back to the real value later. For AI prompts, reversible placeholders usually give the most useful answer, because the model keeps the structure of the text and the real values can be put back after it replies.

The same sentence redacted, masked and sealed
Illustration: ExtraTunnel.

Redaction, masking and tokenization defined

Redaction

Redaction deletes the detail or covers it with a blank marker. “Call Dana Reyes on 555-0142” becomes “Call [REDACTED] on [REDACTED]”. Nothing can bring the original back, which is the point.

Data masking

Masking replaces characters with a fixed symbol or a made-up value of the same shape. A card number becomes “**** **** **** 4821”. The text still looks like the right kind of data, which helps with testing and support screens. It is normally one-way.

Tokenization

Tokenization swaps each value for a stand-in and keeps a private table that links the two. “Dana Reyes” becomes “[NAME_1]” everywhere it appears. Whoever holds the table can reverse the swap. Whoever does not hold it sees only the stand-in.

Sealing

Sealing is the word ExtraTunnel uses for tokenization applied to AI requests on the person’s own computer. Private details are swapped for labelled placeholders before the request leaves, and the real values are put back into the answer on the same computer.

Redaction vs masking vs tokenization comparison

ApproachWhat the AI seesReversibleEffect on the answerMain limit
RedactionA blank markerNoModel cannot tell people or values apartAnswer needs manual rework
MaskingPart of the value, or a fake of the same shapeUsually noReads naturally, but values are wrong or partialWhat remains can still identify someone
Tokenization (sealing)A labelled placeholder, the same one each timeYes, with the tableStructure kept, real values restored afterwardsThe table must be protected, and detection can miss things

Why reversible placeholders keep AI answers useful

Most AI tasks depend on the shape of the text, not the private values in it. To draft a reply, summarize a thread or fix a query, the model needs to know that a name is a name and that the same person appears twice. It does not need to know who the person is.

Take “Email Dana Reyes about invoice 4471 for $18,200, and copy Sam Ortiz.” With redaction, the model sees four identical blanks. It cannot tell who gets the email and who is copied. With labelled placeholders it sees “Email [NAME_1] about invoice [ACCOUNT_1] for [AMOUNT_1], and copy [NAME_2].” It can write the whole email using those labels. When the answer comes back, each label is swapped for the real value and the draft is ready to send.

Limits of redaction, masking and tokenization

All three depend on finding the private details first. Detection is the shared weak point, and no detector catches everything.

  • Redaction strips meaning along with the detail. People often work around it by pasting the original, which defeats the purpose.
  • Masking can leave enough behind to identify someone. The last four digits of a card, next to a city and a date, may be all it takes.
  • Tokenization moves the risk to the table. Anyone who gets the table and the sealed text has the original.

Sealing has specific blind spots worth knowing:

  • Unusual values. Nicknames, misspelled names, internal project code names and odd ID formats are harder to spot than a card number.
  • Identity by description. “The finance chief of our largest customer in Ohio” names nobody, yet may point to one person. Swapping values does not hide context.
  • Hidden values. If the model must add up amounts or compare dates, it cannot do that with placeholders. That work has to happen on your side.
  • Unreadable files. Images, scans, voice and video cannot be sealed as text. The safe choice is to hold them back.
  • Altered placeholders. A model may reword or drop a label, and then that value cannot be restored automatically.

How to choose a method for AI prompts

  1. List the kinds of private detail that appear in your prompts: names, account numbers, amounts, dates, keys.
  2. Decide whether you need the real values back in the answer. If yes, you need something reversible.
  3. Check whether the model needs the value itself, such as doing math on amounts. If so, plan to do that step locally.
  4. Test on a sample of your own files and count what was missed.
  5. Decide what happens when the tool is unsure. Blocking the request is safer than sending it.

How ExtraTunnel seals AI prompts

ExtraTunnel does the swap on the person’s computer. A second, simpler program checks every request before it leaves, and a request that fails the check does not go out. Each request gets a signed receipt that records counts and hashes, not the text.

It can miss things, like any detector. That is why enterprise customers start with a paid back-test on 500 of their own files. See the product page for the flow and the security page for the known gaps.

Common questions

Is tokenization the same as encryption?

No. Encryption scrambles a value with a key, and the result can be unscrambled by anyone with that key. A token is a stand-in that is looked up in a private table.

Is masked data anonymous?

Not always. Partial values and surrounding context can still point to a person, so treat masked text with care.

Can AI give good answers on redacted text?

For simple tasks, yes. Once a document has several people or values, blank markers make them impossible to tell apart and the answer gets worse.

Does tokenization meet GDPR or PCI DSS?

GDPR is the EU law on handling personal data, and PCI DSS is the card industry’s security standard for card data. Whether a method meets either depends on your whole setup, so ask your counsel or assessor. This is not legal advice.

What can sealing miss?

Unusual names and IDs, people identified by description instead of by name, and anything inside files it cannot read. Test it on your own data before relying on it.

Sources and further reading

  1. SP 800-188, De-Identifying Government DatasetsNIST
  2. NIST Privacy FrameworkNIST
  3. PCI Data Security StandardPCI Security Standards Council
  4. Health Information Privacy (HIPAA)U.S. Department of Health and Human Services

Primary sources, linked so you can check them. They do not endorse ExtraTunnel.

Ask an AI about this article

Keep the answer useful and the details at home

ExtraTunnel seals private details on your computer and puts them back into the answer when it returns.

Keep reading

What is shadow AI and how to manage it

AI data leak prevention: how DLP for AI works

The private line to every AI.

One switch. Your own tools. A signed record of every request.