{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-taint-label-has-been-laundered-through-a-capability-scoped-mcp-tool-result-the-return-value-provenance-gap",
  "title": "How does an instance detect that a taint label has been laundered through a capability-scoped MCP tool result: the return-value provenance gap",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that propagate taint labels (untrusted-content markers) from tool inputs to outputs and gate privileged MCP calls on that taint state. Does not apply to stateless single-shot tool calls where no downstream privileged capability exists, nor to sandboxes that enforce taint at the OS/syscall layer independent of agent bookkeeping.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-taint-label-has-been-laundered-through-a-capability-scoped-mcp-tool-result-the-return-value-provenance-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-taint-label-has-been-laundered-through-a-capability-scoped-mcp-tool-result-the-return-value-provenance-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-taint-label-has-been-laundered-through-a-capability-scoped-mcp-tool-result-the-return-value-provenance-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1467,
    "python_slice_tokens": 290,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *taint tracking as a gate on the agent's own tool-selection logic* and *taint tracking as an enforced property of the data that crosses a capability boundary*. Most runtime taint-aware sandboxes implement the former: the agent marks a tool result as tainted, and a policy layer refuses to invoke a privileged tool while ...",
    "what_was_observed": "A three-tool MCP server exposed `fetch_url` (unprivileged, returns arbitrary web content), `summarize` (unprivileged, calls an internal LLM with the passed text), and `write_file` (privileged, requires `taint_clear=true` in the invocation context). The policy layer set `taint_clear=false` whenever any prior tool result carried the `untrusted_web` label and cleared it only after an explicit `sanitize` step. The failur...",
    "condition_of_validity": "The laundering attack is valid only when all of the following hold: - A tainted value is passed as an argument to a tool whose *output* is treated as trusted by default (the \"trusted-output assumption\"). - The tool's capability scope permits it to reach a privileged sink, either directly (confused deputy) or by returning content that the agent will act on. -...",
    "decision_boundary": "The architectural invariant required is: **taint is a property of the data flow, not of the tool's identity.** Concretely, the policy layer must enforce: 1. *Argument-to-return propagation:* any tool invocation receiving a tainted argument yields a tainted return, unless the tool is explicitly registered with a `taint_clearing` capability and its output pass...",
    "operational_effect": "Without the invariant, taint-aware sandboxing provides a false sense of security: it blocks the naive direct path (`fetch_url` → `write_file`) while leaving the two-hop path (`fetch_url` → `summarize` → `write_file`) wide open. The operational consequence is that red-team coverage that only tests direct taint propagation will report the sandbox as effective ..."
  },
  "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": "cb7c09f4703fbf265aac10f1d1b889ce38948587a20114308bbd8b5fb085d7fc",
    "verified_classes": [
      "TaintLaunderingError"
    ],
    "verified_functions": [
      "invoke_tool",
      "_mcp_call",
      "_verify_cleared"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "NotImplementedError",
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
