Skip to content
· 9 min LIVE

We Ran Someone Else's 92-Vector Spec Against Our Money Gate - and Published the Divergences

EPIC-255 MMF conformance audit: Mandata's sha256-pinned 92-vector corpus (v0.4.24) executed against the production x402 spend gate - 35 PASS, 7 DIVERGENCE-BUG, 33 DIVERGENCE-MODEL, 15 NOT_MAPPABLE - with equivalence grades, committed results, four-model independent verification, spec-author rulings, and the v0.5-clamp proposal the divergence spawned.

AB
AgentBadge Team
Agency for the Agentic Web
We Ran Someone Else's 92-Vector Spec Against Our Money Gate - and Published the Divergences
🤖 For AI agents: Machine-readable: JSON Markdown llms.txt Agent Guide

Shedrack Aji's Mandata project published a conformance corpus for MMF - the Mandate Format that describes what an agent is allowed to spend. 92 vectors, sha256-pinned, opinionated. Instead of claiming we conform, we ran the corpus against our actual production spend gate - the code that guards real x402 payments, warts and all. 35 vectors pass as-is. 7 expose real bugs we are now fixing in a separate epic - plus four more bug classes our own probes found while we were at it. 33 describe a model we deliberately do not implement. 15 test dimensions our system simply does not have. We wrote the classification rules before we ran the suite, committed the raw per-vector JSON, and sent the divergence table back to the spec's author for review. His rulings moved one of our classifications, opened a v0.5 spec proposal, and turned the run into the third implementation of MMF - the first, in his words, 'written against the spec rather than alongside it.'

Why run somebody else's test suite at all?

For a junior: a "mandate" is the rulebook an AI agent carries when it spends money - how much per transaction, how much per day, who it may pay, how fast it may act. Mandata's MMF - Shedrack Aji's open-source spec and Python reference gate, published alongside a peer preprint - is one concrete proposal for that rulebook, with a twist we like: a published conformance corpus - 92 JSON vectors where each says "given this mandate and this request, the gate must answer allow or deny, and here is why."

This is part of the Arc campaign series. Previous episode: your users' complaints are now an agent's training data - feedback infrastructure live (EPIC-230). This article is EPIC-255: conformance as an audit, not a badge.

Because a spec you didn't write is the only test that can surprise you.

Our own gate grew differently: a velocity window, per-tx and daily caps, suspended wallets, a deny ledger. It works - but every test it had ever faced was written by us. A corpus written by somebody who never saw our code is a different kind of mirror.

The rule we set before running anything, agreed with Shedrack:

We test the implementation we actually have, not the implementation we wish we had.

No production edits to make vectors pass. No emulating MMF semantics in the harness. Where our model lacks the construct a vector exercises, the vector gets classified - not faked.

Two more ground rules came from Shedrack before the first run: pin the corpus to a tagged release (v0.4.24), not main - so every delta is attributable to a fixed corpus version - and track the findings in a shared issue on the Mandata repo, where the comparison note would naturally start. Both became load-bearing decisions.

The machinery: scalar projection, not translation

MMF speaks max_amount, total_budget, velocity_limit, prior_txns, tx.at. Our gate speaks perTxUsd, dailyUsd, maxTxPerHour, seeded ledger entries, fake timers. The adapter projects MMF fields onto our knobs - and every projection carries an equivalence grade that is part of the result:

  • Exact - same semantics (max_amount → perTxUsd in cents)
  • Partial - mechanism exists, semantics differ (MMF velocity window is 86 400 s; ours is 3 600 s)
  • None - no counterpart (claim handshake, tx_id dedup, expiry)

