Private agent
An agent that never sends personal details to the model. Messages are sanitized on the way in and the reply is rehydrated on the way out.
This example: a clinic intake assistant for patient messages. Names, ages and phone numbers are sanitized before the model sees them.
Example (replies vary)
You: Hi, I'm Dana Reyes, 45, call me on 415-555-0123 about my knee pain.
1. Sanitized: Hi, I'm [PII_1], [PII_2], call me on [PII_3] about my knee pain.
(this is all the model sees)
Model says: Thanks [PII_1]. Summary: knee pain, callback requested at [PII_3].
2. Rehydrated: Thanks Dana Reyes. Summary: knee pain, callback requested at
415-555-0123.
(this is what your user gets)
- Python
- TypeScript
from custodian_labs import Custodian
app = Custodian(
model="gpt-6-luna",
system_prompt="You are a clinic intake assistant. Summarize what the patient needs.",
privacy_enabled=True,
).deploy()
reply = app.chat("Hi, I'm Dana Reyes, 45, call me on 415-555-0123 about my knee pain.")
print(reply.response) # Dana's details are back in the reply; the model never saw them
import { Custodian } from "@custodianlabs/sdk";
const app = await new Custodian({
model: "gpt-6-luna",
systemPrompt: "You are a clinic intake assistant. Summarize what the patient needs.",
privacyEnabled: true,
}).deploy();
const reply = await app.chat("Hi, I'm Dana Reyes, 45, call me on 415-555-0123 about my knee pain.");
console.log(reply?.response); // Dana's details are back in the reply; the model never saw them
Which mode does privacy_enabled use?
It uses Guardian Layer's Default mode, which is built for agents. It works in two steps:
- Sanitization. Personal details are replaced with labels such as
[PII_1]before the model sees them. - Rehydration. When the reply comes back, every original detail is put back, so your user gets a complete, personal answer.
| Default | Transform | Masking | Placeholder | |
|---|---|---|---|---|
| Model or reader sees | [PII_1] | Maria Lopez | D***** | [NAME] |
Transform, Masking and Placeholder are for calling Guardian Layer directly.
By default it covers names, phone numbers, ages and dates.
Want a different style, or to mask data outside an agent? Call Guardian Layer yourself with the mode you need. See Guardian Layer and Mask PII before any LLM.
Learn more
- Privacy masking: what happens to each message and what's covered.
- Guardian Layer: the masking service, which you can also call directly.