Guardian Layer Quickstart
Try Guardian Layer in the Dashboard with no code, then make the same call from your own code.
Get an API key
Sign up, then click Get Started
Free on Subscriptions.
Activating a plan creates your key. Signing in alone doesn't. Copy it from
API Keys. It starts with
custodian_labs_.
Try it in the Dashboard
Open API Testing, select your key and choose Enter Text. Paste the text below, pick All PII, then Transform, then Mask Now.
Please contact Jane Smith at jane.smith@example.com or call (415) 555-0123.
The result appears in Results. Try Redact to see ***** output instead.
To try a file, save the text below as sample.txt. Then choose Upload File, run
it, and download the result. CSV, Word and PDF files work too.
sample.txt
Customer: Jane Smith
Email: jane.smith@example.com
Phone: (415) 555-0123
Call it from code
- curl
- Python
- TypeScript
export CUSTODIAN_API_KEY="custodian_labs_..."
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": "Please contact Jane Smith at jane.smith@example.com.", "masking_type": "transform"}'
pip install custodian-labs
export CUSTODIAN_SDK_API_KEY="custodian_labs_..."
from custodian_labs import GuardianLayer
out = GuardianLayer().deidentify_text_outputs(
"Please contact Jane Smith at jane.smith@example.com.",
masking_type="transform",
)
print(out.outputs[0].text)
npm install @custodianlabs/sdk
export CUSTODIAN_SDK_API_KEY="custodian_labs_..."
import { GuardianLayer } from "@custodianlabs/sdk";
const out = await new GuardianLayer().deidentifyTextOutputs(
"Please contact Jane Smith at jane.smith@example.com.",
{ maskingType: "transform" },
);
console.log(out.outputs[0].text);
Next
| You want to | Go to |
|---|---|
| De-identify a CSV or Excel file | CSV and Excel guide |
| De-identify a Word document or PDF | Word guide · PDF guide |
| Strip PII before calling an LLM | Mask PII before any LLM |
| See every endpoint and field | Guardian Layer API |