Skip to main content

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.

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​

Modemasking_typeOutputStatus
DefaultSet by privacy_enabled on an agentSanitizes to labels such as [PII_1], then rehydrates the reply with the originalsAvailable in agents
Transformtransform (used if you don't set one)Realistic stand-in values. The text stays readable.Available
Maskredact*****Available
PlaceholderplaceholderCategory labels such as [NAME] and [EMAIL]Available

You can also detect only, which lists sensitive terms without changing the text.

What it handles​

InputHow
TextDe-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 PDFsComing 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.