/** * Marker substituted when the redactor itself fails on a value. Logging must * never break the runtime, but it must fail CLOSED — never emit the original * unredacted payload (W5-028). */ export declare const REDACTION_FAILED_VALUE = "[REDACTED: redaction failed]"; /** * Whether an object key names a credential whose value must be masked. * Case-insensitive and depth-independent — the walker applies it to every key * at every level, so top-level and deeply nested secrets are treated alike. */ export declare function isSensitiveLogKey(key: string): boolean; /** * Credential-shaped value patterns, shared by model-output and log redaction. Applied to every * string that reaches the log sinks (object values, trailing args, headline * messages, Error message/stack). The shapes require an assignment context or * a known token prefix — no entropy heuristics — so ordinary prose does not * false-positive, while credentials interpolated into free text are caught. */ /** Broad assignment detection for runtime logs; source reviewers classify literals separately. */ export declare const SENSITIVE_ASSIGNMENT_PATTERNS: readonly string[]; export declare const SENSITIVE_TEXT_PATTERNS: readonly string[]; /** * Compile one redaction pattern string: `/source/flags` keeps its flags (plus * `g`), a bare source becomes `gi`. Blank or invalid patterns compile to null. * The single parser for log, model-output, and secret-swap pattern sets. */ export declare function compileSensitiveTextPattern(raw: string): RegExp | null; /** * {@link SENSITIVE_TEXT_PATTERNS} compiled once at module load and shared by * every redactor. `replace` and `matchAll` never carry a global regex's * `lastIndex` across calls, so the shared objects are safe to reuse. */ export declare const SENSITIVE_TEXT_REGEXPS: readonly RegExp[]; /** * Scrub credential-shaped values from free text reaching the log sinks. * Pattern sweep only — secrets-map literal redaction stays in core, which owns * the character configuration. */ export declare function redactSensitiveLogText(text: string): string; export declare function redactLogValue(value: unknown, seen: WeakSet, depth: number): unknown; /** * Redact every argument in a trailing-args list: strings are pattern-scrubbed, * objects deep-walked. A walk failure on any argument fails closed to the * redaction-failed marker rather than propagating (or leaking) the raw value. */ export declare function redactTrailingArgs(args: readonly unknown[]): unknown[];