Developers · Examples
Examples
Ready-to-run patterns that show exactly how governance behaves — copy them straight into your agent.
02
Starter
- Gate a tool call (allow / observe / block / escalate)
- Block over a per-transaction spend cap
- Escalate a high-risk action, then approve it
- Restrict to an allow-list of merchants
- Evaluate a policy bundle locally (no round-trip)
03
End-to-end
- Bring-your-own-key: prove control, then transact
- Delegated issuance: a dev requests, an owner approves
- Trustless MCP service re-check
- x402 payment bound to an authorization
- Two-phase capture with settlement evidence
Example
See it in code
gate-a-tool-call.ts
const decision = await guard.authorize({
action: "flight-purchase",
amount: 600, currency: "USD", merchant: "skyward-air",
context: { riskLevel: "high" },
});
decision.decision; // "block"
decision.reasonCode; // "SOP_SPEND_CAP"
// Change the cap in the dashboard and re-run — the verdict changes live.