import { type Server } from "http"; import type { Finding } from "./scanner.js"; export type ProxyMode = "monitor" | "redact" | "block"; export interface ProxyOptions { port: number; /** Base URL of the real LLM API this proxy sits in front of, e.g. https://api.openai.com */ upstream: string; mode: ProxyMode; /** In "block" mode, the minimum severity that triggers a block (default: "high"). */ failOnSeverity?: Finding["severity"]; onAudit?: (event: AuditEvent) => void; } export interface AuditEvent { timestamp: string; method: string; path: string; mode: ProxyMode; blocked: boolean; findingCount: number; findingCodes: string[]; } /** * A reverse proxy that sits between your application and a real LLM API * (OpenAI/Anthropic-compatible). It buffers and inspects only the outbound * REQUEST body — message/system text fields — for leaked credentials and PII, * then streams the upstream response straight back unmodified (so SSE/streaming * completions pass through untouched; only the prompt going *out* is inspected). * * The audit trail never stores the actual matched text — only which pattern * fired and where — so the proxy's own logs can't become a second copy of the * leak it just caught. */ export declare function startProxy(options: ProxyOptions): Server; //# sourceMappingURL=proxy.d.ts.map