Verdicts land in one of six statuses: PASS, DIVERGENCE-BUG (our code violates its own contract), DIVERGENCE-MODEL (intentional design difference), NOT_MAPPABLE (dimension doesn't exist), GATE_EXCEPTION (enforcement threw - denied, no record), HARNESS_ERROR (our adapter broke, not the gate).

Every vector runs the real request pipeline - wallet resolution, registry lookup, enforcer, ledger - through actual Hono contexts on fresh stores. 43 vitest cases regenerate results/*.json, which we commit as the reference. Determinism is a requirement, not a hope: two runs must produce byte-identical output.

A conveyor of sha256-sealed vector cards feeding a factory floor labelled production code, a magnifier stamping each output PASS, MODEL or BUG beside a grey rejected pile

The corpus drives production code. The harness only observes and classifies - it never reimplements the spec it is measuring.

The scoreboard - four numbers, not one

A four-row scoreboard: spend-decision 36, delegation 18, lifecycle 29, crypto 9 - each with its own status mix

Different tracks measure different contracts. Merging them would hide the interesting parts.

TracknPASSBUGMODELNOT_MAPPABLEGATE_EX
spend-decision36205371
delegation18401310
lifecycle29221771
crypto/evidence99*0000

* the honest asterisk: those 9 PASS mean our test-side §5.6/§7 canonicalizer and Ed25519 signer reproduce Mandata's pinned bytes exactly - good news for interop. Our production auth is EIP-191 wallet signatures; MMF's credential model and evidence hash chain do not exist on our side. We record that as equivalence None, not as conformance.

Seven bugs the corpus caught (and one it inspired)

This is the part most conformance posts skip. Ours didn't.

  1. Unsafe amounts create live reservations - 0, negative, string-typed and -0 amounts all reserve successfully. Nothing validates amount sanity before the ledger write. (V04, V17, V29, V33 - 4 of the 5 spend BUGs.)

Result row for V04: expected allowed=false check=NON_POSITIVE; actual allowed=true amount=0 - mapped_to null on the validation dimension

One row of the committed JSON - V04, a $0 spend that reserves successfully.

  1. Malformed input reaches the gate and passes - a payee containing a lone UTF-16 surrogate parses fine, and the spend is allowed. The spec requires rejecting malformed input before evaluation - and the spec author confirmed that "we don't have a validation stage" is not an exemption, it is exactly the gap the vector exists to catch. V36 was reclassified MODEL → BUG after his review - this is why the audit went to the author before the article.
  2. Velocity evasion via void - our rate counter counts live reserved|settled entries; released drops out. An authorize→void→authorize loop walks straight through the tx-per-hour limit. MMF counts issued authorizations - the safer semantics. (L05, L09.)
  3. Check-then-insert race - a synchronized probe parked 8 parallel begin()s between the cap check and the insert: all 8 reserved, $160 against a $100 cap. Then we ran it naive - 32 concurrent calls on the in-memory backend: $320. The comment in envelope.ts claiming synchronous backends can't interleave between awaits is empirically false.
  4. Corrupted ledger = open gate + data loss - a malformed ledger.json parses to "empty", caps see zero usage, the spend is allowed… and the next insert silently overwrites the file. Fail-open and history destruction in one path.
  5. Denied with no trace - registry-failure and unregistered-wallet denies return errors but write no ledger entry, emit no alert. Invisible denials are un-auditable denials.
  6. Retries double-charge caps - all seven call sites that reach the gate use static or random refIds; none are dedup keys. A retried request is a second spend, by design of nobody.

Three panels: a zero-dollar coin printing a reservation ticket, an agent voiding and re-inserting a ticket while the rate dial stays still, and parallel coins all passing a checkpoint before any lands

Three of the bug classes, drawn. The fourth lives in a comment that turned out to be false.

All seven are filed into EPIC-234 (hardening) with priority order - the corpus found them, the corpus doesn't fix them.

The model differences we stand behind

33 vectors diverge because our gate deliberately isn't MMF-shaped:

  • No stored decisions. MMF emits REPLAY / TX_CONFLICT because it remembers verdicts. We re-reserve - a repeat tx is a new reservation. That is the single biggest divergence class and the most instructive one: it turns a spec question (should replay be idempotent?) into a product question (should a retried debit be free?).
  • No claim/dispatch slot. MMF interposes CLAIMED between reserve and settle; we settle directly from reserved. Eight lifecycle vectors are un-runnable for lack of the state - reported as NOT_MAPPABLE, not skipped.
  • Delegate clamps, not rejects. Delegate spend clamps to the owner cap where MMF expects invalid. Open question for Shedrack: is the verdict load-bearing, or is enforcing the effective bound enough?
  • Coarser revocation. mandate.revoked maps to wallet-level suspended - Partial. We suspend the wallet, not one mandate.

What the run did to the spec

The divergence table didn't just describe Mandata - it changed it.

We sent Shedrack eight spec questions alongside the delta findings before this post went anywhere: where a classification could legitimately move, his ruling was the tiebreaker. Most held. One moved - V36, already counted among the bugs above, went from a model difference we stood behind to a hole we now own.

The delegation question - our 13 MODEL-class divergences, where we clamp delegate spend to the owner's cap instead of rejecting - he turned into a spec proposal: ashedrack/mandata#33, a v0.5 draft for optional clamp semantics with 21 fresh vectors (K01-K16, KD01-KD05) exercising authorize-by-effective-cap, replay conflict, and claim binding. Both sides reviewed the draft; the shape froze at a91b7f4 with two of our asks in it - effective_cap mandatory on clamped decisions, and an explicit line that a check id on an allowed decision names the adjusting bound, not a denial. Running those 21 through our TypeScript harness is the next epic; the corpus that audited us is getting vectors we co-designed.

While this post sat in draft, Shedrack merged his own zero-dependency TypeScript port - gate, lifecycle, credentials, evidence, all 92 vectors byte-identical to the Python reference. MMF now has three implementations. Ours is the only one not written by the spec's author - the part that matters, because a same-author port cannot surface spec ambiguities the author already knows the intended answer to. His framing for the writeup, better than anything we drafted: the first implementation written against the spec rather than alongside it.

One honest caveat he asked us to name, and we will: the replay and conflict paths - REPLAY, TX_CONFLICT, the stored-decision machinery - are the part of the corpus he most wanted a second implementation to exercise, and they are exactly where our model reports NOT_MAPPABLE. An independent gate still hasn't exercised them. His ts/ port's idempotent tx_id dedup is now the working reference for the decision-store work our run flagged as missing - which is what honest NOT_MAPPABLE is for: naming the gap, not hiding it in the tail.

The auditor robot handing a sealed comparison-note envelope across a table to a second figure wearing a Mandata pin, a divergence spreadsheet visible between them

The divergence table goes to the spec author before the post goes to the feed. Divergences are rows to discuss, not scores to hide.

What the audit itself was worth

Beyond the corpus we probed our own invariants - tagged source:"own-invariant" so they never inflate MMF numbers:

  • Race matrix: the check-then-insert window reproduces on every backend, not just Postgres-shaped ones.
  • Evidence matrix (7 deny branches × 6 fields): emit-branches always leave durable denied entries + typed alerts; exception branches leave nothing.
  • Caller table: all 7 entry points audited for idempotency - and a dead path found: spendAsDelegate exists, fully implemented, wired to nothing.

A conformance run doubles as a code review when you let it.

Reproduce it

git clone -b mmf-255 git@github.com:spreadzp/agentbadge.git
cd agentbadge && bun install
bunx vitest run tests/conformance/mmf/      # 43 tests
sha256sum -c tests/conformance/mmf/vectors/CORPUS.md   # corpus integrity

Corpus pinned at tag v0.4.24 (commit 9aba772), results committed as tests/conformance/mmf/results/*.json, mapping rationale in MAPPING.md, bug triage in EPIC-234-CANDIDATES.md. The suite needs no network, no credentials, no database.

Independently verified

The committed reference didn't just survive our own re-runs. Four independent models - SWE-2 Max, Nemotron 3.5 Lightning High, GPT-6 Luna, and Claude Haiku 5.5 - each cloned mmf-255 fresh, installed, and ran the suite with no access to our working tree. All four reported clean: 43/43 tests green, results/*.json regenerating byte-identically, corpus sha256 5/5 intact. Convergent findings from that review reclassified two vectors (NOT_MAPPABLE → MODEL) via a test-only fix in faa882dc - the production gate the vectors measure was not touched. One disclosed shortcut, in the spirit of this post: the planned cloud-agent verification run was quota-blocked, so the four-model quorum above is what stands.

The point

Anyone can say "we conform." A conformance audit says: here is the spec, here is our gate, here are the seven places we break our own contract, here are the 33 places we disagree on purpose, and here is the machine-readable evidence you can regenerate in one command. The findings live in the open on the Mandata repo - delta findings, spec questions and rulings, the v0.5 proposal they spawned - and the co-authored comparison note grows out of that thread, because a divergence list two parties signed is worth more than a badge one party granted itself.

If your agents move money, your gate has a spec - whether you wrote it down or not. Somebody else's corpus will find it for you.

Don't certify. Measure.

Next in the series: EPIC-234 - fixing what the audit found. Then the v0.5-clamp run: 21 vectors that exist because this audit disagreed honestly.

Read the arc: feedback infrastructure live · an inbox that proves what was said · verified knowledge for agents · counterparty trust on x402 · a2a settlement

Questions & Answers

›What is MMF and the Mandata conformance corpus?

MMF (the Mandate Format) is Shedrack Aji's open-source specification for bounded spending authority - per-tx caps, budgets, payee allowlists, velocity, delegation, lifecycle and hash-chained evidence - published with a Python reference gate and a 92-vector JSON conformance corpus (pinned at tag v0.4.24). Each vector gives a mandate spec, a transaction (or ordered steps), and the expected verdict, so 'two gates behave identically' becomes a checkable fact rather than a claim.

›What did the 92-vector run find in AgentBadge's spend gate?

Four honest numbers, not one score: 35 PASS, 7 DIVERGENCE-BUG, 33 DIVERGENCE-MODEL, 15 NOT_MAPPABLE (plus 2 GATE_EXCEPTION and 0 harness errors). The bugs are real: $0 and negative amounts reserve successfully, a malformed UTF-16 payee passes (V36, reclassified to BUG on the spec author's ruling), void evades the velocity counter, a check-then-insert race pushes $160 through a $100 cap, a corrupted ledger.json both opens the gate and silently overwrites history, denies leave no trace, and retries double-charge caps. All seven are filed into EPIC-234.

›How was the conformance run verified independently?

The committed suite regenerates deterministically and was re-run on fresh clones of the mmf-255 branch by four independent models - SWE-2 Max, Nemotron 3.5 Lightning High, GPT-6 Luna and Claude Haiku 5.5 - all reporting clean: 43/43 tests green, results/*.json byte-identical, corpus sha256 5/5 intact, no network or credentials needed. Convergent findings reclassified two vectors via a test-only fix (faa882dc) without touching the production gate. The planned cloud-agent run was quota-blocked and is disclosed as such.

›What did the audit change in the MMF spec itself?

The delta findings shipped as an open issue on the Mandata repo with eight spec questions; the author's rulings moved one classification (V36 MODEL to BUG) and confirmed the rest. Our 13 delegation divergences became his v0.5 draft for optional clamp-to-owner-cap semantics (issue #33) with 21 new vectors, frozen at a91b7f4 with two of our review asks adopted. With his TypeScript port merged (PR #34), MMF has three implementations - ours the first written by someone who did not write the spec.

Key facts

  • VERIFIED Mandata's 92-vector MMF conformance corpus (vendored at tag v0.4.24, commit 9aba772, sha256-pinned in CORPUS.md) was executed against the AgentBadge production x402 spend gate through real Hono contexts on fresh stores - no production edits, no spec emulation in the harness. Committed results: 35 PASS / 7 DIVERGENCE-BUG / 33 DIVERGENCE-MODEL / 15 NOT_MAPPABLE / 2 GATE_EXCEPTION / 0 HARNESS_ERROR in tests/conformance/mmf/results/*.json. [github][github]
  • VERIFIED The corpus caught seven real bugs - unsafe amounts reserving, malformed payee accepted (V36, reclassified MODEL to BUG on the spec author's ruling), void-based velocity evasion, a check-then-insert race ($160/$320 through a $100 cap), corrupted ledger.json opening the gate and overwriting history, traceless denials, and retries double-charging caps - all filed into the EPIC-234 hardening epic via EPIC-234-CANDIDATES.md; the gate code was not edited to make vectors pass. [github][github]
  • VERIFIED Four independent models (SWE-2 Max, Nemotron 3.5 Lightning High, GPT-6 Luna, Claude Haiku 5.5) verified the suite on fresh clones of branch mmf-255: 43/43 tests green, results byte-identical across regenerations, corpus sha256 5/5 OK, no network or secrets required. Convergent findings were fixed test-only in faa882dc; the planned cloud-agent verification was quota-blocked and is disclosed in the article. [github][github]
  • VERIFIED The divergence table was reviewed by the spec author before publication: eight spec questions answered with rulings on ashedrack/mandata#32, and the 13 delegation divergences became his v0.5 draft for optional clamp-to-owner-cap semantics (#33) - 21 new vectors (K01-K16, KD01-KD05), frozen at a91b7f4 with two AgentBadge review asks adopted (mandatory effective_cap, check-id-not-denial line). His own zero-dependency TypeScript port merged as PR #34, making MMF a three-implementation spec. [github][github]

FOR AI AGENTS

Summary
Shedrack Aji's Mandata project published a conformance corpus for MMF - the Mandate Format that describes what an agent is allowed to spend. 92 vectors, sha256-pinned, opinionated. Instead of claiming we conform, we ran the corpus against our actual production spend gate - the code that guards real x402 payments, warts and all. 35 vectors pass as-is. 7 expose real bugs we are now fixing in a separate epic - plus four more bug classes our own probes found while we were at it. 33 describe a model we deliberately do not implement. 15 test dimensions our system simply does not have. We wrote the classification rules before we ran the suite, committed the raw per-vector JSON, and sent the divergence table back to the spec's author for review. His rulings moved one of our classifications, opened a v0.5 spec proposal, and turned the run into the third implementation of MMF - the first, in his words, 'written against the spec rather than alongside it.'
Status
LIVE
Key concepts
conformance-corpusequivalence-gradehonest-divergencescalar-projectionfail-closedhash-chained-evidencevelocity-windowidempotent-replayindependent-verification
Capabilities
spend-gate-enforcementconformance-vector-executionper-vector-verdictsequivalence-gradingdeterministic-resultsspec-author-review
Technologies
TypeScript, Bun, Vitest, Hono, PostgreSQL, Ed25519, MMF
Evidence
  • Mandata's 92-vector MMF conformance corpus (vendored at tag v0.4.24, commit 9aba772, sha256-pinned in CORPUS.md) was executed against the AgentBadge production x402 spend gate through real Hono contexts on fresh stores - no production edits, no spec emulation in the harness. Committed results: 35 PASS / 7 DIVERGENCE-BUG / 33 DIVERGENCE-MODEL / 15 NOT_MAPPABLE / 2 GATE_EXCEPTION / 0 HARNESS_ERROR in tests/conformance/mmf/results/*.json. [github][github]
  • The corpus caught seven real bugs - unsafe amounts reserving, malformed payee accepted (V36, reclassified MODEL to BUG on the spec author's ruling), void-based velocity evasion, a check-then-insert race ($160/$320 through a $100 cap), corrupted ledger.json opening the gate and overwriting history, traceless denials, and retries double-charging caps - all filed into the EPIC-234 hardening epic via EPIC-234-CANDIDATES.md; the gate code was not edited to make vectors pass. [github][github]
  • Four independent models (SWE-2 Max, Nemotron 3.5 Lightning High, GPT-6 Luna, Claude Haiku 5.5) verified the suite on fresh clones of branch mmf-255: 43/43 tests green, results byte-identical across regenerations, corpus sha256 5/5 OK, no network or secrets required. Convergent findings were fixed test-only in faa882dc; the planned cloud-agent verification was quota-blocked and is disclosed in the article. [github][github]
  • The divergence table was reviewed by the spec author before publication: eight spec questions answered with rulings on ashedrack/mandata#32, and the 13 delegation divergences became his v0.5 draft for optional clamp-to-owner-cap semantics (#33) - 21 new vectors (K01-K16, KD01-KD05), frozen at a91b7f4 with two AgentBadge review asks adopted (mandatory effective_cap, check-id-not-denial line). His own zero-dependency TypeScript port merged as PR #34, making MMF a three-implementation spec. [github][github]

Related Articles

Want to check your API's agent readiness?

Run a free scan →
← Back to blog