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.
Policy reference: /docs/kit/agent-policy.
shopping policy preset
search.products (read-only) plus capped commerce.checkout with required evidence.
spend verify before checkout
Side-effecting checkout authorizes operation and amount before money moves.
Auto-evidence
Middleware submits cost_and_completion digests after a successful order.
TypeScript and Python
Wire with generic instrument() in both Kit languages, or a framework adapter when available.
Why Paybond (not just merchant checkout)?
Merchant checkout APIs move money. They do not enforce a per-agent spend limit, a per-operation permission check (capability token), or a signed completion receipt tied to a spend agreement (intent).
Product search
- Checkout alone
- Yes — agent calls search freely
- With Paybond
- Yes — read-only search.products passes through
Checkout spend limits
- Checkout alone
- Merchant / card rules only
- With Paybond
- Per-call and intent budgets on commerce.checkout
Signed evidence
- Checkout alone
- Order logs / emails only
- With Paybond
- Signed cost_and_completion digests bound to the intent
Multi-tool middleware
- Checkout alone
- Hand-rolled evidence per tool
- With Paybond
- paybond.instrument() auto-evidence on checkout
Intent binding
- Checkout alone
- No Harbor intent or settlement receipt
- With Paybond
- Capability token + intentId from authenticated bind
| Capability | Checkout alone | With Paybond |
|---|---|---|
| Product search | Yes — agent calls search freely | Yes — read-only search.products passes through |
| Checkout spend limits | Merchant / card rules only | Per-call and intent budgets on commerce.checkout |
| Signed evidence | Order logs / emails only | Signed cost_and_completion digests bound to the intent |
| Multi-tool middleware | Hand-rolled evidence per tool | paybond.instrument() auto-evidence on checkout |
| Intent binding | No Harbor intent or settlement receipt | Capability token + intentId from authenticated bind |
How it works
Task flow
search.products
Read-only catalog lookup — no spend guard
commerce.checkout
Agent requests a paid order
Paybond guard
Harbor authorize against the shopping preset
- Verify spend and operation
- Deny or HITL hold
- Issue / check capability
Evidence
Auto-evidence with cost_and_completion
Shopping agents search freely, then Paybond guards checkout: Harbor authorize before spend, then auto-evidence after the order.
3-minute quickstart
Smoke the shopping preset sandbox contract — no merchant credentials required for this check:
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 tableWhen the smoke succeeds you should see:
- ✓ Spend approved
- ✓ Checkout completed
- ✓ Evidence verified (
cost_and_completion)
What success looks like
What success looks like
Authorized checkout · illustrative
- Operation
- commerce.checkout
- Status
- Approved
- Requested
- $25.00
- Evidence
- Verified
- Preset
- cost_and_completion
Scaffold
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 | — |
Wire middleware
Multi-tool wiring
Register search and checkout together so Harbor guards only the side-effecting path.
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 → spend verify → execute → auto-evidenceFramework-specific paths
| Stack | Guide |
|---|---|
| Vercel AI and 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 |
| Cloudflare Agents | Cloudflare Agents spend controls |
Customize the preset
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.
Production checklist
Production checklist
- Init the shopping policy preset and validate tools
- Wire multi-tool paybond.instrument() / paybond.agent()
- Bind intentId and capabilityToken per session in production
- Pick a framework path (Vercel AI, OpenAI Agents, LangGraph, …)
- Smoke with paybond agent sandbox smoke --preset shopping before ship
Works with
Works with
- Vercel
- OpenAI
- LangGraph
- MCP
Ready to test?
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.