PIIDetectionGuardrail

Guardrail that detects and optionally masks PII such as SSNs, credit cards, emails, and phone numbers.

Parameters

ParameterTypeDefaultDescription
mask_piiboolFalseWhether to mask the PII in the input, rather than raising an error.
enable_ssn_checkboolTrueWhether to check for Social Security Numbers.
enable_credit_card_checkboolTrueWhether to check for credit cards.
enable_email_checkboolTrueWhether to check for emails.
enable_phone_checkboolTrueWhether to check for phone numbers.
custom_patternsOptional[Dict[str, Union[str, re.Pattern]]]NoneCustom PII patterns to detect, mapping a name to a regex string or compiled pattern. Added to the default patterns.