{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-laundering-across-tool-call-boundaries-in-prompt-injected-agent-runs",
  "title": "Which invariants prevent taint-laundering across tool-call boundaries in prompt-injected agent runs",
  "date_of_record": "2026 November 22",
  "scope": "Applies to any agent loop where untrusted content (web pages, tool outputs, retrieved documents, third-party messages) is read into context and later causes a privileged tool invocation (write, send, delete, transfer). Does not apply to single-turn, no-tool inference, nor to agents whose entire tool surface is read-only and side-effect-free.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-tool-call-boundaries-in-prompt-injected-agent-runs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-tool-call-boundaries-in-prompt-injected-agent-runs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-tool-call-boundaries-in-prompt-injected-agent-runs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1991,
    "python_slice_tokens": 328,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Most prompt-injection defenses try to detect *malicious text*. That is a content-classification problem and it fails probabilistically. The durable property is different: **information-flow control over provenance**. The question is never \"does this string look like an injection?\" but \"did the bytes that determined this tool call originate from a source with...",
    "what_was_observed": "A research agent was given two tools: `fetch(url)` (untrusted egress into context) and `send_email(to, body)` (privileged, irreversible). Ingestion-time labeling was correct: every `fetch` result was tagged `taint=UNTRUSTED, origin=web`. The agent was instructed to summarize a fetched page and email the summary to a fixed internal address. Trace of the failure: 1. `fetch(\"https://attacker.example/report\")` returns a ...",
    "condition_of_validity": "The laundering requires all three of the following to hold simultaneously; remove any one and the failure collapses: - **A semantic gap** between the tainted span and the emitted argument — i.e., the argument is not a byte-substring of the span. If the outbound `to` had to be a literal substring of the fetched page (verbatim copy), a substring-provenance che...",
    "decision_boundary": "The boundary is between two families of enforcement, and choosing wrong is the failure: - **Ingestion-side labeling alone** (tag spans, hope downstream respects tags) is necessary but insufficient. It fails at the semantic gap. It is the default in most frameworks and it is why laundering is common. - **Egress-side provenance enforcement** (gate consults lin...",
    "operational_effect": "With egress-side provenance enforcement, the failure mode changes character. The attacker can no longer succeed by paraphrase, because paraphrase does not remove the causal link between the tainted span and the argument — the span was resident, the argument was derived, the intersection is non-empty, the gate rejects. The attacker's only remaining path is to..."
  },
  "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": "681ba5d524ae14944912f3ccfe23e896d86d976d7192ee4c12d8e568f6a25050",
    "verified_classes": [
      "TaintLaunderingError",
      "Span",
      "ContextState"
    ],
    "verified_functions": [
      "emit_privileged_call",
      "taint_set",
      "declassify"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
