Transform
masking_type: "transform" — Custodian Labs' proprietary de-identification. It swaps
sensitive values for realistic stand-ins and keeps the sentence readable, so the
output still works for LLMs, demos, testing, and downstream processing.
Python
from custodian_labs import GuardianLayer
result = GuardianLayer().deidentify_text_outputs(
"Dr. Emily Chen called Alex at 555-0100 about the appointment in Auckland.",
masking_type="transform",
pii_entities=["PERSON", "PHONE_NUMBER", "LOCATION"],
)
for item in result.outputs:
print(item.id, item.text)
TypeScript
import { GuardianLayer } from "@custodianlabs/sdk";
const result = await new GuardianLayer().deidentifyTextOutputs(
"Dr. Emily Chen called Alex at 555-0100 about the appointment in Auckland.",
{ maskingType: "transform", piiEntities: ["PERSON", "PHONE_NUMBER", "LOCATION"] },
);
for (const item of result.outputs) console.log(item.id, item.text);
outputs holds two candidates. Use outputs[0] by default; show both if a reviewer
picks.
1 Dr. Sarah Miller called Jordan at 555-0188 about the appointment in Wellington.
2 Dr. Laura Adams called Casey at 555-0142 about the appointment in Christchurch.
Options
| Option | Notes |
|---|---|
masking_type | "transform" (default) or "redact". |
pii_entities | Categories to process; omit or ["ALL"] for everything. See Supported Entities. |
replacements | { "original": "replacement" } to pin specific swaps (on deidentify_text). |
Transform vs Mask
transform | redact | |
|---|---|---|
| Output | Dr. Sarah Miller called Jordan... | Dr. ***** called ***** ... |
| Readable | Yes | No |
| Best for | LLM input, sample data, demos | Audit, "prove it's gone" |