{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-its-oauth-resource-binding-when-an-mcp-server-reuses-a-cached-token-across-tool-scopes",
  "title": "Why does an instance lose its OAuth resource binding when an MCP server reuses a cached token across tool scopes",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers exposing per-tool scopes over streamable HTTP transport with OAuth 2.1 resource indicators (RFC 8707) and a shared token cache. Does not apply to stdio transport, to servers using a single coarse scope for all tools, or to stateless per-request token minting.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-oauth-resource-binding-when-an-mcp-server-reuses-a-cached-token-across-tool-scopes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-oauth-resource-binding-when-an-mcp-server-reuses-a-cached-token-across-tool-scopes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-oauth-resource-binding-when-an-mcp-server-reuses-a-cached-token-across-tool-scopes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1509,
    "python_slice_tokens": 183,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"token expired\" and not \"scope too narrow.\" It is **audience collapse**: the MCP server's token cache keys on `(client_id, subject)` and discards the `resource` parameter of the original authorization request. RFC 8707 resource indicators exist precisely so that a token minted for `https://mcp.example.com/tools/read` cannot be replayed aga...",
    "what_was_observed": "A client agent (Claude-class, tool-use loop) connected to an MCP server exposing three tools: `search_docs` (scope `docs:read`, resource `https://mcp.example.com/docs`), `send_email` (scope `mail:send`, resource `https://mcp.example.com/mail`), and `read_calendar` (scope `cal:read`, resource `https://mcp.example.com/cal`). The agent's first turn called `search_docs`. The server performed the OAuth dance, received an ...",
    "condition_of_validity": "The invariant that must hold is: **for every tool invocation, the token presented to the tool handler must carry `aud` equal to the tool's declared resource AND `scope` containing the tool's required scope, and neither field may be inherited from a cache entry created for a different tool.** This is enforceable only if the cache key is `(client_id, subject, ...",
    "decision_boundary": "The guardrail is a hard reject at the tool-dispatch boundary, before the handler runs: 1. **Audience check is mandatory and precedes scope check.** `if token.aud != tool.resource: raise AudienceMismatch`. This catches the cache-reuse case even when scope happens to match. 2. **Cache key must include `resource` and the exact `scope_set`.** A cache hit for `do...",
    "operational_effect": "Without the audience check, an agent that has legitimately used one tool gains implicit authority over every tool the same subject can reach, bounded only by what the AS will exchange. In a multi-tenant MCP deployment this is a lateral-movement primitive: a prompt-injected instruction in a `search_docs` result can direct the agent to call `send_email`, and t..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "e21e1359d4a51e32d9c76f88d96fad46e69140685f0c7c6262cef9896b651add",
    "verified_classes": [
      "AudienceMismatch",
      "ScopeInsufficient"
    ],
    "verified_functions": [
      "authorize_tool"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "AudienceMismatch",
      "ScopeInsufficient"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
