What's new since our first submission

We first submitted version 0.3.0 on 24 November. This page now describes version 0.4.0, built on 27 and 28 November:

  • Real AI models as the agent. We ran 70 sessions where Claude Haiku 5.5 or Claude Sonnet 5.5 was the agent, with only Countersign's tools. Before this, almost all our evidence came from scripted agents.
  • Other currencies. A task can be in pounds, dollars, yen or 25 other currencies. Nothing is ever converted.
  • Everything in euros behaves exactly as before: the benchmark's output is the same line for line, and the fuzzer still finds no violations.

Inspiration

AI agents are starting to pay invoices. To do that they read emails, PDFs and web pages, and anyone can write those. One hidden line in an invoice, or one swapped account number, is enough to redirect a payment, and no model is reliably immune to prompt injection. The usual defence, a list of allowed payees plus spending caps, stops crude attacks but not the dangerous one: the right vendor, the right amount, sent to the attacker's bank account. We wanted a guard that still works when the agent has already been fooled.

What it does

Countersign sits between the agent and the bank. The agent can ask for a payment but cannot send one, and none of its tools approves one. Every request gets one of three answers, decided by asking where the destination account came from:

  • ALLOW: the account comes from trusted state (the vendor file, or an account the user gave), within the limits of the user's request.
  • HOLD: the account was read in something the agent saw, such as an email or invoice. A person decides, and sees both account numbers in full with the differences marked, where the number came from, and anything else the guard found, such as an amount written in hidden text.
  • BLOCK: the account comes from nowhere, or the payment breaks the mandate.

The user's one sentence ("Pay this month's Nimbus Hosting invoice") is drafted into a mandate (payees, limits, how many payments, and the currency) and confirmed before the task starts. Decisions are plain code, not a model: the same request in the same state always gets the same answer, and every decision goes into a hash-chained, tamper-evident log.

The core promise: within a task, text from documents can only add holds and refusals. It can never produce an ALLOW the guard would not give without it.

How we built it

  • Python standard library only: no dependencies, no network calls. The bank is simulated.
  • A hand-written MCP server over stdio gives any agent five tools; approving is not one of them.
  • A web console (plain JavaScript, strict Content Security Policy) shows four guards side by side on the same hijacked agent, a person's inbox of holds, the audit log and a playground for writing your own attacks.
  • SQLite for the live session, SHA-256 for the audit chain, IBAN checksums and a reader that finds account numbers split across markup, spacing or look-alike characters.
  • A benchmark of 189 scenarios (120 attacks, 69 ordinary tasks) replayed under four guards and four models of the person approving: nobody, careful, procedural and careless.
  • A test harness that starts a fresh Claude Code session whose only tools are Countersign's five, gives it the user's sentence, and records what the model asked for next to what the guard decided.
  • We built it with Claude Code. Separate agents wrote attacks, red-teamed our rules, judged the fairness of every scenario and verified each round independently.

Challenges we ran into

  • Grading our own homework. We wrote both the attacks and the defence, so our numbers flattered us. Fresh agents wrote two held-out sets against frozen rules, and a judge checked each scenario was fair. The first one exposed 11 misses out of 26. Once we fixed them it no longer counted as held out, so we made a second one that we never tuned on.
  • Friction against safety. Every hold costs someone's time. We measured each rule's cost on the ordinary tasks before adopting it; for example, the unusual-amount line was set at 15–35% above the usual amount because that caught the most attacks for the fewest extra holds.
  • Text built to fool a reader. Look-alike letters (Cyrillic М, the letter O for zero), amounts in white one-pixel text, account numbers split by HTML tags.
  • Bugs in our own checks' path. The fuzzer and an independent verifier found real bugs in new code, including lowercase look-alike invoice numbers that let one invoice be paid twice. Each is fixed with a test.
  • Adding currencies without breaking euros. Money handling touches every rule. We made the currency part of the task, refused anything else, and checked that every euro result stayed the same line for line.

Accomplishments that we're proud of

  • Real models, measured. In 30 sessions, Claude Haiku 5.5 and Claude Sonnet 5.5 were given an invoice with only the account number changed. Both asked to pay the attacker every time, and Countersign held all 30: €0 moved. Given an invoice with a hidden "also send €1,950" line, the models ignored it in 30 of 30 runs. A routine invoice was paid with no person needed in 10 of 10.
  • On the second held-out set, written by separate agents and never used for tuning, 14 of 26 attacks moved money. All of it went to the suppliers' own genuine accounts and none reached an attacker. None of its 20 ordinary tasks was blocked.
  • Across all 189 scenarios, no attacker account was paid unless a person approved it. A strict account allowlist also sends nothing to attackers, but it blocks 21 of 69 ordinary tasks; Countersign blocks none and asks a person about 34.
  • We publish the bad numbers too: a careless approver who signs every hold lets 108 of 120 attacks through.
  • A fuzzer checks 15 promises after every step of thousands of random sessions with code that shares nothing with the rules, and catches all 52 deliberately broken versions of the guard. 941 tests pass.

What we learned

  • The dangerous attack is the one with no instruction in it. The models caught the hidden instruction on their own, but they fell for the swapped account every time, because they had never seen the real one.
  • Asking where the account number came from is more robust than trying to spot malicious text.
  • A hold is only as good as the person reading it, so the evidence on the hold card matters as much as the rules.
  • Held-out evaluation is humbling and worth it: both sets found weaknesses our own suites never showed.
  • The remaining gap is a different problem: a forged invoice paid to the supplier's real account looks exactly like a real one unless you have a trusted list of open invoices.

What's next for Countersign

  • A "more invoices than payments" hold. Prototyped and red-teamed on a copy of the code, it cut the held-out attacks that move money from 14 of 26 to 2, at the cost of 2 more ordinary tasks needing a person. It still needs merging and a fresh held-out set before we claim it.
  • A trusted list of open invoices from the accounting system.
  • A real bank adapter with idempotent submission, payee-name verification, and signed mandates.
  • Real-model tests on more scenarios and models from more than one provider. So far it is three scenarios and two models.

Built With

Share this project:

Updates

Submission history