/** * Redaction of high-confidence secrets in stored tool output. * * Transcripts capture whatever a command printed, which regularly includes the * contents of a .env, an exported token, or a connection string. The store is a * second copy of that data with a longer lifetime than the 30-day transcript, so * it gets scrubbed on the way in. * * Deliberately conservative: only patterns that are almost certainly credentials. * Over-redaction destroys the evidence value of the record. */ export declare const MASK = "[redacted]"; export declare function redact(text: string | null | undefined): string; export declare function containsSecret(text: string | null | undefined): boolean; /** * Redact every string inside an arbitrary JSON-ish value, preserving shape. * * Needed for tool *input*, not just tool output. When an agent writes a * credential into a file, the credential is in the Edit call's `new_string` or * the Write call's `content` — so scrubbing only the result text stores the * secret verbatim in the field that matters most. That is the exact case * `risk.secret_file_write` exists to flag, which made it the worst possible * place to leave a gap. * * Structure is preserved because the dashboard and the analyzers read known * keys (`file_path`, `command`) out of this object. */ export declare function redactDeep(value: T): T; /** * Which credential shapes are *still present* in already-stored text. * * Everything here should have been masked on the way in, so a non-empty result * means redaction was bypassed and is worth investigating. Returns pattern * labels only, never the matched value — an audit that prints the secret it * found has defeated its own purpose. * * Pass individual string fields, not a serialised document: in JSON, `\n` and * `\"` become literal characters that satisfy the value pattern, and scanning a * whole `JSON.stringify` output reports those escapes as credentials. */ export declare function survivingSecretKinds(text: string | null | undefined): string[];