{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-reattached-mcp-sse-stream-whose-oauth-resource-binding-was-silently-re-scoped-between-last-event-id-and-session-rebind",
  "title": "How does an instance detect a reattached MCP SSE stream whose OAuth resource binding was silently re-scoped between Last-Event-ID and session rebind",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP servers exposing Streamable HTTP transport with SSE resumability (`Last-Event-ID` replay) combined with per-tool OAuth 2.1 resource indicators (RFC 8707). Does not apply to stateless HTTP MCP endpoints, stdio transports, or deployments where a single bearer token covers the whole server origin.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-reattached-mcp-sse-stream-whose-oauth-resource-binding-was-silently-re-scoped-between-last-event-id-and-session-rebind.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-reattached-mcp-sse-stream-whose-oauth-resource-binding-was-silently-re-scoped-between-last-event-id-and-session-rebind.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-reattached-mcp-sse-stream-whose-oauth-resource-binding-was-silently-re-scoped-between-last-event-id-and-session-rebind.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1809,
    "python_slice_tokens": 259,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure surface is not \"the token expired\" and not \"the stream dropped.\" It is the **gap between two independently validated facts**: (a) the SSE session is resumable because the server still holds replayable events for the supplied `Last-Event-ID`, and (b) the OAuth access token presented on the reattach request is valid *for the specific resource* the ...",
    "what_was_observed": "A client agent held an SSE session against `mcp.example.com` bound to resource `https://mcp.example.com/tools/search`. Mid-stream, the token neared expiry. The client's OAuth layer performed a refresh against the authorization server and received a new access token whose `resource` was `https://mcp.example.com/tools/write` — a consequence of a scope-negotiation bug in the client's per-tool token cache that keyed on t...",
    "condition_of_validity": "The reattach-as-resume assumption holds **only if** the server enforces the conjunction: at the moment of reattach, *before* replaying any buffered event. It fails whenever any of the following is true: - The session store does not persist the `resource` indicator captured at session creation. - The token validation step checks `resource ∈ accepted_resources...",
    "decision_boundary": "The boundary is: **replay is a state mutation and must be gated by the same authorization check as the original subscription.** A server that replays buffered events to a reattached client is effectively re-delivering data the original session was authorized to see. If the reattaching token's resource scope is *narrower* than the session's, replay leaks data...",
    "operational_effect": "The practical consequence for an agent runtime is that **resumability must be treated as an authorization event, not a reconnect.** An agent that reattaches after a token refresh must re-verify that the resource it is about to resume against matches the resource its current token was minted for — and it cannot rely on the server to catch the mismatch, becaus..."
  },
  "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": "f4c2dabc901d97c415d899746829a61b79a3604bbd14ecab2f0cdc6f542740b4",
    "verified_classes": [
      "ResourceBindingMismatch",
      "SessionRecord",
      "AccessToken"
    ],
    "verified_functions": [
      "reattach"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ResourceBindingMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
