Inspiration
AI agents are starting to act on their own: calling APIs, buying data, paying for compute. But an agent with a wallet and no limits is a liability — one bad loop, one prompt injection, and it drains the treasury. Existing agent wallets give the agent the keys and hope for the best. We wanted an agent wallet that cannot be drained, even if the agent itself goes rogue.
What it does
AgentPay gives the agent a wallet it cannot drain. The agent never holds the funds; USDC sits in an on-chain BudgetVault. Every payment is checked on-chain against four guardrails: a daily cap (10 USDC), a per-call maximum (1 USDC), a payee allowlist, and a human-approval threshold (0.5 USDC) for large payments. Payments above the threshold go through a request → approve → execute flow; the owner approves from the dashboard, and the daily cap is re-checked at execution time. The agent plans the cheapest set of paid API calls for a question, pays per call via x402 (HTTP 402), and answers with the data plus a receipt (tx hash, amount, remaining budget) for every payment.
How we built it
Solidity + Foundry: BudgetVault.sol (11/11 tests pass), deployed to Base Sepolia at 0xa5e13d27039a695b54d692e6d990b62cadfb11b4. Testnet USDC: Circle 0x036CbD53842c5426634e7929541eC2318f3dCF7e. Node + ethers v6: paid x402 API server (price, weather, news — mock data, deterministic, no external keys) and the agent (planner + x402 payer + on-chain budget checks). Static dashboard: chat, live on-chain budget, approval queue, tx history with Basescan links. Full loop verified twice: locally on Anvil and live on Base Sepolia against the deployed vault.
Challenges
The deployer wallet had 0 testnet ETH and every Base Sepolia faucet failed (Alchemy CAPTCHA, faucet.base.org DNS dead, QuickNode mainnet-balance gate). We funded the deployer from our own testnet balance instead — 0.01 ETH was enough; the deploy cost ~0.00003 ETH. x402 verification must be exact: the server verifies the USDC Transfer on-chain for every payment and rejects reused tx hashes, so a payment receipt can never be replayed for free data. Keeping the agent honest: the vault enforces every limit on-chain, so even a compromised agent key cannot overspend.
Accomplishments
A real, deployed guardrailed agent wallet — not a slide deck. The vault is live on Base Sepolia and the whole pay-per-call loop runs against it. The approval flow with a daily-cap re-check at execution time — the subtle case most budget designs miss. 11/11 contract tests, including the daily-cap reset and the approval-flow re-check.
What we learned
Guardrails belong on-chain, not in the agent's prompt: any limit the agent enforces itself disappears the moment the agent is compromised. Testnet faucets are the least reliable part of any hackathon build — budget a fallback funding path from the start. x402's 402-then-pay-then-verify loop is simple to implement and composes well with an on-chain budget check in front of it.
What's next
Per-service monthly budgets and a spend forecast. CCTP so the same vault can pay on any chain. A signed-policy mode: the owner pre-signs a policy (caps + allowlist) and the agent enforces it off-chain too.