export type TrustLevel = 'system' | 'operator' | 'user' | 'document' | 'generated'; export type BoundaryMetadata = { source: string; trust: TrustLevel; id?: string; }; export type InjectionDetection = { detected: boolean; patterns: string[]; severity: 'low' | 'medium' | 'high'; }; export type SanitizedContent = { content: string; wrapped: string; injection: InjectionDetection; }; type InjectionPattern = { regex: RegExp; name: string; severity: 'low' | 'medium' | 'high'; }; export declare const INJECTION_PATTERNS: InjectionPattern[]; /** * Detects prompt injection patterns in content. * Returns which patterns matched and the highest severity found. */ export declare function detectInjection(content: string): InjectionDetection; /** * Wraps content in trust boundary markers. */ export declare function wrapWithBoundary(content: string, metadata: BoundaryMetadata): string; /** * Sanitizes content by detecting injection patterns and wrapping with trust boundaries. * The content field strips boundary-escape sequences; the wrapped field adds boundary markers. */ export declare function sanitize(content: string, source: BoundaryMetadata): SanitizedContent; /** * Generates a cryptographically random canary token. * If the canary appears in output, it indicates content leakage. */ export declare function generateCanary(): string; /** * Checks if a canary token leaked into the output. */ export declare function checkCanaryLeak(output: string, canary: string): boolean; export {};