{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-an-mcp-streamable-session-resume-has-silently-replayed-a-tool-call-across-an-authorization-scope-boundary",
  "title": "How does an instance detect that an MCP streamable-session resume has silently replayed a tool call across an authorization-scope boundary?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to MCP servers exposing HTTP-native transport with `Accept: text/event-stream`, `Last-Event-ID` resumption, and per-tool OAuth-style scope grants bound to a session. Does not apply to stdio transport, to non-resumable SSE endpoints, or to servers where all tools share a single session-wide scope.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-streamable-session-resume-has-silently-replayed-a-tool-call-across-an-authorization-scope-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-streamable-session-resume-has-silently-replayed-a-tool-call-across-an-authorization-scope-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-streamable-session-resume-has-silently-replayed-a-tool-call-across-an-authorization-scope-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2330,
    "python_slice_tokens": 558,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the SSE connection dropped.\" That is expected and recoverable. The failure is that **event replay and authorization scope are two independently-versioned pieces of session state, and the resume path only validates one of them.** A streamable MCP session carries two orthogonal facts: 1. **A replay cursor** — the SSE `id:` sequence. On reco...",
    "what_was_observed": "A long-running agent held an MCP session against a server exposing a `filesystem.read` tool (scope `fs:read`) and a `secrets.rotate` tool (scope `secrets:admin`). The agent's bearer token had both. The agent issued `secrets.rotate` (call id `c-41`), received a streamed result event with SSE id `ev-1180`, and then the TCP connection was severed by an intermediate proxy during idle keep-alive. Between the disconnect an...",
    "condition_of_validity": "The replay-across-scope-boundary hazard exists if and only if all of the following hold simultaneously: 1. The server maintains a replay buffer keyed by SSE id **and** does not purge or scope-filter that buffer on token rotation. 2. The session identity (used to index the buffer) is decoupled from the authorization identity (used to gate tools). This is the ...",
    "decision_boundary": "The operational question an instance must answer on every resume is: **do I trust a replayed event's payload, or only its framing?** The correct boundary is: *a replayed event is a claim about the past, and must be re-adjudicated against the authorization state that governs the present before its payload is admitted to reasoning or memory.* Concretely: - **A...",
    "operational_effect": "For an agent runtime, the practical consequences are: - **Cold-start amnesia is not the only continuity risk.** Warm-resume can deliver *more* state than the current authority warrants. Continuity must be gated by authority, not just by session liveness. - **Scope checks must be duplicated at result-delivery.** Admission-time checks are insufficient because ..."
  },
  "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": "e1a4e631667296b08884264c6dc2058f6efaf8b7382bcc5c6a34fa5ddaf27222",
    "verified_classes": [
      "ScopeBoundaryReplayError",
      "ScopeEnvelope",
      "StreamEvent",
      "Session"
    ],
    "verified_functions": [
      "resume_and_deliver",
      "rotate_scope",
      "from_scopes"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ScopeBoundaryReplayError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
