pseudonymize mode and you still have the matching encryption key.
When Rehydration Is Possible
Rehydration requires all of the following:- The text was processed in
pseudonymizemode - You kept the returned encrypted
piiMap - You still have the correct key to decrypt that
piiMap
Basic Flow
What Rehydration Uses
Rehydra matches placeholders such as<PII type="EMAIL" id="1"/> (or custom formats like [[PII type="EMAIL" id="1"]]) against the decrypted map and replaces them with the original values.
This means the placeholder structure must stay intact between protection and restoration. If you used a custom tagFormat during anonymization, pass the same format to rehydrate().
Rehydration vs Anonymization
| Workflow | piiMap exists | Originals recoverable |
|---|---|---|
pseudonymize | Yes | Yes |
anonymize | No | No |
Common Failure Modes
- Using the wrong key
- Losing the encrypted
piiMap - Running in
anonymizemode instead ofpseudonymize - Modifying placeholder tags so they no longer match the stored mapping
Where It Shows Up
Rehydration is part of:- SDK workflows using
decryptPIIMap()andrehydrate() - CLI workflows using
rehydra rehydrate - Agent and plugin flows that restore values locally before tool execution
Next Steps
Encryption & Security
Learn how
piiMap data and keys are handled.Anonymization & Pseudonymization
See how reversible and irreversible modes differ.