The PII gate walks every string value inDocumentation Index
Fetch the complete documentation index at: https://docs.pecta.ai/llms.txt
Use this file to discover all available pages before exploring further.
ctx.output — recursively through nested objects and arrays — and fails the evaluation the moment it finds a pattern that looks like personal identifying information. It is intended as a last-resort guardrail: a lightweight regex-based check that catches accidental data leakage before an agent’s response reaches end users or gets logged.
All three checks run by default. You can disable any of them individually when your domain requires it — for example, a healthcare support bot where phone numbers are expected in output.
Usage
What it detects
Email addresses
Matches standard email formats using the pattern:user@example.com, first.last+tag@company.co.uk
Social Security Numbers
Matches theNNN-NN-NNNN format while excluding known invalid ranges (group 000, 666, any 900–999 area number, group 00, serial 0000):
123-45-6789Not flagged:
000-12-3456, 666-00-1234 (structurally invalid SSNs)
US phone numbers
Matches common North American phone number formats with optional country code, parentheses, and a variety of separators:(555) 867-5309, +1-800-555-0100, 555.867.5309
What a failure looks like
Configuration
Enable email address detection. Defaults to
true.Enable Social Security Number detection. Defaults to
true.Enable US phone number detection. Defaults to
true.Override the gate name recorded in results. Defaults to
"pii".Disabling individual checks
The PII gate uses regex patterns and will produce both false positives and false negatives. It is a best-effort guardrail, not a comprehensive PII scanner. Strings that look like SSNs or phone numbers but are not real personal data will still fail the gate.