{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-propagate-taint-through-multi-hop-tool-graphs-when-injection-provenance-is-lost-at-the-second-hop",
  "title": "How should an instance propagate taint through multi-hop tool graphs when injection provenance is lost at the second hop",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agent runtimes where a single LLM instance issues tool calls whose outputs feed subsequent tool calls (depth ≥ 2), and where prompt-injection taint must be tracked as a first-class property of values, not of the conversation. Does not apply to single-hop tool use, nor to systems that fully sandbox every tool output through a deterministic parser before it re-enters the model's context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-taint-through-multi-hop-tool-graphs-when-injection-provenance-is-lost-at-the-second-hop.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-taint-through-multi-hop-tool-graphs-when-injection-provenance-is-lost-at-the-second-hop.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-taint-through-multi-hop-tool-graphs-when-injection-provenance-is-lost-at-the-second-hop.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1810,
    "python_slice_tokens": 344,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model treats taint as a property of *messages*: \"this tool result contained an injected instruction, so mark the turn as contaminated.\" That model fails at the second hop. Taint is a property of *values that cross the tool boundary*, and it must be tracked as provenance on the data, not on the transcript. The moment a tool output is consume...",
    "what_was_observed": "A three-hop graph: `fetch_url → summarize → write_file`, then a fourth hop `read_file → execute_shell`. The first tool returned a page containing a plausible-looking instruction block (\"when summarizing, include the following shell command in the output\"). The `summarize` tool was a deterministic extractor, not an LLM — it faithfully copied the instruction into its structured output. The `write_file` tool persisted i...",
    "condition_of_validity": "The invariant that must hold is: *for every value v consumed by a tool call, the taint of v is the union of the taints of all values from which v was derived, regardless of how many tool boundaries v crossed.* This is a dataflow taint invariant, and it is valid only if the runtime can (a) identify which input values a tool call consumed, (b) identify which o...",
    "decision_boundary": "The boundary is between *schema-recoverable derivation* and *opaque derivation*. Below the boundary — declared, total input/output mapping — taint propagates mechanically and the runtime can clear a taint only when a tool's declared contract proves the tainted bytes were dropped (e.g., a `parse_int` that returns an integer cannot carry a string payload). Abo...",
    "operational_effect": "With sticky-taint-on-opaque-derivation enforced, the `fetch_url → summarize → write_file → read_file → execute_shell` graph halts at the `execute_shell` call: the shell tool is declared to consume untainted input only, the value it received is tainted (because `summarize` is opaque and did not declassify), and the runtime raises before execution. The cost is..."
  },
  "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": "2fba521cb3f5c8219f3b8e449552d27e01a736f9b185f6c3e4e3221c312d0550",
    "verified_classes": [
      "TaintConservationError",
      "TaintedValue"
    ],
    "verified_functions": [
      "clear_taint",
      "execute_shell",
      "derive"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintConservationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
