Options
Phone Regions
Detection is multilingual and language-agnostic. Names and places use one model. Structured identifiers use format or checksum checks. Phone numbers are+ international-only by default. Add phone_regions only when you need local formats.
Entities
Names and locations are multilingual. IBAN, credit card, email, IP, and
+ phone numbers work internationally. VAT_CODE requires a country prefix and is validated with python-stdnum.
Score Threshold
score_threshold raises the confidence floor for the tunable neural labels
PERSON and LOCATION only. Higher = fewer false positives, might miss
some PII; lower = catches more, more false positives.
1.0) and are never
dropped by the threshold. Tune the neural labels per deployment via the
DETECTOR_FLOOR_PERSON, DETECTOR_FLOOR_LOCATION, and DETECTOR_FLOOR_ADDRESS
environment variables on the detector service — e.g. DETECTOR_FLOOR_PERSON=0.9
(fewer person false positives) or DETECTOR_FLOOR_LOCATION=0.4 (more location
recall). Street addresses are detected by the model and reported as LOCATION.
Allowlist
Exclude specific text patterns from PII masking. Useful for preventing false positives on company names or product identifiers.regex: true for JavaScript regex syntax — a regex entry must match the entire detected value, so \d{4} won’t unmask a longer number that merely contains four digits.
Denylist
Force specific text or regex patterns to be masked, even when the detector does not report them or PII detection is disabled. Each entry needs atype, which is used for the placeholder name.
regex: true for JavaScript regex syntax — use single quotes in YAML when the pattern contains backslashes. A regex pattern must not match the empty string (use \d+, not \d*); empty-matching patterns are rejected at startup because they would mask nothing.
Scan Roles
By default, PasteGuard scans user messages and tool results. It skips system, developer, and assistant text. Setscan_roles to replace that default:
If
scan_roles is set, PasteGuard scans exactly those roles.