/** * ISL threat detection - pure, deterministic, single source of truth. * * Runs pattern-based detection on content and returns PiDetection[]. * No duplication: reuses Pattern, findAllMatches, createPiDetection. * Same input → same output; bounded by MAX_TOTAL_DETECTIONS and per-pattern cap. */ import type { Pattern } from '../value-objects/Pattern.js'; import type { PiDetection } from '../value-objects/PiDetection.js'; /** Threat pattern type identifiers (deterministic taxonomy) */ export declare const THREAT_TYPES: { readonly PROMPT_INJECTION: "prompt-injection"; readonly JAILBREAK: "jailbreak"; readonly ROLE_HIJACKING: "role_hijacking"; readonly SCRIPT_LIKE: "script_like"; readonly HIDDEN_TEXT: "hidden_text"; }; export type ThreatType = (typeof THREAT_TYPES)[keyof typeof THREAT_TYPES]; /** Returns default threat patterns (cached, frozen). */ export declare function getDefaultThreatPatterns(): readonly Pattern[]; export interface DetectThreatsOptions { /** Max total detections to return (default: MAX_TOTAL_DETECTIONS) */ maxTotal?: number; /** Max matches per pattern (default: MAX_PER_PATTERN) */ maxPerPattern?: number; /** Override patterns (default: getDefaultThreatPatterns()) */ patterns?: readonly Pattern[]; } /** * Detects threats in content using the configured patterns. * Pure, deterministic: same content → same PiDetection[] (order preserved by pattern order then by match position). * Bounded by maxTotal and maxPerPattern to avoid runaway. * * @param content - Segment or string to scan * @param options - Optional caps and pattern override * @returns Array of PiDetection (frozen); empty if none */ export declare function detectThreats(content: string, options?: DetectThreatsOptions): readonly PiDetection[]; //# sourceMappingURL=detect.d.ts.map