Guardian Layer
Guardian Layer detects and de-identifies personal data (PII and PHI) in text and files. It's a standalone service with its own API. Use it in front of any LLM, database, analytics tool or third-party service. You don't need to use Custodian Agents.
sensitive input → Guardian Layer → de-identified output → any LLM, storage or service
Code or no code. Everything Guardian Layer does can be done from your code (SDKs or REST API) or in the Dashboard, with nothing to install.
Quickstart
Try it in the Dashboard, then make the same call with curl or an SDK.
RESTAPI reference
Every endpoint, request field and response, for any language.
GuideMask PII before any LLM
Keep personal data out of OpenAI, Anthropic, Gemini or your own model.
Example
curl -X POST "https://privacy.custodianlabs.io/api/v1/deidentify/text/proprietary/outputs" \
-H "X-API-Key: $CUSTODIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Contact Jane Smith at jane.smith@example.com.", "masking_type": "transform"}'
{
"original_text": "Contact Jane Smith at jane.smith@example.com.",
"outputs": [
{ "id": 1, "text": "Contact Maria Lopez at maria.lopez@example.com." },
{ "id": 2, "text": "Contact Laura Adams at laura.adams@example.com." }
],
"mode": "PROPRIETARY_OUTPUTS"
}
The response also includes a meta object with detection detail.
The same call from the SDKs is GuardianLayer().deidentify_text_outputs(...) in
Python and new GuardianLayer().deidentifyTextOutputs(...) in
TypeScript.
Modes
| Mode | masking_type | Output | Status |
|---|---|---|---|
| Default | Set by privacy_enabled on an agent | Sanitizes to labels such as [PII_1], then rehydrates the reply with the originals | Available in agents |
| Transform | transform (used if you don't set one) | Realistic stand-in values. The text stays readable. | Available |
| Mask | redact | ***** | Available |
| Placeholder | placeholder | Category labels such as [NAME] and [EMAIL] | Available |
You can also detect only, which lists sensitive terms without changing the text.
What it handles
| Input | How |
|---|---|
| Text | De-identify text |
CSV and Excel (.csv, .xlsx, .xls) | De-identify a CSV or Excel file |
Word (.docx) | De-identify a Word document |
PDF (.pdf) | De-identify a PDF |
Plain text files (.txt) | File de-identification |
| Images and scanned PDFs | Coming soon |
Limit which kinds of data are touched with pii_entities. See
Supported entities.
Compliance profiles (GDPR, HIPAA) are coming soon.
Inside Custodian Agents
Set privacy_enabled on an agent and Guardian Layer runs on every chat message
automatically. See the private agent template.