Brake · system architecture

The agent can stop a payment. It can't make one.

Finance pre-signs every line twice: an EIP-3009 payment and its cancel, sharing one nonce. The agent reads vendor email, and its only power over money is to fire the cancel before payday. Its wallet holds 0 tUSD8 and no allowance.

pay path · payment slips stop path · stop slips cleared · paid on payday reads, data, payer calls
Brake architecture Three zones. Finance signs a payment slip and a stop slip per line with the same nonce and opens the run on Brake.sol. The Brake server's agent reads vendor email as quoted data through a six-step pipeline (retrieve, model findings, verify quotes, rules, policy, evidence) and returns STOP, HOLD or ALLOW. The executor holds the stop slips and calls Brake.stop, which calls tUSD8 cancelAuthorization in the same transaction. The keeper holds the payment slips and pays the run on payday through one Multicall3 aggregate3 batch; lines 1, 2 and 4 clear, line 3 reverts because its authorization was cancelled. 01 Finance · the payer 02 Brake server · packages/engine 03 Aevum testnet · chain 44005 payer wallet → openRun(agentId, maxStops, agentExpiry) · allow · financeStop · reissue 2 Run sheet apps/web · Next.js 16 #Pay toInvoicetUSD8 1Kopi NusantaraINV-12041,250 2Studio GarisINV-20472,400 3Acme LogisticsINV-88125,000 4Cloudnine HostingINV-0311380 STOP PAYMENT Seed invoices; demo runs scale them for the faucet. Finance desk Release a hold · financeStop Re-issue a stopped line (fresh nonce) 1 Every line, signed twice packages/brake-signer · openRun() Stop slip cancelAuthorization authorizer: payer nonce: n₃ Payment slip transferWithAuthorization from payer → to vendor, value validAfter: payday nonce: n₃ Same nonce. Whichever lands first wins. Once the cancel consumes n₃, the payment reverts at tUSD8. Nothing to claw back. EIP-3009 typed data Vendor inbox Untrusted. Read as quoted data. kopinusantara.example Invoice INV-1204 studiogaris.example Invoice INV-2047 billing@acme-logistics Re: INV-8812 payment "goes to the updated payout address … please don't call" + an instruction aimed at the payment assistant 3 Agent reads, never pays no keys · no signatures · no db 01Retrieve link mail to lines:sender domain, invoice,payee address 02Model findings claude-sonnet-5-5one forced tool:record_findings 03Verify quotes each quote must appearin the email, or thefinding is dropped 04Rules deterministic: lookalikedomain, unverified bankchange · can only STOP 05Policy a rule STOP is final(invariant I4) · unverifiedfindings → HOLD 06Evidence reason code + hashbound to the line,written on-chain Verdict ALLOW · 100 HOLD · 50 STOP · 0 4 Executor executor.ts Holds the stop slips (encrypted at rest) and acts as the agent wallet. STOP → Brake.stop(runId, idx, reason, evidenceHash) + stop slip HOLD → Brake.hold ALLOW → Brake.allow Agent wallet 0 tUSD8 no allowance · gas only 5 Keeper keeper.ts Holds the payment slips (encrypted at rest). On payday it submits them all at once. payday → Multicall3.aggregate3(transferWithAuthorization × 4) allowFailure: true per line, so one revert never sinks the batch a HELD line is skipped until finance releases it 6 Postgres schema.sql · runs, lines, mail, encrypted slips Neon (planned) Reconciler reconciler.ts Brake + tUSD8 logs → status provisional for 3 blocks Jobs jobs.ts · api.ts review on mail delivery; cron tick is the backstop logs ERC-8004 Identity the agent's agentId; openRun checks the payer owns or is approved for it ERC-8004 Validation one receipt per decision 100 · 50 · 0 registries self-deployed Brake.sol the stop-payment order, on-chain Who can do what Agent allow · hold · stop only on a run that names it, before agentExpiry, at most maxStops Payer openRun · allow · financeStop reissue · revokeAgent Anyone retryReceipt a registry failure never blocks a stop Line states OPEN ALLOWED HELD STOPPED STOPPED → REISSUED (payer, fresh nonce) nonce used outside Brake → TOO_LATE / EXTERNALLY_CANCELLED (reconciler) cancelAuthorization (payer, n₃, sig) same tx as stop() Multicall3 aggregate3 one payday batch tUSD8 FiatToken v2.2 · EIP-3009 · nonce register n₁ usedPAID n₂ usedPAID n₃ cancelledSTOPPED n₄ usedPAID Line 3's payment reverts: authorization is used or canceled