import type { GuardAction, Logger } from './contracts.js'; export interface AuditOptions { enabled: boolean; path: string; rotateBytes: number; logger: Logger; cwd?: string; home?: string; } export interface DecisionRecord { session?: string; tool: string; decision: GuardAction; rule?: string; mode: 'monitor' | 'enforce'; action: 'allowed' | 'blocked' | 'asked' | 'monitored'; argsHash?: string; pathHash?: string; ruleCount?: number; } export interface RedactRecord { session?: string; tool?: string; category: string; count: number; placeholderIds?: string[]; truncated?: boolean; spillBypassed?: boolean; /** Hook arm that produced the redaction (distinct from the log phase). */ hook: 'pre-step' | 'post-execute' | 'ptc-log' | 'system-prompt'; } export interface ErrorRecord { session?: string; tool?: string; message: string; } /** One egress-guard observation. Host and port only: never a path or body. */ export interface EgressRecord { event: 'mount' | 'connect' | 'close' | 'deny' | 'canary' | 'error'; host?: string; port?: number; /** Policy decision for this destination. */ decision?: 'allow' | 'deny'; /** True only when the tunnel was actually refused. */ enforced?: boolean; mode?: 'monitor' | 'enforce'; reason?: string; rule?: string; scheme?: 'http' | 'https'; bytesIn?: number; bytesOut?: number; durationMs?: number; outcome?: 'ok' | 'error' | 'denied' | 'timeout'; /** Canary-specific status code (CONNECT reply), never a body. */ status?: number; } /** * Serialized writer with size-based rotation. All failures are contained: the * guard must never break a tool call because the audit sink is unavailable. */ export declare class AuditLog { private readonly file; private readonly options; private pending; private disabled; private warned; constructor(options: AuditOptions); /** Resolved log path; exposed for tests and diagnostics (not model-facing). */ get path(): string; decision(record: DecisionRecord): void; redact(record: RedactRecord): void; error(record: ErrorRecord): void; egress(record: EgressRecord): void; /** Wait until every queued record has settled; safe to call from tests. */ flush(): Promise; private enqueue; private append; private rotateIfNeeded; } //# sourceMappingURL=audit.d.ts.map