Guardian Layer in your stack
Guardian Layer sits between sensitive data and anything that shouldn't see it. You can use it in two ways.
On its own, in front of anything
Your backend sends data to Guardian Layer and passes on only the safe version: to an LLM, a database, an analytics tool or a third party.
Your system
Your appChats, forms, uploads, tickets.
Jane Smith, 415-555-0123Your backendHolds the API key and calls Guardian Layer.
Guardian LayerFinds personal data and transforms, masks or labels it.
[NAME], [PHONE]Any LLMOpenAI, Claude, Gemini or your own
StorageDatabases, logs, data lakes
Other servicesAnalytics, vendors, support tools
Call it from your backend, not the browser. The API key is a secret, and your server should own logging, retries and usage limits.
Inside a Custodian Agent
Set privacy_enabled on an agent and the same masking runs on every message. Details
are sanitized on the way in, and the reply is rehydrated on the way out. You don't make
any extra calls.
UserSends a message.
Hi, I'm Dana Reyes1. SanitizeReplaces personal details before the model.
Hi, I'm [PII_1]ModelWrites the reply. Only ever sees the stand-ins.
Thanks [PII_1]…2. RehydratePuts the real details back in the reply.
Thanks Dana Reyes…UserGets a complete answer.
privacy_enabled and this runs on every message.See the private agent template and Privacy masking.
Pick a call
| You have | You want | Call |
|---|---|---|
| Text | To see what's sensitive first | analyze_proprietary() |
| Text | Readable de-identified text | deidentify_text_outputs() with transform |
| Text | Values visibly gone | The same, with redact |
| Text | Values replaced by labels like [NAME] | The same, with placeholder |
| A file | A de-identified file back | deidentify_file() |
| An agent | PII sanitized before the model, reply rehydrated after | privacy_enabled on the agent |
See also
Guardian Layer overview · Mask PII before any LLM · Guardian Layer API