import type { InputProcessor, OutputProcessor } from '../../types/processors.js'; /** * Deterministic PII detection + redaction over message text. * * Detectors are conservative by default: `credit-card` (separator-tolerant, * Luhn-validated so order/tracking numbers don't false-positive) and `email`. * `phone` and `iban` are opt-in because their shapes collide with order ids, * reference codes, and similar commerce artifacts. */ export type PiiDetector = 'credit-card' | 'email' | 'phone' | 'iban'; export interface PiiGuardOptions { /** Which detectors to run. Default: `['credit-card', 'email']`. */ detect?: PiiDetector[]; /** `redact` replaces matches in place; `block` refuses the message. Default: `redact`. */ mode?: 'redact' | 'block'; /** User-facing message when `mode: 'block'` trips. */ message?: string; id?: string; } export interface PiiMatch { detector: PiiDetector; matchedText: string; } export interface PiiScanResult { text: string; matches: PiiMatch[]; } /** * Scan and redact PII in `text`. Returns the redacted text plus the list of * matches (detector + original matched text) so callers can audit what was * found without re-detecting. */ export declare function redactPii(text: string, detect?: PiiDetector[]): PiiScanResult; /** * PII guard over inbound user text. `redact` mode rewrites the message before * the model (and persisted history) sees the raw value — credit-card redaction * inbound is the PCI-relevant default for commerce agents. */ export declare function createPiiInputGuard(options?: PiiGuardOptions): InputProcessor; /** PII guard over assistant output — stops the model echoing sensitive values back. */ export declare function createPiiOutputGuard(options?: PiiGuardOptions): OutputProcessor;