A grocery-shopping agent needs two tool classes: read-only search and a side-effecting checkout that moves money. Paybond's shopping preset registers both, caps checkout spend, and requires evidence after a successful order.
Multi-tool agents → middleware
Use paybond.instrument() when the agent exposes several tools. Auto-evidence on checkout is required middleware behavior — you should not hand-roll evidence submission per tool.
Try it
terminal
paybond login
paybond agent sandbox smoke \
--preset shopping \
--operation commerce.checkout \
--requested-spend-cents 2500 \
--evidence-preset cost_and_completion \
--result-body '{"status":"completed","cost_cents":2500,"order_id":"ord_smoke"}' \
--format tableScaffold
terminal
paybond init --solution shopping --max-spend-usd 100 --framework generic --non-interactive
paybond policy init --preset shopping --out paybond.policy.yaml
paybond policy presets show shoppingBundled defaults:
| Tool | Side effecting | Cap |
|---|---|---|
commerce.checkout | Yes | $100 per call / $100 intent budget |
search.products | No | — |
Multi-tool wiring
paybond-session.ts
import { Paybond } from "@paybond/kit";
const paybond = await Paybond.open({ apiKey: process.env.PAYBOND_API_KEY! });
const { tools } = await paybond.agent({
policy: "shopping",
tools: {
"commerce.checkout": checkout,
"search.products": searchProducts,
},
});
// Orchestrator loop:
// 1. Model calls search.products → executes without spend guard
// 2. Model calls commerce.checkout → Harbor verify → execute → auto-evidenceFramework-specific paths
| Stack | Guide |
|---|---|
| Vercel AI + Next.js | Next.js agent checkout |
| OpenAI Agents SDK | OpenAI Agents spend controls |
| LangGraph | LangGraph spend controls |
| MCP coding agent | MCP agent spend controls |
| Mastra | Mastra spend controls (adapter planned) |
| Cloudflare Agents | Cloudflare Agents spend controls (adapter planned) |
Customize the preset
Fork the scaffolded YAML — add delivery tips, loyalty lookups, or raise caps:
terminal
paybond policy init --preset shopping --max-spend 250 --out paybond.policy.yaml
paybond policy validate-tools --file paybond.policy.yaml --local-onlyVisual trace
After smoke, open the local trace dashboard (same project directory):
terminal
paybond dev traceThe UI renders a vertical timeline at http://127.0.0.1:9477 using events from .paybond/dev-trace.jsonl. Hosted replay: /demo/agent-trace.
Related guides
- Agent middleware — registry and bind patterns
- Agent policy-as-code — preset composition
- How agent settlement works — release and refund lifecycle
Developer reference: /docs/kit/agent-policy.