Skip to main content

Guardian Layer Overview

Guardian Layer detects and de-identifies PII/PHI in text and files. Call it before content reaches an LLM, a database, another service, or a screen.

Use it through the SDK:

Python
from custodian_labs import GuardianLayer

out = GuardianLayer().deidentify_text_outputs(
"Contact Jane Smith at jane.smith@example.com.",
masking_type="transform",
)
print(out.outputs[0].text) # "Contact Maria Lopez at maria.lopez@example.com."
TypeScript
import { GuardianLayer } from "@custodianlabs/sdk";

const out = await new GuardianLayer().deidentifyTextOutputs(
"Contact Jane Smith at jane.smith@example.com.",
{ maskingType: "transform" },
);
console.log(out.outputs[0].text);

See the Python or TypeScript Guardian Layer client for every method.

Modes​

Modemasking_typeOutputStatus
Transformtransform (default)Realistic stand-in values; text stays readableAvailable
Maskredact*****Available
Placeholder—Entity labels ([PERSON], [PHONE_NUMBER])Coming soon

Domain-specific matching (Medical, Finance, …) and compliance profiles (GDPR, HIPAA) are also coming soon.

What you can do​

TaskMethod
De-identify textdeidentify_text_outputs() / deidentifyTextOutputs()
De-identify a file (CSV, XLSX, XLS, DOCX, PDF, TXT)deidentify_file() / deidentifyFile()
Detect sensitive terms without changing the textanalyze_proprietary() / analyzeProprietary()
De-identify an imageComing soon

Inline during chat​

Set privacy_enabled / privacyEnabled on a Custodian Agent and the same masking runs automatically on every message before the LLM, then restores the values in the reply.

See also​

Detection vs De-identification · Transform · Masking · Supported Entities · File De-identification