Placeholder
masking_type: "placeholder" replaces each detected value with a label for its
category. The sentence keeps its shape, and anyone reading it can see what kind of
data was there without seeing the data itself.
Python
from custodian_labs import GuardianLayer
result = GuardianLayer().deidentify_text_outputs(
"Dr. Emily Chen called Alex at 555-0100. Email alex@example.com.",
masking_type="placeholder",
)
print(result.outputs[0].text) # e.g. "Dr. [NAME] called [NAME] at [PHONE]. Email [EMAIL]."
TypeScript
import { GuardianLayer } from "@custodianlabs/sdk";
const result = await new GuardianLayer().deidentifyTextOutputs(
"Dr. Emily Chen called Alex at 555-0100. Email alex@example.com.",
{ maskingType: "placeholder" },
);
console.log(result.outputs[0].text);
Prefer no code? Use the Dashboard
Everything on this page also works in the Dashboard. Open API Testing, pick your key, paste text or upload a file, choose the mode and the types of data, then click Mask Now.
Labels
| Entity | Label |
|---|---|
PERSON | [NAME] |
EMAIL_ADDRESS | [EMAIL] |
PHONE_NUMBER | [PHONE] |
LOCATION | [LOCATION] |
DATE_TIME | [DATE] |
ID_NUMBER | [ID] |
AGE | [AGE] |
OCCUPATION | [OCCUPATION] |
In CSV and spreadsheet files, whole cells in recognised columns are replaced, and a few
extra labels can appear, such as [CARD], [URL] and [COMPANY].
Options
Options are the same as for Transform. Use pii_entities to
label only some categories. Placeholder output is deterministic, so both outputs are
the same.
Which mode?
transform | redact | placeholder | |
|---|---|---|---|
| Output | Dr. Sarah Miller called Jordan... | Dr. E***** called A*****... | Dr. [NAME] called [NAME]... |
| Readable | Yes | No | Yes, with labels |
| Best for | LLM input, sample data, demos | Audit, proving data is gone | Reviews, analytics, prompts where the type matters |