Allowance: an AI agent with an on-chain spending limit
AI agents are starting to pay for things. But give an agent a wallet today and it can spend everything in it. A budget written into its prompt is a suggestion, not a limit. Allowance gives an agent real spending power with limits it cannot break.
The agent buys live data (crypto prices from CoinGecko, stock quotes from Finnhub, city weather from Open-Meteo) and pays for every API call itself over x402, the HTTP 402 payment protocol. The server answers "402 Payment Required", the agent signs a tUSDC transfer from a Stellar smart wallet, and the data comes back with the settlement transaction attached. Every paid call is a real testnet transaction you can open in the explorer. The merchant settles only once the data exists, so an unknown ticker or a failing upstream never charges the agent.
The wallet is an OpenZeppelin smart account. The owner's passkey is the admin. The agent holds a separate session key, scoped to a single rule: it can transfer one token, and every transfer passes through a spending-limit policy contract. The owner picks the amount and the window (per hour, day or week) at setup and can change it at any time. When the agent tries to spend past the limit, the chain refuses the signature and nothing is charged. No server check is involved, and no prompt can get around it.
When the chain says no, the agent does the only thing it can: it asks. The owner's phone buzzes with the amount and a one-line reason. The owner can grant what was asked, more, or less, or decline, and approves with a passkey. That raises the limit on chain, and the agent picks up where it left off. The owner can also pause the agent at any moment by setting the limit to zero.
The result is agents that pay their own way, per request, with a budget the chain enforces and a human who signs off on every increase.
Built with Stellar testnet, x402, OpenZeppelin smart accounts, passkeys, Next.js and the OpenAI API.