Fix the definitions before comparing
Each technique changes a sensitive value in a different way. The comparison below uses reversibility, utility, and auditability as its criteria, so the definitions need to be precise first.
- Redaction
- Removes the sensitive value from the prompt.
- Masking
- Obscures or substitutes part of the value. Usually one-way in prompts.
- Tokenization
- Replaces the value with a token whose original sits in a vault. Reversal depends on that vault.
- Pseudonymization
- Replaces identifiers with consistent aliases. Re-linking needs separate information.
How the techniques compare
Each technique trades protection against the context the model keeps. Reversal, where it exists, depends on something held outside the prompt.
| Technique | What it does | Trade-off |
|---|---|---|
| Redaction | Removes the value. | Highest protection, lowest context. |
| Masking | Obscures or substitutes part of the value. | Usually one-way in prompts. |
| Tokenization | Replaces the value with a token. | Reversal depends on a vault. |
| Pseudonymization | Replaces identifiers with consistent aliases. | Re-linking needs separate information. |
What each technique does to model output
The model can only work with what remains in the prompt, so the choice of technique shapes how useful its answer can be.
- Redaction: the model never receives the value, which gives the highest protection and the lowest context.
- Tokenization and pseudonymization: the model keeps a stable entity to reason about, and the original can be restored later where the vault or separate information allows it.
- Masking: the model sees an obscured or substituted version of the value, which is usually not reversible in prompts.
For multi-turn sessions and agent tool calls, entity consistency matters, because a stable token or alias lets the model refer to the same entity across turns.
Choosing by data type and use case
Set the policy per data type and use case rather than choosing one technique for everything.
- Use redaction when the model does not need the value.
- Use tokenization when the model needs a stable entity or the original must be restored later.
- Use pseudonymization when the model needs consistent aliases for identifiers.
- Use masking when part of the value can be obscured or substituted and restoration is not required.
Where to enforce each technique
Enforce the choice at a layer that can log and audit it. Prompts reach the model through free text, retrieved context, and tool-call payloads, so enforcement needs to cover all of them.
Reversal needs its own controls. Decide who can restore originals, and which vault or key management governs that access. The audit trail should cover policy decisions and enforcement points, and the log itself should be protected.
Criteria for evaluating prompt protection tooling
- Detection accuracy in free text, retrieved context, and tool-call payloads, and how the vendor measures it
- Support for all four transformations, with policy set per data type and use case
- Reversal controls: who can restore originals, and what vault or key management governs it
- Audit trail covering policy decisions and enforcement points, with the log itself protected
- Latency added at the enforcement point, tested against your own traffic
- Entity consistency across multi-turn sessions and agent tool calls