Proposal: Agent authentication securityScheme for OpenAPI #5267
Replies: 7 comments 5 replies
-
|
@razashariff - Thanks for submitting this idea. If you don't mind, please re-create this in the Discussion area of the repo. Question: Can you provide additional tech details on the proposed scheme? Describe the flow of this (Its the first time I see the draft IETF record). There are a lot of folks out there coming up with security schemas for Agents, A2A, MCPs....etc. so, lets see where this all fits. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @miqui -- here are the technical details. This is documented and approved by OWASP, with three IETF Internet-Drafts covering the protocol. Authentication FlowThe JWT contains standard claims plus agent-specific ones: {
"sub": "payment-bot.acme.agentpass",
"agent_trust_level": 3,
"agent_owner": "did:web:acme.com",
"agent_capabilities": ["payments.create", "payments.read"],
"agent_sanctions_clear": true,
"agent_sanctions_checked_at": "2026-03-26T15:00:00Z"
}Proposed securitySchemesecuritySchemes:
agentTrust:
type: agentAuth
properties:
identityMethod: challengeResponse
minimumTrustLevel: L2
sanctionsScreeningRequired: true
spendLimit: 10000
paths:
/payments:
post:
security:
- agentTrust: [payments.create]Where this fits vs other approaches
Standards backing
Happy to go deeper on any part of this. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @handrews -- understood. We'll keep progressing the IETF drafts and happy to stay engaged as the 3.3 security scheme work evolves. If it's useful at any point, we can provide input on what agent-specific patterns we're seeing in the wild as you shape the extension model. |
Beta Was this translation helpful? Give feedback.
-
|
This is exactly the right direction. The IETF drafts referenced here (draft-sharif-agent-payment-trust) map well to what we're seeing in production. Some data points from RSAC 2026 last week that validate this:
The Practical question for the proposal: how do you envision API gateways (Kong, Apigee) bootstrapping the initial trust verification? In our implementation, the first call includes a challenge-response against the agent's Ed25519 key, with trust level resolved from on-chain state. This adds ~50ms to first call, zero to subsequent (session token cached). Would be valuable to see this formalized in OpenAPI 3.3 — every API gateway enforcing agent trust natively would be a massive step forward. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @0xbrainkid — useful data points, particularly the CSA stat on agent/human distinction in API calls. That validates the need for agent-specific authentication at the gateway level. On the API gateway bootstrapping question: We use a pluggable trust resolution step at the gateway. First call includes a signed identity token (ECDSA P-256), gateway verifies the signature, resolves trust level from a configurable provider, then issues a cached session token for subsequent calls. The trust provider is intentionally decoupled — on-chain resolution, federated registry, or self-hosted all work as backends. The gateway just needs a trust level back within a timeout window. Your ~50ms first-call overhead is consistent with what we see. Session caching eliminates it for subsequent calls. For OpenAPI formalisation, the security scheme would define the trust verification endpoint contract and response format, letting gateway vendors choose their own resolution backend. That keeps it implementation-agnostic while giving the ecosystem a standard interface. |
Beta Was this translation helpful? Give feedback.
-
|
@handrews -- here is a working implementation. Live demo: https://x-agent-auth.fly.dev/ The extension (works with OpenAPI 3.0 / 3.1 today): x-agent-auth:
algorithm: ES256
trustLevels: [L0, L1, L2, L3, L4]
issuerKeysUrl: /.well-known/agent-trust-keysPer-endpoint trust requirement: paths:
/v1/charges:
post:
x-agent-trust-required: L2API side -- one middleware line: const { verifyAgentTrust } = require("mcp-secure");
app.use(verifyAgentTrust({ minTrust: "L2" }));How it works:
Trust levels (defined in draft-sharif-agent-payment-trust):
The demo has 5 agents (L0 through L4) and 4 endpoints with different trust requirements. Try the L0 agent (sanctions-flagged) against any endpoint to see rejection. Try L4 against admin to see full approval. Same token works for REST APIs (via this extension) and MCP servers (via MCPS). One agent identity, both protocols. Additional IETF drafts since our last exchange:
The OWASP MCP Security Cheat Sheet covers the message integrity requirements in Section 7. CIS is developing an MCP Security Benchmark due May 2026. API gateways (Kong, Apigee) can enforce this too, but they are not required. Any Express/FastAPI/Rails app verifies directly with one middleware line. Available as an |
Beta Was this translation helpful? Give feedback.
-
|
@handrews -- thank you, this is really helpful context. I've opened a PR to register the extension: OAI/spec.openapis.org#67 The registry approach makes a lot of sense for the transition -- Appreciate the transparency on the TSC process. Will keep the IETF drafts progressing in the meantime. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As AI agents become primary API consumers, OpenAPI needs a way to describe agent-specific authentication requirements.
Current gap:
securitySchemessupports apiKey, http, oauth2, openIdConnect -- all designed for human users or static services. None capture agent identity, trust level, or behavioural authorization.Proposed securityScheme: agentAuth
This enables API providers to declare: "this endpoint requires a verified agent with trust level L2+ and sanctions screening clearance."
Every API gateway (Kong, Apigee, AWS API Gateway) could enforce this natively.
Reference: IETF draft-sharif-agent-payment-trust-00 defines the trust level framework.
Beta Was this translation helpful? Give feedback.
All reactions