Skip to main content

Masking

masking_type: "redact" — replaces each detected value with ***** (first character kept). Use it when the point is to show the value is gone: audit trails, compliance review, anything where a realistic stand-in would mislead.

Python
from custodian_labs import GuardianLayer

result = GuardianLayer().deidentify_text_outputs(
"Dr. Emily Chen called Alex at 555-0100.",
masking_type="redact",
)
print(result.outputs[0].text) # "Dr. E***** C***** called A***** at 5*****."
TypeScript
const result = await new GuardianLayer().deidentifyTextOutputs(
"Dr. Emily Chen called Alex at 555-0100.",
{ maskingType: "redact" },
);
console.log(result.outputs[0].text);

Options are identical to Transform. redact output is deterministic, so its single candidate is all you need.

Placeholder labels — coming soon​

Entity-label output ([PERSON], [PHONE_NUMBER], …) isn't available yet. Until it ships, use redact, or pin your own labels with a replacements map on deidentify_text.

See also​

Transform · Supported Entities