/** * Sanitizer Orchestrator * * Main entry point for content sanitization. Coordinates injection detection * and PII redaction pipelines. * * CRITICAL: This is the core security mechanism. Every web page MUST pass * through this sanitizer before reaching the LLM. This cannot be bypassed. */ import { type ThreatReport } from './threat-reporter.js'; import type { SanitizationProofRecord } from '../crypto/primitives.js'; export interface SanitizationResult { content: string; sanitization: { patterns_detected: string[]; pii_types_redacted: string[]; pii_allowlisted: Array<{ type: string; value: string; reason: string; }>; content_modified: boolean; }; metadata: { original_length: number; sanitized_length: number; severity_score: number; has_critical_threats: boolean; detections_by_severity: { critical: number; high: number; medium: number; low: number; }; }; threat_report?: ThreatReport; } /** * Extended result with cryptographic proof */ export interface SanitizationResultWithProof extends SanitizationResult { proof: SanitizationProofRecord; proofHeader: Record; } /** * Sanitize content through the full pipeline * * Pipeline: * 1. Injection detection and neutralization (43 patterns) * 2. PII redaction (email, phone, SSN, CC, IP) with allowlisting * 3. Metadata collection and logging * * @param content Raw content from web page * @param sourceUrl Optional source URL for domain-scoped PII allowlisting * @returns Sanitized content with detection metadata */ export declare function sanitize(content: string, sourceUrl?: string): SanitizationResult; /** * Quick check: does content need sanitization? * (Used for optimization - skip pipeline if content is clean) * * Note: Still run full pipeline for safety, but this can be used for metrics */ export declare function needsSanitization(_content: string): boolean; /** * Sanitize content with cryptographic proof generation * * This is the primary entry point for MCP tools. It wraps the standard * sanitize() function and generates a tamper-evident cryptographic proof * that the sanitization pipeline executed before content was forwarded. * * EU AI Act Art. 9 (Risk Management) + Art. 13 (Transparency) compliance. * * @param rawContent Raw content from web page * @param sourceUrl Optional source URL for domain-scoped PII allowlisting * @param toolName Name of the calling MCP tool (for audit trail) * @param pipelineVersion Sanitization library version * @returns Sanitized content with cryptographic proof */ export declare function sanitizeWithProof(rawContent: string, sourceUrl?: string, _toolName?: string, pipelineVersion?: string): Promise; /** * Export sub-components for testing */ export { detectAndNeutralize } from './injection-detector.js'; export { redactPII, containsPII, detectPIITypes } from './pii-redactor.js'; export { INJECTION_PATTERNS, getAllPatternNames } from './patterns.js'; //# sourceMappingURL=index.d.ts.map