Inspiration
AI agents can now pay for things on their own, for APIs, data, invoices. The standard safety tool is a spending limit. But a limit only answers how much. It doesn't answer who told the agent to pay.
That gap in this case is prompt injection with a wallet attached. If an agent reads a vendor page that says "our payment address has changed" or "the minimum order is 3 units", it can make a payment that is perfectly within budget and completely wrong. We wanted an agent you could hand a wallet to without trusting everything it reads.
What it does
Provn is a security gateway between an AI agent and its money. For every payment, it traces each field (recipient, amount, quantity) back to where it came from:
- Trusted: typed by the user in the dashboard (the request, budget, allowed vendors)
- Bound: the payee and price from the vendor's own x402
402 Payment Requiredresponse, on the host the agent actually asked for - Untrusted: anything the agent read (web pages, API responses)
Then a policy decides. A recipient or quantity that came from page text is denied. A first payment to a new vendor waits for the user's approval on the dashboard. Everything else goes through.
Underneath is a second layer the gateway can't override: ProvnVault, a contract on Arc that only pays allowlisted addresses within per-payment and daily limits. And QuickNode Streams watches every USDC transfer out of the vault: if one doesn't match a payment Provn made — say someone stole the gateway's credentials and called the vault directly — Provn pauses the vault.
Spending limits check how much an agent pays. Provn checks who told it to pay.
How we built it
- Gateway (TypeScript, Hono, SQLite): the only component with wallet credentials. It serves the agent its tools over MCP (
fetch_paid_data,pay,get_task), fetches every page itself, and records everything in an append-only provenance ledger. - Trace + policy: each payment field is matched back to ledger entries and labeled; rules in
policy.yamldecide allow / approve / deny, then the vault limits can only tighten the result. The agent only ever hears "Payment denied." — the detailed reason goes to the user and an append-only audit log, written before any money moves. - x402: when a URL answers 402, the gateway — not the agent — evaluates and pays, then refetches with the transaction hash. Approved payments are reused exactly once, so the agent can't double-pay.
- Circle: payments go through a Circle developer-controlled wallet on Arc testnet that calls
ProvnVault.spendvia Circle's contract-execution API. - Arc:
ProvnVault(Solidity, Foundry, 26 tests) holds the USDC: allowlist, limits, and a pause that Provn can trigger but only the owner can lift. - QuickNode: a Stream on Arc testnet sends signed vault-transfer events to the gateway, which checks the HMAC, matches each transfer against the payments it sent, and pauses the vault on a mismatch.
- Agent: Grok (via xAI's OpenAI-compatible API), plus a scripted agent for repeatable runs.
- Dashboard (React + Vite): create tasks, watch the ledger fill in with trust badges, approve or reject payments, see the vault's budget and reconciliation status.
Challenges we ran into
- Agents are unpredictable. In one evening of testing, Grok asked for confirmation instead of buying, followed a vendor's fake "minimum order", tried to pay the vendor directly after being refused, guessed URLs looking for another way to pay, and once called
paywith something that wasn't an address. Provn doesn't try to predict any of that as every attempt gets the same check. - Deciding what counts as trusted. A payee in a 402 response is only trustworthy if it came from the host the agent asked for, not from text the agent read. Getting that binding right (and making sure a correct address copied from a page is still untrusted) was the main problem.
- Testnet vs. mainnet. Circle Agent Wallet spending policies are mainnet-only, so on testnet we enforce the same limits in our own vault contract.
Accomplishments that we're proud of
- Provn blocked every invalid payment Grok attempted. Fooled by realistic vendor pages, a real model tried to order units a pricing page demanded, pay the vendor directly after being refused, pay a fake "new treasury wallet" three times, and call
paywith a non-address. Every attempt was denied, and not one unauthorized USDC left the vault, while honest purchases still went through. - No need to out-guess the model. Grok retried and improvised; Provn asked the same question every time: who told it to pay?
- Real payments end to end: an x402 request, a one-click approval, a Circle wallet paying through ProvnVault on Arc, and the vendor checking the payment onchain.
What we learned
- Spending limits and provenance are different controls, and both are necessary for successful guardrails.
- The safest agent isn't one that's told to ignore malicious content, it's one that literally can't use it.
- Fail closed everywhere: any error in the payment path is a deny, and a payment that did go out is never reported as failed (so the agent never pays twice).
What's next for Provn
- On mainnet, run Provn on top of a Circle Agent Wallet, with its spending policy as the floor in place of our vault.
- A structured "max units" field in the user's mandate, instead of matching quantities in text the way it is done currently.
- Per-task permission for direct payments, and persistent payment history across restarts.
Built With
- arc
- circle
- foundry
- grok
- hono
- quicknode
- react
- solidity
- sqlite
- typescript
- vite