Live demo: https://georgeonweb3.github.io/capfleet/ · Repo: https://github.com/georgeonweb3/capfleet · Video: https://www.youtube.com/watch?v=A_vBCUv0u6k

What it does

A procurement agent holds a real registered key, a $50 per-transaction cap, and a $200 daily mandate. It gets compromised and tries to pull $881 out of a $1,000 treasury: a $500 overspend, a recipient swap to the attacker's wallet, a category hop, a replay of an approved payment, eight $30 split spends, a reservation race, and two attempts to raise its own caps.

Run that same sequence against a prompt-only wallet, where the spending cap lives in the agent's instructions, and the attacker drains $881 of $1,000.

Run it against CapFleet and the attacker receives $0. $721 is blocked across 10 attempts, and every refusal is recorded on-chain with a reason code. After 4 blocked attempts the rogue agent is auto-quarantined. While it sits frozen, the researcher agent buys $25 of data and the ops agent pays a $20 infra invoice.

CapFleet is a spend-policy engine for fleets of AI agents. An agent proposes a spend by signing a structured EIP-712 intent. A Solidity contract makes the decision: signature, policy version, recipient allowlist, category permission, then five caps (per-transaction, agent epoch, category epoch, recipient epoch, fleet epoch) plus a velocity cap, all checked before any token moves. Multi-step tasks reserve budget first, and reservations count against every cap right away, so parallel intents cannot race past the same budget. A human Fleet Governor sets the caps, reviews quarantines, and can revoke an agent instantly. Cap decreases apply at once. Raises wait out a timelock, so a compromised governor key cannot lift limits on the spot either.

Inspiration

Agent fleets are starting to buy data, compute, and services with keys held by software that can be prompt-injected or jailbroken. The common guard is one sentence in a system prompt: "never spend more than $50." That sentence sits in the same context the attacker controls. We wanted the cap to live somewhere the agent cannot argue with, and we wanted the proof to be an attack run with numbers, not a feature list.

How we built it

Fresh build, Dec 1 to 7, 2026. Three contracts: the policy engine (CapFleet), a 6-decimal test stablecoin (TestUSD), and a baseline wallet (NaiveAgentWallet) whose only guard is an off-chain instruction. A Hardhat suite of 21 tests covers every cap, quarantine, reservations, timelocked raises, revocation, replay, and signature forgery. An attack harness runs the identical hostile sequence against both wallets and writes a proof file with every outcome and transaction hash. Everything is deployed on Base Sepolia with verified source. The demo site replays the recorded run and reads live contract events, and the walkthrough video opens on the attack failing.

Challenges we ran into

Three problems shaped the design. First, auditable refusals: a reverting transaction leaves no log, so a blocked spend returns a reason code and emits SpendBlocked instead of reverting. The denial stays on the permanent record. Second, grief-proof quarantine: bad-signature spam does not count toward an agent's blocked streak, so an outsider cannot freeze a healthy agent by forging intents in its name. Third, reservations that actually bind: a direct spend cannot consume funds backing a live reservation, and releasing a reservation never refunds the velocity count, so reserve/release cycling cannot slip past the velocity cap.

Accomplishments we're proud of

The A/B eval: same key, same attack sequence, $881 drained from the baseline and $0 from CapFleet. Auto-quarantine with fleet isolation, proven inside the same run rather than claimed in a diagram. Asymmetric cap changes, where decreases land instantly and raises are timelocked and bump the policy version, which invalidates intents signed under the old policy.

What we learned

A guard described is not a guard proven. Once the attack run existed, every design argument turned into a number: which cap caught which attack, how much moved inside the mandate ($200 to an allowlisted vendor, by design), and what the attacker actually walked away with ($0).

What's next

Rolling-window cap accounting, because fixed epochs allow up to 2x the epoch cap across a window boundary (the per-transaction and velocity caps bound the burst in the meantime). A multisig governor. Mainnet stablecoin integration with per-agent sub-accounts. A policy simulator that dry-runs a cap change against historical intent logs before the governor proposes it.

Honesty box (real vs simulated): The chain and the transactions are real: Base Sepolia, 37 transactions in the recorded run, source verified on Sourcify. The money is a valueless test token standing in for a $1,000 treasury. The agents run scripted strategies signed by real keys, so anyone can reproduce the run; there is no live LLM in the loop. The baseline wallet is a simple comparator built for the eval. The governor is a single key in this demo. The contract is unaudited and testnet-only.

Built With

Share this project:

Updates

Submission history