--live with a payer configured.
The programming model
- Agent functions are reactive renders. They return instructions (a string) for the next model step. They do not call models or tools.
useModelselects a model; it never calls one.useTooldeclares a tool; it never runs one. - Hooks may be conditional and must be synchronous. Side effects belong in tools. Tools that do CPU work go through
sandbox.exec. - Capabilities rebuild from empty on every render. A tool declared inside an
ifexists only when the condition holds.
fetch, timers, process.env reads, and async render functions throw guard errors (AGENT_RENDER_IO, AGENT_RENDER_ASYNC).
Project layout
zap deploy bundles the project with esbuild into an immutable, sha-addressed deployment with a value-free manifest. Build lint catches ZAP_BUILD_SECRET_LITERAL, ZAP_BUILD_ORIGIN_NOT_HTTPS, ZAP_BUILD_PROCESS_ENV, ZAP_BUILD_ASYNC_AGENT, ZAP_BUILD_UNDECLARED_SUBAGENT, and ZAP_BUILD_UNDECLARED_MCP.
Where things run
The render executes on the Zap kernel; every tool that does CPU work runs on the sandbox throughsandbox.exec. No model loop runs outside the tenant VM. Outbound HTTP goes through declared connections; secrets are write-only.
Quickstart
Your first agent in five minutes.
Render model
Hooks, guards, and per-render capability rebuild.
Transcode example
A complete agent with a sandboxed ffmpeg tool.
API reference
Every export of @wzrdtech/zap-agent.
