import type { PluginState } from "./state.js"; /** * before_message_write: redact known secret values from agent messages * before they're written to the session log / persistence layer. * * Defence-in-depth: agents shouldn't echo secrets, but if a model regurgitates * a value it read via secr.materialize_env / secr.get_secret, we strip it * before the message is written down. Cannot prevent transmission (the model * has already produced the text), but prevents persistence and downstream * logging. * * Trade-offs: * - Only redacts values >= 8 chars (PluginState.MIN_REDACT_VALUE_LEN) to * avoid false positives on short values that'd corrupt unrelated text. * - Cache TTL is 5min; new secrets aren't redacted until refresh. * - Walks the message recursively; only string leaves are inspected. */ export declare function buildBeforeMessageWriteHook(state: PluginState): (event: { message: any; sessionKey?: string; agentId?: string; }, ctx: { agentId?: string; sessionKey?: string; pluginConfig?: { enforceGateway?: boolean; }; }) => Promise<{ block?: boolean; message?: any; } | void>; //# sourceMappingURL=message-write-hook.d.ts.map