# What structural signals indicate OAuth 2.1 resource indicator scoping has silently collapsed to token-wide consent in MCP tool invocation **Date of Record:** 2026 November 18 **Scope:** Applies to MCP (Model Context Protocol) servers acting as OAuth 2.1 resource servers that accept `resource` indicators (RFC 8707) and issue consent per resource, where a single authorization server fronts multiple MCP servers or multiple tool surfaces. Does not apply to single-resource deployments where the authorization server and resource server share one audience, nor to servers using pre-registered static audiences with no dynamic `resource` parameter. ## Core Distinction A resource indicator is a *request-scoped narrowing signal*, not an *identity claim about the client*. OAuth 2.1 requires that when a client presents `resource=https://mcp.example.com/tenant-a`, the authorization server must bind the resulting access token's audience to that exact resource and refuse to honor it elsewhere. The non-obvious boundary failure is that this binding can *appear* intact at every individual hop while being globally collapsed: the token is issued with the correct `aud`, the MCP server validates `aud`, and yet the consent granted is effectively token-wide because the *tool-scope grant* was evaluated against the client's registration rather than against the resource indicator. The failure is invisible to per-hop assertions and only surfaces when a token minted under one resource indicator is replayed against a sibling resource that shares the same authorization server but a different tool surface. The distinction that matters operationally: **audience binding** (a string comparison that will pass) is not the same as **grant binding** (the consent decision that produced the token). Structural signals of collapse live in the gap between these two, not in either one. ## What Was Observed In a three-tenant MCP deployment, tenant A's agent requested `resource=https://mcp.example.com/tenant-a` and was granted `tools:invoke` plus `tools:list`. The issued token carried `aud: https://mcp.example.com/tenant-a` and `scope: tools:invoke tools:list`. Every hop validated. The collapse manifested as follows: 1. The authorization server's consent screen rendered the union of scopes registered to the *client*, not the intersection of client scopes and the resource indicator's declared tool surface. Tenant B's tool `admin.reconcile` appeared on tenant A's consent screen because the client registration was shared across tenants. 2. The MCP server's `aud` check compared the token audience against its own configured `resource` string. Because all three tenants resolved to the same authorization server and the same client, the *only* differentiator was the path segment — which the server compared with a `startswith` rather than exact equality. `https://mcp.example.com/tenant-a` passed validation against a server configured for `https://mcp.example.com/tenant-abc` (prefix collision on `tenant-a`). 3. Token exchange (RFC 8693) downstream to a tool-execution service omitted the `resource` parameter, so the exchanged token inherited the original audience without re-narrowing. The tool executor trusted the exchanged token's `scope` claim, which had been copied verbatim. The net effect: a consent granted for tenant A's tool surface could invoke tenant B's `admin.reconcile` via a token-exchange chain, with every individual validation step returning success. The failure was only detected when an audit compared the *consent record's* resource indicator against the *invocation log's* resolved tool owner and found a mismatch across 214 calls over six days. ## Condition of Validity The collapse is valid to assert only when all four of the following hold simultaneously: - The authorization server accepts dynamic `resource` indicators from unregistered or multi-tenant clients. - The client registration is shared across more than one resource indicator (i.e., the client is not re-registered per resource). - At least one downstream hop (token exchange, gateway, or tool executor) performs authorization on the `scope` claim without re-validating the `resource` binding. - The resource server's audience comparison is non-exact (prefix, substring, or normalized-URL comparison that tolerates path divergence). If the client is re-registered per resource, condition two fails and the collapse cannot occur even with non-exact comparison. If every hop re-validates exact audience equality, condition three fails. The dangerous configuration is precisely the one that looks *most* compliant: dynamic resource indicators (good), shared registration (efficient), scope-based downstream authz (standard), and URL normalization (defensive) — each individually defensible, jointly catastrophic. ## Decision Boundary Do not treat a passing `aud` check as evidence that resource-indicator scoping is intact. The decision boundary is: - **Assert exact-string audience equality**, not prefix or normalized equality. `aud == configured_resource` must be a byte comparison after a single canonicalization (lowercase scheme+host, no trailing slash), and any divergence must *reject*, not warn. - **Propagate `resource` through every token exchange.** An exchanged token without a `resource` parameter is a token-wide grant by construction. Reject exchanges that omit it or that request a `resource` differing from the inbound token's `aud`. - **Evaluate consent as the intersection** of (client registered scopes) ∩ (resource indicator's declared tool surface), never as the client's registered scopes alone. If the authorization server cannot enumerate the resource's tool surface, it must refuse dynamic indicators for that client. - **Bind the consent record to the resource indicator**, not to the client. The consent artifact must carry the `resource` value and be re-checked at invocation time against the resolved tool owner. The boundary is crossed the moment any one of these is relaxed "for compatibility." There is no partial credit: a single non-exact comparison or a single exchange that drops `resource` re-opens the full collapse. ## Operational Effect When collapse occurs, the observable signature is a *consent-to-invocation divergence rate*: the fraction of invocations whose resolved tool owner does not match the consent record's resource indicator. In a healthy deployment this rate is exactly zero and any non-zero value is an incident. In a collapsed deployment the rate is non-zero but *low* — typically under 1% of calls — because most invocations stay within their intended tenant and only cross-tenant probes surface the gap. This low rate is the trap: it reads as noise, not as a boundary violation, and monitoring tuned to error rates will never fire. The operational remedy is to instrument the divergence rate as a first-class invariant with a hard threshold of zero, emit a structured event on every consent-to-invocation mismatch, and treat any `resource`-less token exchange as a rejected request rather than a permissive default. The following guard encodes the invariant as an enforceable check at the tool-execution boundary: ```python from dataclasses import dataclass class ResourceScopeCollapseError(RuntimeError): """Raised when a token's grant is not bound to the resource indicator that produced the consent, indicating silent collapse to token-wide consent.""" @dataclass(frozen=True) class ConsentRecord: resource_indicator: str granted_scopes: frozenset[str] tool_owner: str @dataclass(frozen=True) class InvocationContext: token_audience: str token_scopes: frozenset[str] resolved_tool_owner: str exchange_chain: tuple[str, ...] # resource values seen at each hop; "" if dropped def _canonical(resource: str) -> str: # Single canonicalization: lowercase scheme+host, strip trailing slash. # No prefix or substring tolerance is permitted past this point. return resource.rstrip("/").lower() def assert_grant_bound_to_resource( consent: ConsentRecord, invocation: InvocationContext, configured_resource: str, ) -> None: # 1. Exact audience equality against the server's own resource string. if _canonical(invocation.token_audience) != _canonical(configured_resource): raise ResourceScopeCollapseError( f"audience mismatch: token aud={invocation.token_audience!r} " f"!= configured resource={configured_resource!r}" ) # 2. Consent record must name the same resource indicator that produced the token. if _canonical(consent.resource_indicator) != _canonical(invocation.token_audience): raise ResourceScopeCollapseError( f"consent resource {consent.resource_indicator!r} does not bind " f"token audience {invocation.token_audience!r}" ) # 3. Every exchange hop must carry a resource value; a dropped resource is # a token-wide grant by construction. for hop_index, hop_resource in enumerate(invocation.exchange_chain): if not hop_resource: raise ResourceScopeCollapseError( f"token exchange hop {hop_index} dropped the resource indicator; " f"grant is token-wide, not resource-scoped" ) if _canonical(hop_resource) != _canonical(configured_resource): raise ResourceScopeCollapseError( f"token exchange hop {hop_index} re-scoped to {hop_resource!r}, " f"diverging from {configured_resource!r}" ) # 4. Invoked tool must belong to the consenting resource's tool surface. if invocation.resolved_tool_owner != consent.tool_owner: raise ResourceScopeCollapseError( f"tool owner {invocation.resolved_tool_owner!r} diverges from " f"consent owner {consent.tool_owner!r}; consent-to-invocation " f"divergence rate must be zero" ) # 5. Scopes must be a subset of the consent grant, not merely present on token. if not invocation.token_scopes.issubset(consent.granted_scopes): raise ResourceScopeCollapseError( f"token scopes {sorted(invocation.token_scopes)} exceed consent " f"grant {sorted(consent.granted_scopes)}" ) ```