- receipt
- loading…
- tool
- loading…
- charged
- loading…
- key
- loading…
Values are read from the published artifact, not typed into this page.
For platform engineering, AI infrastructure, and security teams running MCP tools
An agent issues a customer refund through an internal MCP tool. The call times out, the agent retries, and without a boundary the refund runs twice. Someone pays in lost money, recovery time, or a customer problem. Put a number on that cost. If preventing it cannot justify this boundary, we will tell you.
Write to 1@christophersellers.com with your tool scenario. Replies are written; a call happens only when a scenario needs one.
Paid, bounded pilot · one internal MCP tool · priced after fit is established · no self-serve rollout
POST /v1/permits
X-API-Key: $OPERATOR_API_KEY
Idempotency-Key: demo-permit-1
One tool, one agent identity, a budget, an expiry, signed by the operator's key. The agent cannot mint this for itself.
POST /mcp/messages
X-API-Key: $AGENT_API_KEY
The gateway dispatches, debits the scoped budget, and returns a signed receipt that names the permit and the ledger entry.
POST /mcp/messages
X-API-Key: $AGENT_API_KEY
Same receipt id, no second dispatch, no second debit. A timed-out client can retry without fear.
b2a-verify-receipt --bundle receipt.json --keys trust-keys.json
VERIFIED rcpt-038c84a3d94d4a34
signed by demo-ed25519
permit permit-74d8473ec86c4b42
tool trust-plane-echo
outcome success
credits 2 charged of 2 authorized
at 2026-09-08T07:33:18.252834+00:00
The SDK verifier checks the Ed25519 signature against the published key set. It never imports the gateway.
Recorded from a local gateway run, not the live API. Every line is a real request or a real response. Read the full recording.
Agent Middleware API is a transaction boundary between your autonomous agents and your consequential MCP (Model Context Protocol) tools. The first call executes and is charged once; a retry carrying the same idempotency key cannot dispatch again or debit again. Every completed call returns a signed receipt you can verify offline.
The wedge today is metered calls. The underlying primitive is bounded authority for machine actions.
A credit is a closed-loop metering unit for the pilot on an operator-provisioned wallet, not payment rails. The gateway reserves the tool's registered credit price against the permit before anything runs, and writes at most one ledger debit per accepted idempotency key. A denied call is never charged. A call the gateway can prove never reached the tool is refunded. But once it has committed to sending on the configured upstream path, it can no longer prove the tool did not run: a timeout or a crash from that point stays charged, and is never retried for you — refunding an ambiguous call automatically would pay a caller to induce timeouts against a tool that had already done the work. Turning credits into invoices, settlement, or payment rails is out of scope by design, and the pilot is priced separately, in writing.
00 / Operational problem
An agent can be correct and still exceed its mandate, retry an expensive call, or leave an operator unable to prove what ran. The gateway holds the authority at the resource boundary, so the agent's intent is checked against what it is actually allowed to do — before the tool runs.
The result is inspectable before, during, and after execution without asking you to replace your agent framework.
Built for agents. Controlled by operators. For the teams responsible for both.
Agent identity, tool, scope, budget, and expiry.
The same accepted request key cannot become a second debit.
A signed receipt links the governed call to auditable evidence.
01 / Governed path
Discover, authenticate, authorize, invoke, meter, receipt, audit,
govern. Here is the loop as the gateway actually ran it, shown in
loop order: every request, every response, and the verifier's
verdict, recorded from make prove-trust-plane and
reproducible from a clone. The tool in the recording is a stand-in
echo tool, not a refund tool; the permit, debit, receipt, and
replay steps are the same for any governed action, and a
configured upstream tool additionally gets a dispatch-claim record.
01 · Discover
GET /mcp/tools.json
X-API-Key: $AGENT_API_KEY
Which tools exist and what each call costs. Discovery is public; nothing here can be invoked yet.
02 · Authenticate → 03 · Authorize
POST /v1/permits
X-API-Key: $OPERATOR_API_KEY
Idempotency-Key: demo-permit-1
One tool, one agent identity, a budget, an expiry, signed by the operator's key. The agent cannot mint this for itself.
04 · Invoke → 05 · Meter → 06 · Receipt
POST /mcp/messages
X-API-Key: $AGENT_API_KEY
The gateway dispatches, debits the scoped budget, and returns a signed receipt that names the permit and the ledger entry.
05 · Meter, again
POST /mcp/messages
X-API-Key: $AGENT_API_KEY
Same receipt id, no second dispatch, no second debit. A timed-out client can retry without fear.
06 · Receipt, offline
b2a-verify-receipt --bundle receipt.json --keys trust-keys.json
VERIFIED rcpt-038c84a3d94d4a34
signed by demo-ed25519
permit permit-74d8473ec86c4b42
tool trust-plane-echo
outcome success
credits 2 charged of 2 authorized
at 2026-09-08T07:33:18.252834+00:00
The SDK verifier checks the Ed25519 signature against the published key set. It never imports the gateway.
07 · Audit
POST /v1/audit/verify-chain
X-API-Key: $AGENT_API_KEY
Every event is hash-chained to the one before it. Edit a stored row and the chain breaks, which the demo also proves.
08 · Govern
POST /mcp/messages
X-API-Key: $AGENT_API_KEY
The permit named one tool. Asking for another is denied before dispatch, receipted as a denial, and never charged.
Gateway time per governed call in this run: p50 67.3 ms, p95 83.7 ms over 100 fresh calls (in-process ASGI client, local SQLite, no network). Recorded on one machine, on the local governed-tool path with a stand-in echo tool and no upstream dispatch: a reference point, not a production number. The pilot records yours.
Recorded from a local gateway run, not the live API. Every line is a real request or a real response. Read the full recording.
02 / Portable evidence
This is a self-issued gateway receipt, published as a historical
sample: it was issued on
from a non-sensitive partner.echo call, and it is not
customer traction. The bundle is paired with the exact public-key
snapshot the offline verifier used. Verifying it proves that
signature against that key; it is not a test of the deployment
running today.
Values are read from the published artifact, not typed into this page.
b2a-verify-receipt --bundle receipt.json --keys trust-keys.json \
--expect-issuer https://api.thisisatest.techVERIFIED rcpt-9daf745e477d45ab
signed by railway-prod-ed25519
permit permit-c73a0b621c244831
tool partner.echo
outcome success
credits 1 charged of 1 authorized
at 2026-08-11T21:17:28.064620+00:00The SDK verifier checks the Ed25519 signature with no API credential and no callback to the issuer. Authenticate the key snapshot through a trusted channel before treating issuer identity as independently established. Download the artifacts and run it yourself.
03 / Design-partner pilot
Bring one internal MCP tool, such as a refund tool, a deploy trigger, or a payout call, with a real operator, permission boundary, and retry or audit concern. Send the scenario by email. You get a written answer on whether the boundary fits, and if it does, we define the one action and walk it through permit → invoke → charge → receipt → replay → deny before discussing any broader rollout.
The pilot is paid, bounded to one tool, and priced after fit is established. We agree a setup fee and a separate recurring managed-service quote, with infrastructure and support scope stated in writing before work starts.
Use synthetic or redacted examples only. Never send production secrets, credentials, or customer data.
One tool · one operator · one action. Email first; a call is
available only when a scenario needs one. The source repository is
public; run make prove-trust-plane from a clone to
assert the whole loop locally. No API credentials, no signup.
Take the refund example: each duplicate is one refund paid twice plus the hours spent clawing it back. Monthly actions × baseline duplicate rate × loss per duplicate × expected reduction = estimated monthly avoided loss. Use the loss you actually bear, including recovery labor, rather than the full transaction value. Count each cost once.
Expected reduction is an assumption about your whole adopted workflow, including the upstream tool, to validate in a pilot. It is not a gateway guarantee. These numbers stay in your browser and are not saved or sent to us.
Enter the four workflow assumptions to estimate avoided loss.
Include these assumptions in your pilot email
Compare simpler reliability options
100,000 actions/month × 0.1% duplicates × $50 actual loss × 80% reduction = $4,000/month in estimated avoided loss. With $2,800 in total monthly cost, the break-even loss is $35 per duplicate: $2,800 ÷ (100,000 × 0.001 × 0.8). At 0.01% duplication, the threshold rises to $350. These are illustrative assumptions, not our pricing or measured results.
04 / Machine discovery
Machine-readable discovery — what an agent fetches before it ever calls a tool. Discovery is public. Protected actions still require an operator-issued API key and an applicable scoped permit.
GET /.well-known/agent.json
Agent instructions
GET /llms.txt
MCP discovery GET /mcp/tools.json
Live dependency status
GET /health/dependencies
Four unauthenticated GETs against the API origin; each opens the raw JSON in a new tab. Protected routes answer these same requests with 401 until an operator-issued key is presented.
05 / Honest limitations
06 / Who is behind this
Agent Middleware API is built and run by Christopher Sellers. The source repository is public; the product boundary and security limitations are also published from the API origin below.
Email one governed action on a tool you already run. You get a written answer on fit, and if it fits, a receipt you can verify without us. A call is available only when a scenario needs one.