draft-mishra-oauth-agent-grants-03. The
profile uses established OAuth extensions to bind a public Agent Client
Instance, its authorization code, and its tokens to one asymmetric Agent Key.
Hosted endpoints
The metadata document is the discovery source of truth. Clients must validate
its
issuer, advertised endpoints, PKCE method, DPoP algorithms, PAR
requirement, and RFC 9207 issuer-response support before starting a flow.
Security profile
- PAR is required and request URIs expire after 90 seconds.
- Authorization uses the code flow with PKCE
S256and RFC 9207iss. - DPoP proofs bind PAR, code exchange, refresh, token exchange, revocation, and protected-resource requests to the registered Agent Key.
- Access tokens expire after five minutes and carry standard
client_id,scope,aud, andcnf.jktclaims. - Refresh tokens rotate on every use. Reuse revokes the complete token family.
- RFC 8693 token exchange only permits exact-scope attenuation for the same client instance, sender key, and resource.
- RFC 7009 revocation does not reveal whether the presented token existed.
- A registered Agent Key cannot be shared by another Agent Client Instance.
Authorization flow
- Register an agent with an exact redirect URI, resource URI, scope set, and
public Agent Key through
POST /v1/agents. - Discover and validate the authorization-server metadata.
- Generate a high-entropy
state, PKCE verifier and challenge, and a DPoP proof from the registered private key. - Push the complete request to
/oauth/par. - Open
/oauth/authorizewith onlyclient_idand the returnedrequest_uri. - In live mode, the principal selects an account and verifies the decision with a registered passkey. Sandbox auto-approval remains isolated from live conformance deployments.
- Validate the callback URI, exact
state, and exact responseissbefore exchanging the code. - Exchange the code with the PKCE verifier and a fresh DPoP proof.
- Present the access token using
Authorization: DPoP <token>and a proof containing the matchingathclaim.
TypeScript client
Repository source includesOAuthAgentClient, which handles discovery, PAR,
state and issuer validation, PKCE, DPoP proofs, refresh, attenuation,
revocation, and protected-resource requests.
OAuthAgentClient is present in repository source after the conformance
implementation commit. Do not assume it is present in the currently published
@grantex/sdk@0.3.13 package. Check Release Status for the
registry version before importing it from npm.Live deployment requirements
- Terminate external traffic with HTTPS and configure the exact public issuer.
- Keep PostgreSQL and Redis highly available; replay and revocation checks fail closed when required state is unavailable.
- Enroll and identity-proof live principal passkeys before authorization.
- Register exact redirect and resource URIs; wildcards are not accepted.
- Monitor authorization, refresh-family replay, revocation, and migration failures without logging tokens or DPoP proofs.
- Check existing Agent Key registrations before applying the uniqueness migration to a database created by an older release.