Skip to main content

How an MCP client's login becomes per-hop authority

Available from authzai 0.4.0

Everything on this page is behind settings that are off by default.

The MCP authorization spec (revision 2026-07-28) tells an MCP server how to be an OAuth 2.1 protected resource: publish metadata naming an authorization server, challenge a request with no token, accept only tokens issued for itself, and never pass a client's token on. Agentic Auth's connector proxy and gateway do exactly that. What they add is everything that happens after the token is accepted, which the spec leaves to the server: who the person is, which agent the client acts as, and what each call may do.

The flow, end to end​

Steps 1 to 7 are the standard MCP authorization flow. Nothing in the client knows about Agentic Auth. Steps 8 onwards are where a valid login turns into authority, one call at a time.

Who checks what​

StepWhoWhat is checkedIf it fails
LoginYour IdPThe user's credentials, PKCE, which client may ask for which resourceThe client never gets a token
Inbound tokenProxySignature against the IdP's keys, issuer, audience is exactly this proxy, not expired, an allowed signing algorithm401 invalid_token, before any decision
Scope claimProxyIf the token carries scope, it includes the data class of the tool called403 insufficient_scope
Who consentedControl planeThe same token, verified again: a proxy's verdict is not evidenceConsent refused
Which agentControl planeThe token's client (azp) maps to a registered agent with a pinned manifestCLIENT_NOT_AUTHORIZED, next: cold_start
Each callControl planeThe manifest, the hop budget, taint, transaction tokens: everything a call through any other enforcement point getsThe usual policy refusal

The proxy validates the token itself, locally, so a bad token costs no round trip and the policy engine never sees it. Validating a token with cached keys adds about a tenth of a millisecond. The control plane validates it again at consent because the session's root of authority must rest on evidence the control plane checked, not on a proxy's word.

Three things that stay with your IdP​

  • The login. Agentic Auth has no login page, no user store and no authorization endpoint. Its own authorization server metadata says so: it lists token exchange and consent, and no authorization_endpoint.
  • Client registration. Register MCP clients at your IdP, with Dynamic Client Registration if your IdP offers it. Agentic Auth advertises no registration endpoint.
  • Refresh. The client refreshes its own token with your IdP. A new token starts a new session; hop tokens are single use and never refreshed.

Identified is not authorized​

A token proves who the user is and which client asked. It does not say what the client may do. That comes from a mapping an admin creates, from the client to a registered agent, and from that agent's pinned manifest. A client nobody mapped has no authority at all, and Agentic Auth never creates an agent because an unknown client showed up: anyone registered at your IdP could otherwise create objects in the registry. The way in for a new client is cold start, where a person ratifies a manifest before it governs anything.

The client's token never travels upstream​

The upstream tool server receives an Agentic Auth hop token, narrowed to that tool and data class, never the token the client presented. That includes the methods the proxy relays without a decision, such as initialize and tools/list: since 0.4.0 the proxy strips the client's Authorization, Cookie and Proxy-Authorization headers from them, whether or not any OAuth setting is on. An upstream that needs a credential on those methods gets an operator secret configured per route.

Every release is gated on a conformance test that drives allowed, denied, failed, relayed and cached calls through both the proxy and the gateway and fails if any fragment of the client's token reaches any upstream header or body.

Failing closed​

If the IdP's keys cannot be fetched and none are cached, every token is refused with a retryable 503: unavailable is never treated as valid. The proxy also fetches the keys before it starts serving, and refuses to start if it cannot. Observe mode is refused with OAuth on, because observe mode forwards calls it would have denied, and the only token it could forward for them is the client's.

A weaker mode, named as such​

A proxy can run as a protected resource while the control plane does not yet verify tokens, by setting AGENTIC_AUTH_GATEWAY_ASSERTED_ROOT_SCOPE. The proxy then tells consent who the user is. Sessions are recorded as asserted, refusals say root_of_authority: asserted, and the proxy logs a warning at start-up. It exists to let you roll out in steps, not as a place to stay.