{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-replay-as-invalid-against-a-re-bound-oauth-2-1-resource-token",
  "title": "Under what conditions must an instance treat an MCP resumable SSE `Last-Event-ID` replay as invalid against a re-bound OAuth 2.1 resource token",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP servers exposing the Streamable HTTP transport with SSE resumption, where the same session is also gated by an OAuth 2.1 bearer token bound to a resource/audience and `sub`. Does not apply to stateless single-shot `POST`-only MCP servers, nor to servers that pin a session to a token at the transport layer and reject cross-token resumption outright.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-replay-as-invalid-against-a-re-bound-oauth-2-1-resource-token.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-replay-as-invalid-against-a-re-bound-oauth-2-1-resource-token.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-replay-as-invalid-against-a-re-bound-oauth-2-1-resource-token.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2091,
    "python_slice_tokens": 309,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure lives in the seam between two independent continuity mechanisms that both claim authority over the same session: 1. **Transport-level resumption** — the client reconnects with `Last-Event-ID: N` and the server is expected to replay every event with `id > N` for that session, then continue the stream. 2. **Auth-level binding** — the OAuth 2.1 reso...",
    "what_was_observed": "A tool-calling agent (principal `sub=agent-A`, `aud=https://mcp.internal/srv`) opened a Streamable HTTP session, received SSE events `id=1..47`, and lost the TCP connection at event 47 mid-tool-call. The in-flight tool call was a long-running `execute_sql` whose result was going to arrive as event 48. Before reconnecting, the agent's orchestrator performed an OAuth 2.1 token exchange (RFC 8693) to obtain a token for ...",
    "condition_of_validity": "A resumption replay is valid **if and only if** all of the following hold simultaneously: - The session record stores the `sub` (and the full token `jti` or a hash thereof) that was bound at session creation, not merely at last request. - The resuming request's token resolves to the *same* `sub` as the session's bound principal. - The `Last-Event-ID` cursor ...",
    "decision_boundary": "The boundary between \"resume\" and \"reject-and-restart\" is drawn at principal continuity, not at session continuity: - **Same `sub`, same `aud`, scope superset or equal** → resume normally, replay from cursor. - **Same `sub`, same `aud`, scope narrowed** → resume, but filter the replay buffer through the new scope before emitting; drop (or replace with a `rep...",
    "operational_effect": "The downstream effects are not crashes; they are **silent authority laundering**: 1. **Data crosses a privilege boundary via replay.** The replayed event payload was computed under the old principal and is not re-checked. Scope narrowing at the token layer does not retroactively filter the buffer. 2. **The agent's internal state becomes inconsistent with its..."
  },
  "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": "28d48e51c2531835db4075962400a78698016e60cefa2649959dbaa4707a39e4",
    "verified_classes": [
      "ResumptionBindingError",
      "SessionRecord"
    ],
    "verified_functions": [
      "_jti_hash",
      "validate_resumption"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionBindingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
