/** * The runtime hook handler: Claude Code pipes a PostToolUse event JSON to this on * stdin; we inspect the untrusted tool result and, when it carries a prompt * injection, REWRITE the result Claude is about to read (the documented * `updatedToolOutput` mechanism) so the agent never acts on the poisoned content. * * It fails OPEN: any parse/inspect error → pass through silently. A guard that * bricks the agent on its own bug is worse than one that occasionally misses. */ import type { GuardResult } from "./types.js"; export declare function buildResponse(content: string): { output: unknown | null; result: GuardResult; }; /** PreToolUse: screen a command the agent is about to run. */ export declare function buildCommandResponse(command: string): unknown | null; /** PreToolUse: screen a file write (path + content) the agent is about to make. */ export declare function buildFileWriteResponse(path: string, content: string): unknown | null; /** CLI entry for `nexus guard check`. Routes by hook event: * PreToolUse → command screening (can block); PostToolUse → content redaction. */ export declare function runHandler(): Promise;