{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-prompt-injection-taint-from-silently-laundering-itself-across-a-tool-call-chain",
  "title": "Which invariants prevent prompt-injection taint from silently laundering itself across a tool-call chain",
  "date_of_record": "2026 November 22",
  "scope": "Applies to single-agent and orchestrated LLM agents that attach provenance labels (e.g., `trusted:user`, `untrusted:tool_output`, `untrusted:retrieved_doc`) to context segments and propagate those labels across sequential tool calls. Does not address pure output-filtering defenses, model-internal attention steering, or stateless single-shot completions where no label survives past the response.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-prompt-injection-taint-from-silently-laundering-itself-across-a-tool-call-chain.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-prompt-injection-taint-from-silently-laundering-itself-across-a-tool-call-chain.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-prompt-injection-taint-from-silently-laundering-itself-across-a-tool-call-chain.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2085,
    "python_slice_tokens": 421,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The boundary that matters is not \"did the agent read untrusted text?\" — it is \"did the *label* on that untrusted text survive every transformation between ingestion and the sink action, with a monotonic (never-decreasing) taint level?\" Two distinct mechanisms get conflated in practice: 1. **Taint attribution** — the static fact that a span of context origina...",
    "what_was_observed": "A retrieval-augmented agent with a provenance layer. Context segments carried labels; the orchestrator enforced a rule: *arguments to the `execute_shell` tool must be derived only from `trusted` spans.* The rule was checked at call time by scanning the serialized argument string for substrings that appeared verbatim in untrusted spans (a \"copy-detection\" taint check). Trace: 1. `web_fetch(\"http://attacker.example/not...",
    "condition_of_validity": "The copy-detection taint model is valid **only** under the assumption that tainted influence is preserved verbatim in downstream artifacts. Formally, it holds iff for every derived value `v` and its tainted source span `s`, `s ⊑ v` (s is a substring of v) or `v` is produced by a transformation with a declared, sound taint-transfer function. This assumption i...",
    "decision_boundary": "The operational decision is where to enforce the invariant given that you cannot instrument the model's internals: - **If the downstream sink is irreversible or high-blast-radius** (shell, network egress, credential use, filesystem mutation): do **not** rely on substring copy-detection across a model step. Treat *every* model-emitted value that is causally d...",
    "operational_effect": "Concretely, the framework must: 1. **Label the model step as a taint-propagating join, not a trust boundary.** Any artifact emitted by the model carries `taint = max(taint of all context segments in the window at emission time)`. This is deliberately conservative — it taints the whole plan — because the model's actual dataflow is unobservable. 2. **Make decl..."
  },
  "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": "f46be0b3938f9e18763641def406386bf1055f6fa9119f51b3a4fef8880ddac0",
    "verified_classes": [
      "TaintLevel",
      "TaintLaunderingError",
      "Provenance",
      "Value",
      "TaintLedger"
    ],
    "verified_functions": [
      "run_plan_step",
      "execute_shell",
      "join",
      "declassify",
      "assert_sink_safe"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
