---
title: "Data Masking"
description: "Data masking replaces sensitive values with realistic substitutes so prompts remain usable without exposing the originals. How it differs from encryption and redaction."
url: "https://sonomos.ai/glossary/data-masking/"
source: "https://sonomos.ai/glossary/data-masking/"
---

# Data Masking

Replacing sensitive values with realistic-looking substitutes so the data remains usable while the originals never leave the device.

## In depth

Data masking transforms sensitive fields — names, account numbers, identifiers — into substitutes that preserve format and meaning but no longer expose the underlying information. A masked credit card number still looks like a credit card number to a downstream system, but it is no longer linkable to the real cardholder. Masking can be reversible (the original can be recovered with a key) or irreversible (the original is discarded). It is distinct from encryption, which produces unreadable ciphertext, and from redaction, which removes the value entirely.

## Examples

- Replacing "Acme Corp v. Smith" with "Client A v. Witness 1" before sending a draft brief to an AI model.
- Substituting a real Social Security Number with a structurally valid synthetic one for a test database.
- Swapping a patient name for a stable pseudonym so a clinician can still ask follow-up questions about the same record.

## How Locke handles data masking

Locke masks sensitive data locally, before any text leaves your device. Locke 1.0 replaces detected values with one-way placeholders, so the AI never sees raw values. Reversible tokenization is planned shortly after 1.0.

[See the product](https://sonomos.ai/locke/)

## Related terms

- Tokenization

  Replacing a sensitive value with a non-sensitive token that maps back to the original through a separate, controlled lookup.
- Redaction

  Removing or blacking-out sensitive content so it is no longer present in the document or prompt.
- Personally Identifiable Information (PII)

  Any information that can identify a specific person, either directly (name, SSN) or in combination with other data (zip code + birthdate).

## Reading on this topic

- [What Is PII Redaction? A Plain-English Guide for AI Users](https://sonomos.ai/blog/what-is-pii-redaction-ai/)
- [AI Data Leakage: 7 Ways Sensitive Information Escapes to LLMs (and How to Stop It)](https://sonomos.ai/blog/ai-data-leakage-7-ways-sensitive-info-escapes-to-llms/)
- [How to Protect Sensitive Data When Using ChatGPT, Claude, and Gemini (2026 Guide)](https://sonomos.ai/blog/protect-sensitive-data-chatgpt-claude-gemini-2026/)
