/** * Path A — input-side context redaction. * * Cross-session leaks happen because the LLM has the foreign * user's secret in its prompt context (history, system prompt, * MEMORY.md content, etc.). Output-side rewriting is * fundamentally leaky on Slack — ``chat.postMessage`` always * dispatches the original first and ``chat.update`` redacts a * second later, so notifications, lock-screens, and the first * ~500ms of the recipient's UI all show the secret. * * The architecturally correct fix: scrub every foreign-user * vault excerpt out of the prompt BEFORE it reaches the LLM. * The LLM physically cannot leak what isn't in its context. * * Hook used: ``before_prompt_build``. It IS async-aware AND * awaited by OpenClaw, and the event object exposes mutable * references to ``prompt``, ``systemPrompt``, and * ``messages[*]``. We mutate them in place — there's no * supported "return new prompt" shape, so in-place mutation is * how we actually affect the LLM's input. * * Performance: one HTTP GET per turn to fetch the foreign- * excerpts list (cached for ~5s). Replacement is a single * regex pass per text field. Net overhead < 50 ms on a warm * cache and < 200 ms on a cold one — well under the 15 s * before_prompt_build budget OpenClaw enforces. */ /** * Public entry point — call this from before_prompt_build with * the raw event object. Mutates ``event.prompt``, * ``event.systemPrompt``, and every message's content in * ``event.messages`` in place. Returns the count of fields * that actually changed (for logging only). * * The redaction strategy collects every text field the LLM is * about to see, sends them to the Lumin API in one batch, * receives back the redacted versions, and writes them back in * place. The server-side endpoint catches BOTH known foreign * vault entries AND structured-ID patterns that aren't in the * current user's own vault — the latter closes the gap where * a foreign secret was leaked before user_id propagation * started working, so it never landed in the vault but is * still in the LLM's conversation history. */ export declare function redactForeignUserSecrets(event: { prompt?: string; systemPrompt?: string; messages?: unknown[]; }, userId: string, host: string, project: string, log: { info?: (s: string) => void; warn?: (s: string) => void; } | undefined, detectors?: { vault_exact?: boolean; structural_pattern?: boolean; presidio?: boolean; }): Promise; export declare function __resetForeignExcerptsCacheForTest(): void; //# sourceMappingURL=input-redactor.d.ts.map