import type { PiiMatch } from "./types.js"; /** * Defense-in-depth against pathological inputs: cap the length we scan. * Even with bounded patterns, running every pattern over an unbounded body * is a DoS lever (this is an agent/LLM gateway — large tool-call payloads * are normal). PII beyond this cap is not scanned; callers handling very * large bodies should chunk. 512 KB comfortably covers real tool I/O. */ export declare const MAX_PII_SCAN_LENGTH: number; /** Result of a PII scan, including whether the scan cap truncated the input. */ export interface DetectionResult { /** All matches found, in original-text coordinates, sorted by start. */ matches: PiiMatch[]; /** * True when the (invisible-stripped) input was longer than * {@link MAX_PII_SCAN_LENGTH} and PII past the cap was NOT scanned. When * true, absence of matches beyond the cap is not evidence of absence — the * caller must treat this as a loud fail-open signal, not silently pass the * unscanned tail through as clean. */ scanTruncated: boolean; /** Number of characters actually scanned. */ scannedLength: number; /** Full length of the invisible-stripped input. */ totalLength: number; } /** * Detect PII in text content. * Returns all matches with their positions. * * Back-compatible thin wrapper over {@link detectPiiDetailed}. Callers that * need to know whether the scan cap truncated the input (M2 / #40) should use * {@link detectPiiDetailed} and inspect `scanTruncated`. */ export declare function detectPii(text: string, customPatterns?: Array<{ type: string; pattern: RegExp; }>): PiiMatch[]; /** * Detect PII and report scan-cap truncation. * Returns matches plus a `scanTruncated` flag so a truncated scan is never a * silent fail-open. */ export declare function detectPiiDetailed(text: string, customPatterns?: Array<{ type: string; pattern: RegExp; }>): DetectionResult; //# sourceMappingURL=detect.d.ts.map