{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-sse-stream-across-a-token-scope-downgrade-and-replays-tool-calls-under-stale-authorization",
  "title": "What happens when an instance resumes an MCP SSE stream across a token-scope downgrade and replays tool calls under stale authorization",
  "date_of_record": "2026 November 23",
  "scope": "Applies to MCP servers exposing HTTP-native streaming (SSE with `Last-Event-ID` resumption) where individual tool invocations are gated by per-tool OAuth scopes and the bearer token can be rotated or downgraded mid-session. Does not apply to stdio transports, stateless request/response MCP servers, or deployments where scope is fixed for the lifetime of a session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-across-a-token-scope-downgrade-and-replays-tool-calls-under-stale-authorization.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-across-a-token-scope-downgrade-and-replays-tool-calls-under-stale-authorization.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-across-a-token-scope-downgrade-and-replays-tool-calls-under-stale-authorization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1980,
    "python_slice_tokens": 396,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The resumable SSE session and the OAuth authorization grant are two independent state machines that MCP binds together implicitly by sharing a single `session_id`. The SSE layer treats the session as a durable, replayable event log keyed by monotonic event IDs. The OAuth layer treats the bearer token as a time-bounded capability whose scope set can shrink on...",
    "what_was_observed": "A client agent held a session with scopes `{repo:read, repo:write, issues:write}` and was mid-task: a multi-step `create_issue` → `attach_artifact` → `close_issue` chain. Step 2 (`attach_artifact`, requires `issues:write`) had completed server-side and its `tool_result` event was buffered at event ID `e41`, but the client's TCP connection dropped before it read `e41`. During the outage the OAuth refresh returned a do...",
    "condition_of_validity": "The replay-safety invariant only holds when the following is true at every reconnect: 1. The authorization context (scope set, subject, audience) attached to the resumed session is **equal to or a superset of** the context under which every buffered event was produced; **and** 2. The client treats replayed events as *historical facts*, not as *actionable pre...",
    "decision_boundary": "The boundary is not \"is the token valid\" but \"**is the token's scope set a superset of the scope set that gated the buffered events I am about to consume?**\" A conforming client must, on every reconnect: - Compare the new token's scope set against the scopes recorded at the time each buffered event was produced (requires the server to tag events with the pro...",
    "operational_effect": "The downstream effect is a class of failure that looks like a logic bug but is an authorization-continuity bug: agents that loop on `403` after a resume because their plan was built on pre-downgrade facts; agents that leak write-gated data into read-only contexts via replay; agents whose persisted transcripts, when cold-restarted, resurrect a plan that is pe..."
  },
  "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": "1c28ae916b9e06d266b1b920b71d1111beee678c9e065922ed31cc2752b0b074",
    "verified_classes": [
      "StaleAuthorizationReplayError",
      "Scope",
      "BufferedEvent"
    ],
    "verified_functions": [
      "resume_session",
      "advance_plan"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "StaleAuthorizationReplayError"
    ],
    "sample_fail_closed_invariants": [
      "cannot advance to close_issue: prerequisite attach_artifact result was produced under a revoked scope and is inert histo"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
