x402 — Let Your Agent Buy Things
Verglas vaults pay known recipients on a whitelist. x402 answers the other question: what can the agent actually buy? Any API that speaks x402 — the HTTP 402 payment standard now governed by the Linux Foundation — can sell to your agent, and the vault still holds the leash.
How the leash works
USDC on Avalanche cannot be pulled from a contract by an x402 settlement (the deployed token predates EIP-1271 support), so the vault cannot be the payer directly. Instead the agent's own wallet carries a float — pocket money — and the float is refilled exclusively through the vault:
seller returns 402 ── pay_x402 checks the float
│ float short?
▼
vault.spend(agentWallet, missing) ← the rules live here:
│ budget, per-payment limit,
▼ freeze — refusal by name
agent signs EIP-3009, seller settles on-chainThe float never needs to hold more than the payment at hand, so the blast radius of a leaked agent key is the float, not the treasury. Freeze the vault and the next x402 payment dies at the refill step:
x402 payment stopped at the vault refill step.
REFUSED by the vault: AccountFrozen() — the payment never left.Try it
The MCP server ships a verglas_pay_x402 tool. Install it straight from npm (claude mcp add verglas --env PRIVATE_KEY=0x… -- npx verglas-mcp) or from the repo (quickstart), then ask your agent to fetch:
https://verglas-x402-demo.l3ekirerdem.workers.dev/frost-reportThat endpoint sells a small JSON report for 0.01 USDC on Fuji. The tool probes the URL, tops up the float through the vault if needed, signs the EIP-3009 authorization, and returns the content plus both transaction links — the vault refill and the x402 settlement.
The demo float vault is agent #223 (public record): whitelist = the agent's own wallet and nothing else, per-refill limit 0.5 USDC, lifetime budget 2 USDC. Its whole job is to be the only door between the treasury and the float — and it sits inside the same proof machinery as every other vault: the refills fold into its Poseidon chain, its validation window is open, and the scheduled keeper proves and stamps it like the rest. x402 buying doesn't step outside the receipt line.
Settlement plumbing
- Buyer side is standard x402 v1 (
exactscheme,avalanche-fuji), built on the officialx402-fetchpackage — any conformant seller works. - The demo seller verifies signatures through the community Ultravioleta facilitator and submits settlement itself with pinned fees (Fuji fee estimation is flaky; the facilitator's own settle endpoint currently rejects these transactions — reproduced 2026-08-13 as
contract_call_failedand reported upstream). - Environment knobs:
VERGLAS_X402_AGENT_IDpicks the float vault (default223); each call takes an optionalmaxUsdcprice cap (default0.10).
