Rehydration is the step that turns placeholder-based text back into its original values. It only works when the text was produced inDocumentation Index
Fetch the complete documentation index at: https://docs.rehydra.ai/llms.txt
Use this file to discover all available pages before exploring further.
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.