Make policy executable
Express per-agent caps for each payment and over a rolling window, plus payee, network, and asset rules. No matching policy or an ambiguous rule means DENY.
Counterroll checks the x402 payment requests you route through it against your spending rules. When it records a policy decision on the ledger, it signs a record you can verify offline.
Or run the free x402 setup check on your project. Nothing is uploaded.
Supported today: the x402 exact scheme with single-key wallets, for requests your integration explicitly routes through Counterroll. Anything it cannot safely evaluate is refused. A missing record is not proof that no request or payment occurred.
x402 lets agents pay for APIs over HTTP. In October 2026 a Cloud Security Alliance research note reported flaws in x402 client SDKs, since fixed, including clients with no default spending limit that paid whatever the server asked for. Limits matter, and so does a record of what they decided.
Source read 2026-11-20 for the x402 setup check. Not a claim about adoption, or about Counterroll customers or revenue.A wallet limit can cap an amount. For supported requests that reach policy evaluation, Counterroll records which agent asked, which policy was applied (or that none was), why the decision was made, and whether the record still verifies later.
Express per-agent caps for each payment and over a rolling window, plus payee, network, and asset rules. No matching policy or an ambiguous rule means DENY.
Each APPROVE and DENY recorded on the ledger is signed and keeps the policy it was decided against (or that none applied), the reasons, and a link to the record before it. See what a record does not prove.
Policy and decision history live in Counterroll, not in the facilitator. The upstream x402 facilitator is configured per organization; changing it does not rewrite existing records, and each facilitator still needs to be tested for compatibility.
import { Counterroll, usdc } from '@counterroll/sdk'; // Public sandbox: one published key, bundled demo agents, a live URL. const cr = new Counterroll({ apiKey: 'qm_sandbox_publicdemo_v1' }); const ok = await cr.check({ agent: 'research-bot', to: 'openai', amount: usdc(1) }); const no = await cr.check({ agent: 'research-bot', to: 'openai', amount: usdc(500) }); console.log(ok.approved, no.reasons); // true ['per_tx_cap_exceeded'] console.log(no.receipt!.hash); // signed + hash-chained — verify it yourself
Install with npm i @counterroll/sdk. The shared public sandbox uses synthetic inputs and a published key: no account, no key request. It is a demonstration, not a production service, and its isolation has not been established. Use only the bundled demo inputs; never send real credentials, wallet keys, signed payment authorizations or customer data.
cr.verify({ publicKey }) pulls the raw rows and re-derives the chain you were given: each hash recomputed, each signature checked against a public key you authenticated out-of-band. To notice missing or withheld records you also need a trusted reference for the latest expected record. Verification shows the integrity of the records you received; it does not show the chain is complete or current, or that any payment happened.{
"decision": "APPROVE",
"denyReasons": [],
"attestation": {
"id": "att_29240a122a59b0c63e0749d16008ded9",
"organizationId": "org_sandbox",
"seq": "1",
"agentId": "research-bot",
"policyId": "policy_sandbox_research",
"decision": "APPROVE",
"payTo": "openai",
"amount": "1000000",
"network": "eip155:8453",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"policySnapshot": { "perTxCap": "5000000", "windowCap": null, … },
"requirements": { … },
"eip3009Nonce": "c31d1ab50d697dd6b7a1973632ca2a93d8e247fa442e830fef57d7c1b4bfcac6",
"payloadSha256": "53e3bc4b0d3735baf9d8e1ab3642bfbc4626366b68d23fa543246cbef575c56b",
"prevHash": "GENESIS",
"hash": "e0c9a5964716f7b6a0cb71e6275601e4a00524bc43d40a15e6dbc547d9c15082",
"signature": "23106faca39847ab2b2cec5c3f428760214b42e395754d3ebf576189d258ff83926059aeb7515ea5c18a0d4b85c45c9e0383191f42faf0c3c38b78a9544f0109",
"createdAt": "2026-07-18T22:16:00.214Z"
}
}
{
"decision": "DENY",
"denyReasons": ["per_tx_cap_exceeded"],
"attestation": {
"id": "att_abbfe9ca99df62898d204f1c520ac181",
"organizationId": "org_sandbox",
"seq": "2",
"agentId": "research-bot",
"policyId": "policy_sandbox_research",
"decision": "DENY",
"payTo": "openai",
"amount": "500000000",
"network": "eip155:8453",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"policySnapshot": { "perTxCap": "5000000", "windowCap": null, … },
"requirements": { … },
"eip3009Nonce": "9641901101b3259d4145bd6a594571bd45543051aa2585d1a0fd9755584b43b3",
"payloadSha256": "9954c6456edcc97c62984f3c425de8d7fb50daa495c845553e29484757596e95",
"prevHash": "e0c9a5964716f7b6a0cb71e6275601e4a00524bc43d40a15e6dbc547d9c15082",
"hash": "dbf1b4efee0ff1baf6e76dce561627452f25affecae65d1735fc2ae0eb97c616",
"signature": "c71dc37a66c2b7f933710bf452e41e72b2210d466b69b3eefaabcf84f9830610a07f75b98511feecd0a42545ec86da929c916752d15ffb518755013b2b8e2903",
"createdAt": "2026-07-18T22:16:00.670Z"
}
}
Rows 1 and 2 of Counterroll's shared public sandbox chain (org_sandbox), recorded 2026-07-18 and read again from the deployed sandbox API on 2026-11-22. Both re-checked offline that day with the free record verifier against the sandbox's published key e9d3619e…b6d1: each passed, and the DENY's prevHash is the APPROVE's hash. The sandbox is a shared demonstration with synthetic inputs and a published key; it is not a production service, and its isolation has not been established. cr.verify({ publicKey }) re-derives the chain you are given against that key; it does not show that the chain is complete or current. A DENY records that Counterroll refused the request under policy; on its own it does not show what happened on the payment rail.
The record verifier, the x402 setup check and the SDK are free. Beyond them, we are open to discussing an offline evaluation that uses synthetic inputs and involves no payments. Production use and embedded platform integrations are exploratory conversations only: they are gated on readiness work and are not an offering available today.
For teams with a named technical owner and a policy they want to test. Inputs are synthetic and no payment is made. What it shows: how the policy decides your test cases, and how the resulting records verify with your own tooling.
For wallets, facilitators, agent runtimes, marketplaces, and platforms considering production or embedded use. These are exploratory conversations: not available today, gated on readiness work, and not included in an offline evaluation.
In an offline evaluation, synthetic versions of that flow test three questions about whether Counterroll fits your stack.
Wallet limits are useful and Counterroll does not replace them. Counterroll adds a decision layer for each organization: agent identity, a policy assigned to each agent with per-agent per-payment and rolling-window caps, payee and rail restrictions, explicit deny reasons, and a signed record of each decision recorded on the ledger, with the policy snapshot it used, kept in a chain you can verify.
Counterroll holds no funds and no settlement keys. It authorizes, attests, and records. When Counterroll approves a settlement request, it proxies that request to the facilitator your organization configures, and the facilitator may then make the payment. Settlement itself happens upstream.
The SDK can pull raw rows and locally re-derive their hashes and signatures against an organization public key you authenticated outside the database. A rewritten chain signed with a different key fails that client-side verification. This detects changes to signed fields; it does not detect records withheld from you unless you also hold a trusted reference for the latest expected record.
A DENY is a successful policy evaluation, not an exception. The agent receives approved: false plus machine-readable reasons such as per_tx_cap_exceeded, and a DENY recorded on the ledger is kept as a signed record. Some refusals, such as a repeated request, return only an unsigned event ID. It records Counterroll's refusal; on its own it does not show what happened on the payment rail.
We review Counterroll internally the way an attacker would. Two findings from internal reviews in July 2026 shaped the architecture. These were internal reviews, not independent audits, and both fixes are recorded in our private repository history.
The window cap said $200 a day. The first build read the agent's window spend, evaluated the policy, then appended the attestation — three steps, no lock. Two near-cap requests arriving at once would each read the same "spent so far," each pass evaluation, and both get approved: window overspent, with two individually valid receipts to show for it. A textbook time-of-check/time-of-use race, in the one component whose job is making spend limits mean something.
The fix put the replay check, the window read, the evaluation, and the append inside a single transaction holding the org's row lock — and the regression test now races concurrent near-cap requests to check it. Nothing evaluates outside that transaction. This fix covers policy decisions; handling of concurrent or retried settlement attempts is a separate problem that is still being worked on.
For drop-in x402 compatibility, the gateway once accepted a fallback: if the agent-signature headers were missing, resolve the agent from the payment's EIP-3009 from wallet. Read that from an attacker's chair. The API key authenticates the tenant, not the agent — so anyone holding the org key could attribute spend to any agent in the org, minting APPROVE attestations and draining that agent's window budget, with no proof of possession of the agent's key. (The org key alone does not supply the payer's EIP-712 signature that settlement needs upstream, but that is not a guarantee against settlement misuse.)
The gateway now requires the agent's Ed25519 request signature by default and rejects the wallet path with 401 before any ledger write; the fallback survives only as an explicit per-org opt-in, documented as the tradeoff it is.
A tamper-evident ledger is only as good as the code that writes to it. Internal reviews continue, and some settlement-time risks remain open. The relevant fixes, tests, and threat-model decisions can be discussed during technical diligence.
Counterroll has no custody and holds no settlement keys: v1 authorizes, attests, and records. A control layer is only credible if its records can be checked against a key you authenticate yourself, rather than taken on our word.
Counterroll holds no funds and no settlement keys. Approved settlement requests are proxied to your configured facilitator, which may then make the payment, and your receipts ride in the standard x402 extensions field. Changing the configured facilitator does not rewrite existing records; each facilitator still needs to be tested for compatibility.
Deny by default in the decision path: no matching policy, an ambiguous rule, or a malformed payload all fail closed. An unavailable policy service cannot quietly become permission to pay, and the wallet-impersonation fallback stays off unless an org explicitly opts in.
Verify against the organization's public key, authenticated independently: cr.verify({ publicKey }) re-derives the hashes and signatures of the records you receive against that key — e9d3619e…b6d1 for the public sandbox. A database rewritten and re-signed with a different key fails that check. Verification does not show that the chain is complete or that any payment happened.