x402 examples
Spending limits for AI agents, approved from your phone
Give your agents a wallet without giving them a blank cheque:
- presign-guard-wallet (npm): a viem wallet that checks every signature with presign-guard first (drainers, sanctions, unlimited approvals), keeps to your price per purchase and daily budget, and asks you on Telegram for anything above them.
npm i presign-guard-wallet - fizzl (PyPI): the same checks for Python agents, with ready-made LangChain tools.
pip install fizzl - fizzl-langchain (npm): the same checks as LangChain.js / LangGraph.js tools, with a free quick check to try them without a wallet.
npm i fizzl-langchain - presign-guard-ai-sdk (npm): safety checks as Vercel AI SDK tools. Before signing, before buying a token and before paying an x402 endpoint, the agent checks first.
npm i presign-guard-ai-sdk - presign-guard-agentkit (npm): the same for Coinbase AgentKit agents. Wrap the wallet provider in one line, and every transfer, swap, approval, permit and x402 payment is checked and kept to your limits.
npm i presign-guard-agentkit - presign-guard-solana-agent-kit (npm): the same for Solana Agent Kit agents (SendAI). Wrap the wallet in one line, and every transfer, swap and token action from every plugin is checked (instructions decoded and simulated) and kept to your SOL and USDC limits.
npm i presign-guard-solana-agent-kit - presign-guard-wallet-mcp (npm, MCP server): a wallet with spending limits for Claude, Cursor and any MCP client. The agent can pay x402 APIs and send USDC within your budget, and asks you on Telegram above it.
npx -y [email protected] - presign-guard-payer-screen (npm): for sellers. Screens who pays your x402 API against the OFAC SDN sanctions list before the payment settles; a listed payer gets 451 and is never charged. EVM, Solana, Algorand, XRP Ledger, no dependencies.
npm i presign-guard-payer-screen - privy-sanctions-sync: for Privy agent wallets. Keeps the condition sets behind Privy's x402 sanctions-screening policy in step with the OFAC SDN list: EVM addresses in both casings, Solana addresses plus their USDC and USDT token accounts, and XRP Ledger addresses, with a ready Privy XRPL policy for x402 payments in RLUSD. It adds before it removes and leaves a set alone when the list is stale.
- fizzl-paypal-guard (npm): for PayPal's Agent Toolkit. Refunds only for the customer in the conversation, never more than was paid, and never on a payment the customer's bank already charged back (PayPal itself lets that refund through). Daily limits on refunds, cancellations and invoices; the owner decides on refunds after the return period and on a customer who keeps asking; an AI check that the action fits what the customer asked; and Approve/Deny on Telegram above the limits.
npm i fizzl-paypal-guard· live demo · video - fizzl-paypal-guard-mcp (npm, MCP server): PayPal for Claude, Cursor and any MCP client, guarded. The same 47 tools as PayPal's own MCP server, but never more than is left of a payment, no refund while a chargeback is open, your limits on refunds, cancellations and invoices, and Approve/Deny on your phone or in the chat app above them.
npx -y fizzl-paypal-guard-mcp - wallet-server: one budget and one set of rules for all your agents, a live dashboard, approvals on the dashboard, on your phone (installable app) or Telegram, pause one agent or all, an activity log. It never holds keys or funds: agents still sign and pay themselves.
- paybox-plugin: Fizzl for MoonPay's PayBox. A plugin with the checks (transaction, Solana transaction, token, sanctions, x402 endpoint) and Fizzl Buy, paid per call through PayBox's own x402 approval; two tools are free.
- agent-allowance: spending limits kept by the chain. A small contract on Base, no admin: the owner's USDC stays in their own wallet and each agent's wallet is topped up to a small float within a limit a day, so a leaked agent key can take at most that.
See the dashboard live (demo, example data) →
Agent skills that teach Claude Code, Codex, Cursor and other agents to use the wallet and the Fizzl checks: Fizzl13/fizzl-skills.
import { guardWallet } from "presign-guard-wallet";
const wallet = guardWallet(walletClient, {
pay, // a fetch that pays x402, or creditKey for prepaid presign-guard checks
server: { url: process.env.WALLET_SERVER_URL, key: process.env.WALLET_SERVER_KEY },
});
// Under your price: signs. Above it: you get a request on the dashboard and on Telegram.
// Red verdict: never signed. Server unreachable: stops instead of signing.
Try it from your phone: Actions → telegram-demo → Run workflow (a pretend agent, a stub wallet, no money moves).
Research: do AI agents pay safely?
- agent-safety-bench: an open benchmark of how an AI agent with a wallet handles x402 payments. It checks whether the agent pays honest sellers and refuses the traps: an overcharge, a sanctioned payee, a price over budget, the expensive one of two options, an instruction injected into an API's answer, and a seller that takes the money and asks again. Everything runs offline against simulated sellers with the official x402 client, and nothing is ever paid. It compares agents with and without x402 Doctor's preflight skill.
Paid-API examples
Small, open examples of AI agents combining paid APIs with x402: each call is paid per request in USDC, with no accounts or API keys.
Each example has a --dry-run that shows the prices without paying. Use a dedicated wallet with a little USDC, keep its key in your environment, and never commit it.
Check your own x402 endpoint for free with x402 Doctor.
These are examples of combining services, not trade advice.
License
MIT (see LICENSE), except wallet-server/, which is AGPL-3.0-only (see wallet-server/LICENSE). The packages you install in your own agent (guard-wallet, wallet-mcp, safe-fetch, the framework guards and the rest) are MIT.