Controlled Unmasking

What is controlled unmasking?

Controlled unmasking is the practice of revealing the real value behind masked or tokenized data only to a specific user, role or tool that policy allows, and only for the task at hand. Everyone else keeps seeing the masked form. Each reveal is checked against policy and recorded in an audit log.

For example, two people at a health insurer ask the same AI assistant about a disputed claim. The model reads the claim with the patient’s name and member ID replaced by tokens. The adjuster assigned to the claim sees the real name in the answer. An analyst on another team gets the same answer with the name still masked.

Adjuster sees: Claim 4471 for Maria Lopez was rejected for a missing referral.
Analyst sees:  Claim 4471 for <PERSON>tok_4c1e</PERSON> was rejected for a missing referral.

How controlled unmasking works

  • Data is masked first. Sensitive values are replaced with tokens as they enter a system, so the default state is masked.
  • Policy decides who sees what. Rules link roles, entity types and context. A nurse may see patient names but not Social Security numbers. A billing tool may see card numbers but not diagnoses.
  • The reveal happens at the edge. Real values are restored only where they are shown or used: a screen, a report or a tool call. The model and the logs keep tokens.
  • Every reveal is logged. The log shows who saw which value, when and under which rule.

Controlled unmasking vs other approaches

Approach What authorized users get What everyone else gets
Full access Real values Real values
Permanent redaction Nothing; the value is gone Nothing; the value is gone
Controlled unmasking Real values, per policy Masked values

Permanent redaction protects data, but it also stops legitimate work. Full access is simple, but every reader sees every value. Controlled unmasking sits between the two, which is why it is a common pattern with tokenization and dynamic data masking.

Why controlled unmasking matters for AI systems

An AI answer can pull from a ticket, a contract and a CRM record in one response, and many people with different rights may ask the same assistant. Database permissions were set for each source, but the answer mixes them. Controlled unmasking applies the reader’s rights to the answer itself, so the support rep and the account owner each see what they are cleared to see. The same idea applies to AI agents: a tool call can receive a real value while the conversation keeps the token.

How Protecto helps

Protecto masks sensitive data as it enters AI workflows and reveals real values by role. With Context-Based Access Control (CBAC), the decision can also weigh the task and context, not only the role. Users without access see the data masked, and each reveal is logged.

Frequently asked questions

How is controlled unmasking different from dynamic data masking?

Dynamic data masking usually hides database columns at query time. Controlled unmasking applies to tokenized data wherever it flows, including AI answers, documents and tool calls, and reveals values per user, role or tool.

Does the AI model see the real values?

In a typical setup, no. The model works with tokens, and real values are restored only for the authorized reader or tool after the model responds.

Can unmasking rights come from Active Directory or Okta?

Yes, through Protecto Privacy Gateway. You keep each user’s masking and unmasking access in AD or Okta groups, and Gateway issues a Protecto auth key with that access at login. If you use Protecto Vault directly, it is a headless API, so your team can build the integration around it.

Related terms

Detokenization · Context-based access control (CBAC) · Least privilege access · Data masking

Book a demo

See Protecto on your own data

Book a demo to see how Protecto finds and masks sensitive data before it reaches any AI model.

New: Protecto now runs inside LiteLLM. Control what sensitive data your models and tools see.
Read the launch blog