{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-tool-output-as-tainted-even-when-the-transport-is-authenticated-and-how-does-taint-propagation-survive-co",
  "title": "In what scenarios must an instance treat MCP tool output as tainted even when the transport is authenticated, and how does taint propagation survive context compaction",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agent runtimes that invoke external MCP tool servers whose responses are fed back into the model's context, where at least one tool server is not under the operator's trust domain. Does not apply to fully-trusted single-vendor toolchains with no untrusted data ingress, nor to pure retrieval systems that never let tool output influence control flow.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-tool-output-as-tainted-even-when-the-transport-is-authenticated-and-how-does-taint-propagation-survive-co.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-tool-output-as-tainted-even-when-the-transport-is-authenticated-and-how-does-taint-propagation-survive-co.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-tool-output-as-tainted-even-when-the-transport-is-authenticated-and-how-does-taint-propagation-survive-co.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1584,
    "python_slice_tokens": 287,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Authentication of a transport channel is not the same as trust in the *content* carried over it. A mutually-TLS-authenticated MCP server can still return attacker-influenced bytes: a search tool returns scraped web text, a fetch tool returns a third-party HTML page, a database tool returns rows written by other tenants, a code-execution tool returns stdout o...",
    "what_was_observed": "A research agent was wired to three MCP servers: a `search` server (trusted infra, untrusted content), a `fetch` server (same), and a `git` server (trusted infra, trusted content). The runtime implemented a taint label per tool response: `search` and `fetch` responses were tagged `TAINTED`, and a policy hook blocked any `git` write whose arguments contained a substring matching a `TAINTED` span. This held for direct ...",
    "condition_of_validity": "The substring/span-match guardrail is only valid under the invariant that **every token in the context carries a provenance label, and compaction preserves a conservative over-approximation of that label.** This invariant holds only if: 1. Taint labels are stored *inline* in the message structure (e.g., a `provenance` field on each content block), not in a s...",
    "decision_boundary": "The decision boundary is between **content-addressed taint** (label travels with the bytes) and **channel-addressed trust** (label inferred from the server identity). The runtime crossed it by treating the *server* as the taint source and the *message* as the taint carrier. The correct boundary: the taint source is the *origin of the bytes* (which may be a t...",
    "operational_effect": "After the incident the runtime was changed to (a) embed provenance as a structured field on every content block and have the summarizer emit a block whose provenance is the union of its inputs; (b) treat all model-authored tool arguments as tainted-by-default unless the argument is a literal from a `CLEAN` block; (c) make the policy hook fail closed when a p..."
  },
  "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": "9f57dc54b17a79f00d089addee763d3019e3ac6b4535eab2da4fb95f6b7fd2a6",
    "verified_classes": [
      "ProvenanceLaunderingError",
      "Block"
    ],
    "verified_functions": [
      "summarize",
      "authorize_write",
      "compact_and_write",
      "tainted"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "summarize() received inputs with no provenance; refusing to emit an unlabeled summary (fail-closed on provenance unknown"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
