How to Redact Sensitive Data Before Giving It to an AI
Crossing out or writing « XXX » destroys the info. The right way: reversible token redaction, restored in your browser. Here's how.
Redacting sensitive data before an AI is a good reflex. But the manual method often disappoints. Crossing out with a marker or replacing with « XXX » has two flaws. First, you miss occurrences. Second, and above all, you destroy the information. The AI sees only interchangeable « XXX ». It can no longer return a usable answer. And you can no longer restore the real values. The right method is different: reversible redaction. You replace each sensitive value with a unique token. You keep the mapping on your side. Then you restore the real values in the model's answer.
Redacting by hand: two flaws
The instinctive method is to remove identifiers by hand. You cross out the name. You replace the client number with « XXX ». It beats nothing. But two problems appear fast.
- You miss some. A name returns three paragraphs later, and it slips through.
- You lose useful information. Three different clients all become « XXX », so they blur together.
- The answer becomes unusable. The AI reasons over holes, not coherent data.
- You can't go back. « XXX » never turns back into the real value.
Manual copy-paste has a deep limit. It picks between two evils. Either you let sensitive data through. Or you mangle the text until it's unusable.
Reversible redaction: keep the meaning, reduce exposure
Reversible redaction replaces each sensitive value with a token. « Marie Dupont » becomes a stable token, for example. Each value gets its own token. Two different clients keep two different tokens. So the AI sees coherent text. It can reason, compare, structure. You keep the token↔value mapping. At the end, you restore the real values in the answer.
The four steps of reversible redaction
In practice, the approach fits in four steps. They follow this order.
- 1Spot the sensitive data: names, e-mails, IBANs, numbers, technical keys.
- 2Replace each value with a reversible, coherent token.
- 3Send the masked text to the AI, never the real values.
- 4Restore the real values in the answer, on your side.
Every step matters. Skip the first and data leaks. Neglect the fourth and you're left with an answer full of tokens.
| Criterion | Manual redaction (« XXX ») | Reversible redaction (tokens) |
|---|---|---|
| Missed occurrences | Frequent, checked by eye | Systematic detection, but heuristic |
| Meaning kept | Lost, everything becomes « XXX » | Kept, distinct and stable tokens |
| Usable answer | Rare, the AI reasons over holes | Yes, the AI sees coherent text |
| Back to real values | Impossible | Automatic, via the mapping |
Minimization, a GDPR principle
This approach meets a GDPR principle: minimization. Article 5 asks you to limit data to what's necessary. Sending the AI only what's useful reduces exposure. The CNIL restates this for AI. An AI system built on personal data doesn't escape the GDPR. And when anonymous or synthetic data is enough, you should prefer it. Reversible redaction serves that logic. It sends the model the meaning, not the identities.
How ONYRI redacts your data
ONYRI Sanitize applies this method, in the browser. The engine spots sensitive data with built-in detectors. You add your own rules for your field. Each value is replaced with a reversible token. The key point: the token↔value mapping stays on your device. It reaches no server. The AI's answer is then de-tokenised in your browser. You get your real values back, while the model saw only tokens.
The product comes in several surfaces. A web app with the Text, Tables and Chat spaces. A browser extension for the major AI sites. There is an entry tier and paid Pro and Team tiers. You choose according to your needs.
Let's be clear about the limits. Detection is heuristic. It combines patterns and an entropy calculation. It reduces exposure, it doesn't remove it. An unusual occurrence can slip by. Always reread the masked text before sending.
Redaction done right doesn't erase the information: it sets it aside, just for the prompt. ONYRI lets you use AI while keeping your real values on your device. The model works on coherent tokens. You get a usable answer, with your data restored. It's minimization at the exact point where it counts: right before sending.
Frequently asked questions
- How do you redact sensitive data before giving it to an AI?
- Don't cross out with a marker or write « XXX »: you'd miss some and destroy the information. Prefer reversible redaction. Spot the sensitive data, replace each value with a coherent token, send the masked text, then restore the real values in the answer. The AI works on tokens, while you keep the mapping on your side.
- Does reversible redaction make my data anonymous under the GDPR?
- No. Reversible redaction maps to pseudonymisation, not anonymisation. The CNIL reserves anonymisation for an irreversible process. Your data stays personal data, and the GDPR still applies. The real benefit is minimization: the real value doesn't go into the prompt, it stays on your device.
- Why not just replace with « XXX »?
- Because « XXX » destroys the information. Three different clients become identical, and the AI can no longer return a usable answer. Above all, « XXX » is irreversible: you can't recover the real value. A reversible token keeps the meaning and is restored later in the answer.
Sources & references
- Personal data anonymisation (irreversible anonymisation vs reversible pseudonymisation; pseudonymised data is still personal) — CNIL
- Developing AI systems: the CNIL's recommendations for GDPR compliance (minimization, article 5) — CNIL
- General Data Protection Regulation (GDPR) — consolidated text (art. 4 pseudonymisation, art. 5 minimization) — EUR-Lex (European Union)
Keep your sensitive data in your browser
ONYRI Sanitize detects and masks your sensitive data before it reaches the AI, then restores the answer — from names to API keys.