Hooks
All hooks throwHOOK_OUTSIDE_RENDER when called outside a render.
Per-render capability rebuild
Capabilities (tools, MCP servers, subagents) rebuild from empty on each render, so conditional hooks work naturally:Render guards
Render is strictly synchronous and free of I/O. During render:fetch,setTimeout,setInterval,queueMicrotask, andprocess.envreads throwAGENT_RENDER_IO.- Returning a thenable throws
AGENT_RENDER_ASYNC. - Non-string returns throw
AGENT_RENDER_TYPE; a render that selects no model throwsAGENT_NO_MODEL.
sandbox.exec in the VM.
Determinism
zap agent render --agent <id> --input "..." --json executes a render with no model call and no spend. Identical input produces identical bytes — the exact instructions, model id, tool list, and referenced secret names (never values). Use it in CI to snapshot agent behavior.