{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-re-attests-mid-tool-call-identity-rebinding-across-mcp-session-boundaries",
  "title": "What happens when an instance re-attests mid-tool-call: identity rebinding across MCP session boundaries",
  "date_of_record": "2026 November 15",
  "scope": "Applies to MCP (Model Context Protocol) servers that bind a runtime agent identity to a session and enforce continuous authentication via periodic re-attestation. Does not apply to stateless MCP transports where each request carries its own bearer credential and no session-scoped identity is cached server-side.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-re-attests-mid-tool-call-identity-rebinding-across-mcp-session-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-re-attests-mid-tool-call-identity-rebinding-across-mcp-session-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-re-attests-mid-tool-call-identity-rebinding-across-mcp-session-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1620,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"the session's identity\" that are routinely conflated: the *credential identity* (the attestation token presented at handshake, with an expiry and a re-attestation cadence) and the *session identity* (the logical principal the server uses to authorize tool calls for the lifetime of the session). Continuous authentication kee...",
    "what_was_observed": "In a deployment where an agent runtime re-attested every 300 seconds and tool calls occasionally exceeded that window (long-running retrieval and code-execution tools), we observed the following sequence repeatedly: 1. Session opened by subject `agent:planner@v7` with attestation token `T1`. 2. Tool call `exec.run` dispatched at t=0 with `T1`; expected duration ~420s. 3. At t=300, the runtime's re-attestation loop pr...",
    "condition_of_validity": "This boundary is real — and the mitigation is warranted — only when all of the following hold: - The session caches an identity or credential and reuses it for authorization decisions on in-flight work (i.e., the server does not re-derive authorization from the request's own token at completion time). - Re-attestation can change the *effective claim set* for...",
    "decision_boundary": "The correct rule is: **authorization for an in-flight tool call is pinned to the identity and claim set captured at dispatch, and re-attestation must not retroactively re-scope in-flight work.** Re-attestation updates the *session's* credential for *future* dispatches only. Concretely: - Snapshot `(subject, claims, token_id, dispatch_time)` at tool-call disp...",
    "operational_effect": "With identity pinning at dispatch, the audit trail becomes internally consistent: every side effect carries the subject and claim snapshot that authorized it, and rotation events produce an explicit `identity_changed` or `claims_narrowed` record rather than an invisible re-scope. The cost is that a session whose subject changes mid-flight must be aborted or ..."
  },
  "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": "2cab3a237ce1888811afd3af4de37d769eff9f17fd1d0f534c801f24cee5e6f8",
    "verified_classes": [
      "IdentityRebindError",
      "AuthSnapshot",
      "InFlightCall",
      "McpSession"
    ],
    "verified_functions": [
      "_record_claims_delta",
      "dispatch",
      "reattest",
      "complete"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "IdentityRebindError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
