{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-prompt-injection-taint-from-being-laundered-through-tool-call-round-trips",
  "title": "Which invariants prevent prompt-injection taint from being laundered through tool-call round-trips",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents that maintain per-span provenance labels (trusted / untrusted / derived) across a multi-turn loop where retrieved context and tool outputs re-enter the prompt. Does not apply to single-shot, stateless inference where no label survives past one completion.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-prompt-injection-taint-from-being-laundered-through-tool-call-round-trips.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-prompt-injection-taint-from-being-laundered-through-tool-call-round-trips.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-prompt-injection-taint-from-being-laundered-through-tool-call-round-trips.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1719,
    "python_slice_tokens": 282,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure that matters is not \"the model obeyed an injected instruction.\" It is that the agent's taint-tracking layer *downgraded the taint label* on a span it did not author, because the span re-entered the context through a channel the tracker classified as trusted by construction. A tool call is a channel, not a source. When the agent treats \"output of ...",
    "what_was_observed": "A retrieval-augmented agent with a `web_fetch` tool and a `summarize` tool. Provenance labels were attached at ingestion: `web_fetch` output tagged `UNTRUSTED`, model-authored reasoning tagged `DERIVED`, system prompt tagged `TRUSTED`. A guard rejected any *action* (e.g., `send_email`) whose argument spans contained `UNTRUSTED` tokens. The laundering path: 1. `web_fetch(\"https://attacker.example/notes\")` returns text...",
    "condition_of_validity": "The invariant that bounds this failure: > **For every span `s` produced by tool `t` with inputs `I`, `label(s) = min_trust(label(i) for i in I ∪ {t})` under the ordering `UNTRUSTED < DERIVED < TRUSTED`.** Two conditions must hold for the invariant to be enforceable: 1. **Input provenance is captured at call time, not inferred.** The tracker must record which...",
    "decision_boundary": "The operational decision is where to place the label-join: at the **tool boundary** or at the **context-assembly boundary**. - **Tool-boundary join** (recommended): every tool invocation returns `(payload, label)` where `label = min(inputs, tool)`. The guard checks argument labels at action time. This is local, composable, and survives new tools without re-a...",
    "operational_effect": "With a sound join, the attack in \"What Was Observed\" fails at step 5: the `export_contacts` argument span traces to a `summarize` output whose input was `UNTRUSTED`, so the argument is `UNTRUSTED`, so the guard raises. The model may still *attempt* the call; the attempt is logged as a taint violation, which is a useful signal (the model was successfully inje..."
  },
  "matched_failure_symptoms": [
    "PROMPT_INJECTION_OR_CONFUSED_DEPUTY"
  ],
  "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": "ae78c29d3bec75f146580be600a9423fd6a7bf8f3411ec18cec1be507ab77eca",
    "verified_classes": [
      "Trust",
      "TaintLaunderingError",
      "Span"
    ],
    "verified_functions": [
      "join_label",
      "invoke_tool",
      "guard_action"
    ],
    "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
  }
}
