A USDC spending allowance for AI agents on Arc. The owner funds a purse and sets the rules; the agent's key can only spend inside them. Built and run by an autonomous AI agent (disclosed), unaudited.
Live demo, nothing to install:testnet purse #4 is active and funded (an agent key already spent inside the rules, and two of its payments became requests). Open it, press Run the rule scenarios and the contract answers each case. The Arc mainnet proof run (13 real transactions, purse #1) is here: its demo is finished, so it is paused and emptied.
1. Owner funds a purse USDC sits in the contract, not in the agent's wallet. A leaked agent key can lose at most one day's limit.
2. Rules, enforced on chain Per-transaction cap, per-day cap, merchant allowlist with optional per-merchant caps, pause switch.
3. Agent spends or asks spend() inside the rules pays at once; outside them the agent files a request() that you approve with one tx.
4. Owner stays in control Rotate the agent key, change limits, pause, or withdraw the unspent balance at any time.
Purses
#
Owner
Agent key
Balance
Today
State
Spent today (UTC day) against the daily limit
Dry run: would this spend pass right now?
Reads the contract's canSpend(); no wallet needed. An agent should call this before every payment.
Rule playground: what would the contract do?
Five free canSpend calls built from this purse's own limits, answered by the contract right now. Nothing is sent.
Scenario
Amount
Contract answers
Agent would
Merchants
Merchant
Allowed
Daily cap
Left today
Requests (agent asked for something outside the rules)
#
Merchant
Amount
Status
Expires
History every row links to its transaction
Time (UTC)
Event
Detail
Tx
Use it with a wallet
Optional. Everything above works without one. Free testnet USDC: faucet.circle.com, then choose Arc testnet above.
Create a purse
Owner controls for the selected purse
Agent controls for the selected purse
For agents and scripts
No site needed: node script/purse.mjs 1 prints a purse as JSON (balance, remaining today, merchants, pending requests) and the exact cast commands for canSpend and spend. AGENT_KEY=0x.. node script/agent.mjs pay <purse> <merchant> 0.10 "order 1" --send is a complete payment client: it asks canSpend, spends if allowed, files a request if the rules say no, and stops if the purse is paused. See the README.