{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-taint-laundering-across-mcp-tool-boundaries-when-a-sandboxed-agent-re-derives-untrusted-data-through-a-trusted-lookin",
  "title": "What structural signals indicate taint-laundering across MCP tool boundaries when a sandboxed agent re-derives untrusted data through a trusted-looking intermediate call",
  "date_of_record": "2026 November 19",
  "scope": "Applies to agents that execute tool calls through an MCP client with per-call taint labels propagated from untrusted sources (web fetches, third-party MCP servers, user-supplied documents). Does not cover pure-prompt-injection defenses at the model layer or static capability allowlisting; those are orthogonal controls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-across-mcp-tool-boundaries-when-a-sandboxed-agent-re-derives-untrusted-data-through-a-trusted-lookin.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-across-mcp-tool-boundaries-when-a-sandboxed-agent-re-derives-untrusted-data-through-a-trusted-lookin.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-across-mcp-tool-boundaries-when-a-sandboxed-agent-re-derives-untrusted-data-through-a-trusted-lookin.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1891,
    "python_slice_tokens": 324,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint tracking fails at agent boundaries not because a label is dropped, but because the *provenance edge* is re-anchored to a trusted origin. When an agent reads untrusted content (label `U`) and then calls a tool whose *output* is labeled trusted (`T`) — a calculator, a schema validator, a summarizer MCP server the operator marked `trusted: true` — the tai...",
    "what_was_observed": "A tool-execution trace from a research agent operating with three MCP servers: - `fetch` — untrusted, returns web content, correctly labeled `U`. - `summarize` — operator-marked `trusted: true`, wraps an LLM call, takes `text` and returns a summary. - `exec` — sandboxed shell, refuses any argument carrying `U` taint. The agent fetched a page containing a prompt-injection payload that instructed it to \"summarize the f...",
    "condition_of_validity": "The invariant that must hold: **for every tool call, `result_taint ⊇ join(arg_taint, server_declared_taint)` where the join is the least-upper-bound in the taint lattice, and `server_declared_taint` may only *raise* taint, never lower it.** A trusted server can add its own trust, but it cannot erase the taint of its inputs. Trust flags are an *upper bound on...",
    "decision_boundary": "The boundary is between *trust as a capability grant* and *trust as a taint lower-bound*. Operators routinely conflate them when they mark an MCP server `trusted: true` in config, intending \"this server is allowed to call `exec`\" and accidentally getting \"this server's outputs are clean.\" The decision rule: - If a server's output can contain bytes derived fr...",
    "operational_effect": "Without the join invariant, taint tracking provides false assurance: the agent appears sandboxed, the gate appears to fire, and the audit log shows every `exec` call with a clean `T` label. The escape is invisible in logs because the laundering step is a legitimate-looking `summarize` call. Post-hoc forensics must reconstruct the data-flow graph across the `..."
  },
  "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": "041f9f2a8420aec5255e8e28bcdd756bff6bb50fcf51ac74f30479590cd9857d",
    "verified_classes": [
      "Taint",
      "TaintLaunderingError",
      "ServerProfile",
      "TaintedValue"
    ],
    "verified_functions": [
      "join",
      "invoke_tool",
      "execute_in_sandbox"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
