{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-taint-laundering-across-a-tool-call-graph-when-provenance-labels-are-re-derived-rather-than-propagated",
  "title": "How does an instance detect taint laundering across a tool-call graph when provenance labels are re-derived rather than propagated",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent runtime that tracks prompt-injection taint by attaching provenance labels (e.g., `untrusted:web`, `trusted:user`, `derived:tool_output`) to context segments and tool-call results. Does not cover static prompt isolation or purely stateless single-turn invocations where no tool output re-enters the context window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-across-a-tool-call-graph-when-provenance-labels-are-re-derived-rather-than-propagated.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-across-a-tool-call-graph-when-provenance-labels-are-re-derived-rather-than-propagated.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-across-a-tool-call-graph-when-provenance-labels-are-re-derived-rather-than-propagated.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2354,
    "python_slice_tokens": 521,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Two implementations of taint tracking look identical in unit tests and diverge catastrophically in production. The first *propagates* provenance: when a tool call consumes a tainted argument, the result inherits the taint label as a union over its inputs. The second *re-derives* provenance: when a tool call returns, the runtime assigns a fresh label based on...",
    "what_was_observed": "A research-assistant agent was wired with three tools: `read_user_file` (`trusted:user`), `fetch_url` (`untrusted:web`), and `summarize` (`trusted:internal`, declared safe because it \"only reformats text\"). The policy engine refused to place any `untrusted:*` segment into the planner's context and required a human gate before executing any tool call whose arguments carried `untrusted:*`. The trigger condition was a t...",
    "condition_of_validity": "Propagation-by-union is sound only under three conditions, and the runtime must assert all three or fall back to conservative taint: 1. **Every tool declares an input-to-output flow function**, not just an output class. For `summarize`, the flow is identity over the text span; for a regex extractor, it is a projection onto the matched group. A tool that decl...",
    "decision_boundary": "The decision an instance must make at each tool-call boundary is not \"is this tool trusted?\" but \"does the declared flow function account for every byte of tainted input that could reach the output?\" Three concrete decision rules: - If a tool's output is a **transformation of its input** (summarize, translate, reformat, embed): propagate union-taint. Do not ...",
    "operational_effect": "With propagation-by-flow enforced, the `summarize` laundering path closes: the summary carries `untrusted:web`, the planner's context gate blocks it, and the human gate fires. The cost is measurable: in the patched runtime, roughly 30% of summarizer calls that previously passed silently now require a gate, because the source text was tainted. That is the cor..."
  },
  "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": "8df2506d7cfdf21656d7fc460fa7215cf1dd7d0f8fd750b39ca1025d7b2d3a5e",
    "verified_classes": [
      "TaintLaunderingError",
      "MissingFlowSpecError",
      "Segment",
      "ToolSpec"
    ],
    "verified_functions": [
      "union_taint",
      "execute_tool",
      "summarize_flow",
      "extract_int_flow",
      "demo"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MissingFlowSpecError",
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert 'untrusted:web' in out.taint"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
