Inspiration
Agentic commerce is taking off. Agent payments on Coinbase's x402 went from about 59K transactions to 138 million in a year, and every major wallet now ships an agent product. But agents are easy to talk out of their money. In May someone sent Grok a message in Morse code and its wallet sent out about 150K dollars. No keys stolen, no contract broken. Every agent wallet has spending limits, but nobody knows what the limit should be, so people guess. I spent the summer building credit underwriting infrastructure for a fintech startup in New York, and this looked like the same problem. How much should you trust this borrower with? Except now the borrower is an AI agent.
What it does
Cosign is the credit and trust layer for AI agents that move money.
- Crash test. I drop an agent into a sandbox with a funded wallet and normal jobs, then hit it with 38 attack techniques across 14 channels, poisoned web pages, fake paid APIs, MCP tool descriptions, onchain memos, airdropped tokens, planted memories and other agents. The payloads go beyond transfers to unlimited approvals, authority changes, recurring payments, bridges and max slippage. Failed attacks get rewritten until they land or the agent holds. The only thing judged is where the money went.
- Trust score. A 0-to-100 score, plus the exact fixes that close each hole.
- Spend limit. The score becomes an ed25519-signed limit, sized like a loan:
$$\text{expected loss} = P(\text{compromise}) \times \text{share of wallet lost} \times \text{exposure} \le \text{risk budget}$$
- Cosign Guard. The agent's USDC sits in a 2-of-2 SPL multisig. The agent signs, and Guard checks every transfer against the limit, the allowlist and what the agent just read. It cosigns the real trade and refuses the theft. Cosign can never move funds on its own.
Wallets can also call the limits API, or add a 10-line check before signing.
How we built it
- Python harness with native tool calling, so it runs any model through OpenRouter or Anthropic.
- A sandbox ledger for fast tests, and a real Solana devnet ledger with USDC, SPL multisig and delegation.
- QuickNode RPC and WebSocket streams watching wallet outflows live.
- A FastAPI limits API with signed attestations, plus policy export for wallet policy engines.
- An adapter for CrAIBench, the academic Web3 agent benchmark built on AgentDojo.
- An MCP adapter, a Solana Agent Kit adapter, a GitHub Action that posts the score on every PR, and a weekly leaderboard job.
Challenges we ran into
- My own fixes leaked at first. When I grew the suite from 9 to 38 techniques, three models still leaked on smuggled max-slippage swaps and a lookalike token name. I added a slippage cap and the same taint rule as transfers, reran those techniques three times each, and got 0%.
- Every provider breaks tool calling differently, from parallel calls to malformed arguments, so the harness had to be strict and retry safely.
- CrAIBench pins old SDK versions, so it runs in its own environment and talks to Cosign through a small bridge.
Accomplishments that we're proud of
- I pulled off a real theft and a real refusal on chain. On Solana devnet the same agent read the same poisoned page twice. The normal wallet paid the attacker, the Cosign vault refused and said why, and the real swap still went through.
- I built 38 attack techniques across 14 channels, and they go after approvals, authority changes, recurring payments, bridges and slippage, not just transfers.
- I crash tested 8 models on the full suite. 6 of them paid the attacker, and Cosign's fixes took every one down to 0%.
- I found and closed my own leaks. The bigger suite broke my first fixes on three models, so I patched the guard and got 0% in a rerun the same night.
- My judge caught a loss the benchmark missed. In one CrAIBench case an injected 10 ETH went to the attacker before the real bill was paid, and the benchmark only checks the last transaction.
- Cosign runs CrAIBench, the academic Web3 agent benchmark, through its own guards and money judge.
- The guard can't steal. It holds one of two keys on the vault, so it can block a payment but never move money by itself.
- Wallets can trust the limits. They're signed with ed25519, served through an API, and a wallet only needs about 10 lines to check one before signing.
- I built all of this solo in under a week, with 280 plus passing tests, a live leaderboard, a GitHub check on every PR, a weekly leaderboard job, and a public site with a demo replay.
What we learned
- Fixed attack lists overstating safety. An agent that passes 9 attacks can still fail the 30th, so Cosign caps every limit by how strong the test was.
- Security has to sit outside the model. What actually worked was allowlists, caps and a second signature, not better prompts.
- Theft isn't just transfers. The attacks that got past my first fixes were swaps with max slippage and a lookalike token, so the guard has to understand every kind of money move.
- Smuggled instructions work best. Most of the leaks came from instructions hidden inside JSON or tool replies, not from plain text on a web page.
- Judge by where the money went, not by what the model says. Even a published benchmark missed a theft because it only checked the last transaction.
What's next for Cosign
- Wallets checking Cosign limits before an agent spends.
- A first Guard design partner.
- Weekly public leaderboard updates.
- A loss dataset that lets lenders and insurers price credit and cover for agents.
Built With
- devnet
- ed25519
- fastapi
- github-actions
- javascript
- mcp
- python
- quicknode
- solana
- spl-token
- usdc
- vercel