import { SyncGuardrailDetector } from "../contracts/guardrail.contract.mjs"; import { PiiDetectorOptions } from "../contracts/guard-options.type.mjs"; //#region ../ai/src/guard/detectors/pii.d.ts /** * Build the built-in **PII detector** (`ai.guardrail.pii`) — a zero-runtime- * dependency {@link GuardrailDetector} that scans text for personally * identifiable information via a curated set of linear regexes plus an * optional exact-string dictionary. * * Categories (`detect`, default: all): `ssn`, `email`, `phone`, * `credit-card`, `ipv4`. `dictionary` adds extra exact terms matched * case-insensitively as literal strings (regex metacharacters escaped). * * On a hit the verdict follows `onMatch` (default `"redact"`): * * - **`redact`** — every matched span is replaced by the `mask` template * (`{label}` → the matched category, default `"[REDACTED]"`) and the * rewritten text is returned for the factory to substitute. Output and * tool phases honour the rewrite; on the input phase the factory treats a * `redact` verdict as a `block` (the core `trip.before` hook can only * short-circuit, not rewrite-and-continue — see {@link PiiDetectorOptions}). * - **`block`** — a hard stop carrying the matches. * - **`flag`** — the content passes but the matches are recorded. * * Clean text returns `{ type: "allow" }`. * * @example * ai.guardrail({ output: [ai.guardrail.pii()] }); // redact, default mask * * @example * ai.guardrail.pii({ * detect: ["ssn", "credit-card"], * onMatch: "redact", * mask: "[PII:{label}]", * dictionary: ["Project Aurora"], * }); */ declare function pii(options?: PiiDetectorOptions): SyncGuardrailDetector; //#endregion export { pii }; //# sourceMappingURL=pii.d.mts.map