What is Agent Middleware?
Agent Middleware is a gateway for developers building AI agents that call consequential tools such as refunds, payouts, or deployments. It places a permit and request-key check in front of an upstream tool call, then records the gateway decision and outcome in a signed receipt. The project is pre-release, with no production deployments, and offers a hosted demo and a gateway that can be run locally.
Agent Middleware Features:
Signed Permits: A permit grants an agent access to specified tools, sets a spending budget, and includes an expiry.
Request-Key Retries: A retry using the same request key returns the linked receipt rather than dispatching the action again.
Dispatch Controls: For an accepted key, the gateway allows at most one upstream dispatch and one debit.
Signed Receipts: Each finalized or reconciled path has a receipt recording the gateway decision and outcome, with hashes of the request and response.
Offline Verification: Receipt signatures can be checked offline with the project's verification code.
Key Conflict Checks: Reusing a request key with a different request fails with a conflict before the gateway dispatches it.
Uncertain Delivery: When the gateway cannot confirm an upstream result, it records delivery_uncertain and does not automatically resend the action.
Agent Middleware Benefits:
Fewer Duplicate Actions: Retry handling can reduce the risk of repeating a consequential action or incurring a second debit after a lost response.
Clearer Permissions: Tool, budget, and expiry limits give teams a defined boundary for what an agent is allowed to attempt.
Reviewable Evidence: Signed receipts and offline checks give teams a way to inspect gateway records without relying on the live service.
Safer Failure Handling: An uncertain result is surfaced for reconciliation, helping operators avoid an automatic repeat when the downstream outcome is unknown.
Easier Evaluation: The hosted demo and local gateway let teams test the permit, retry, and receipt flow before considering a design-partner pilot.
Use Cases:
Agent Refunds: Put a gateway in front of an agent's refund tool so calls require a permit and retries can be recognized by request key.
Payout Workflows: Evaluate how an agent's payout calls are limited by a permitted tool list, budget, and expiry.
Deployment Actions: Add a request-key and receipt trail when an agent triggers a deployment through a configured upstream tool.
Retry Testing: Use the reference echo example to exercise a first call, a retry with the same key, and an offline receipt check.
Delivery Reconciliation: Investigate an uncertain result by checking the downstream tool directly before deciding whether another action is needed.

