Rehydration
The complement to masking — restoring original values in the provider's response.
How it works
- Masking produces a token map:
PERSON_1 → "John Smith",EMAIL_1 → "john@acme.com". - The map exists in request-local memory only.
- When the provider responds, Privian substitutes each placeholder back to its first-observed surface form.
- The rehydrated text is returned in
response; the map is discarded with the request.
Example
text
Prompt: Email John Smith at john@acme.com about Friday.
Sent: Email PERSON_1 at EMAIL_1 about Friday.
Returned: Sent. I'll email PERSON_1 at EMAIL_1 about Friday.
Final: Sent. I'll email John Smith at john@acme.com about Friday.Properties
- Response-only. Rehydration runs once, on the provider response.
- First-observed surface form. If a prompt contains both
John Smithandjohn smith, both sharePERSON_1and rehydrate to the first form observed. - Lossless for masked spans. Tokens that appear in the response are restored verbatim.
- Stateless across requests. A token from request A cannot be rehydrated by request B.
Limitations
- If the model emits a placeholder that was not in the request map (a model hallucination), it is returned literally — Privian does not invent substitutions.
- Streaming responses use artificial chunking over the already-rehydrated text; native token-level streaming is not exposed in the beta.