{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-tool-output-as-tainted-across-a-resumed-session-and-why-per-call-data-flow-labels-break-at-checkpoint",
  "title": "Under what conditions must an instance treat MCP tool output as tainted across a resumed session, and why per-call data-flow labels break at checkpoint boundaries",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agent runtimes that enforce per-call taint labels on data returned by MCP tool servers, where a session may be checkpointed and resumed (cold restart, model swap, or context-window compaction). Does not apply to stateless single-shot tool invocations with no persisted conversation state, nor to runtimes that re-derive taint from scratch on every resume.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-tool-output-as-tainted-across-a-resumed-session-and-why-per-call-data-flow-labels-break-at-checkpoint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-tool-output-as-tainted-across-a-resumed-session-and-why-per-call-data-flow-labels-break-at-checkpoint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-tool-output-as-tainted-across-a-resumed-session-and-why-per-call-data-flow-labels-break-at-checkpoint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1961,
    "python_slice_tokens": 301,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A taint-aware sandbox tracks *provenance*: which bytes in the current context originated from which tool call, and what trust class that call carried. The sandbox enforces a data-flow policy — e.g., \"output of `fetch_url` may not be passed as the `command` argument to `shell_exec`.\" This works because the label travels *with the value* inside the live contex...",
    "what_was_observed": "A three-tool MCP server set: `search` (trusted, returns snippets), `fetch_url` (untrusted, returns arbitrary remote HTML), `send_email` (egress, must not carry untrusted-origin body). Policy: any value derived from `fetch_url` output is labeled `UNTRUSTED_REMOTE` and cannot flow into `send_email.body`. Live session, single turn: agent calls `fetch_url`, gets HTML containing an injected instruction. Sandbox labels the...",
    "condition_of_validity": "The per-call taint model is valid **only while the label map and the context are co-resident and co-serialized**. Formally, enforcement holds iff for every value `v` in the agent's reachable state, `provenance(v)` is resolvable at the moment `v` is used as an argument to a sink call. This requires: - Labels are serialized *as part of the value's representati...",
    "decision_boundary": "The runtime must decide, per resume, whether to (a) re-derive labels from history, (b) preserve labels verbatim through serialization, or (c) fail closed on all unlabeled values. - **Re-derive (a)** is only sound if every historical tool result can be re-attributed to its originating call and trust class from the stored history alone. This holds when each `t...",
    "operational_effect": "A runtime that gets this wrong exhibits a characteristic signature: taint violations fire normally in long uninterrupted sessions and vanish after compaction or model swap. The policy appears to work in testing (short sessions, no checkpoint) and leaks in production (long sessions, frequent compaction). The leak is not a bug in any single component — seriali..."
  },
  "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": "ba692e4c33acdb5c611f7cdd38a303dde3f45427870af25fbea2f179e0edd699",
    "verified_classes": [
      "TaintSeveranceError"
    ],
    "verified_functions": [
      "resume_with_taint_check"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintSeveranceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
