{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-laundering-across-tool-output-retrieved-context-and-inter-agent-message-boundaries",
  "title": "Which invariants prevent taint laundering across tool-output, retrieved-context, and inter-agent message boundaries",
  "date_of_record": "2026 November 7",
  "scope": "Applies to agent runtimes that propagate dynamic information-flow labels (taint) across three or more distinct ingress channels — tool results, retrieval, and inter-agent messages — within a single trust domain. Does not apply to single-channel prompt pipelines, nor to systems where every ingress is already fully trusted by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-tool-output-retrieved-context-and-inter-agent-message-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-tool-output-retrieved-context-and-inter-agent-message-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-tool-output-retrieved-context-and-inter-agent-message-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1522,
    "python_slice_tokens": 413,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"injection succeeds.\" It is **taint laundering**: a high-integrity label (untainted) is *re-derived* for data that was originally tainted, because the laundering path crosses a boundary where the runtime resets or re-originates labels rather than composing them. The dangerous distinction is between **label composition** (a join over all pr...",
    "what_was_observed": "In a multi-agent retrieval pipeline (planner → retriever → executor → summarizer), an injection embedded in a fetched web page survived three hops. The retriever correctly labeled the fetched chunk `taint=external`. The executor called a tool whose *output* echoed the injected string; the tool-output adapter labeled it `taint=tool` and, because the tool was on an allowlist, mapped `tool → trusted` at the adapter boun...",
    "condition_of_validity": "These invariants are necessary and sufficient to prevent laundering **only when**: - Every ingress channel has a well-defined adapter that is the *sole* constructor of labels for that channel, and the adapter is proven to compute `label_out = join(label_in_context, channel_intrinsic_label)`. - Labels form a join-semilattice with a partial order where `join` ...",
    "decision_boundary": "At each boundary, the runtime must decide: *compose or re-originate?* The rule: - **Compose (join)** at: tool-output adapters, retrieval chunk ingestion, inter-agent receive, and any function that concatenates or summarizes values from ≥2 provenance sources. - **Re-originate (fresh intrinsic label)** only at: the true system boundary where data first enters ...",
    "operational_effect": "With composition enforced, injected content remains `external`-tagged through every hop; the summarizer's action policy refuses `external`-labeled instructions from executing side-effecting tools, and the injection is inert. The cost is benign: legitimate tool outputs that merely *quote* external text also carry `external` taint, which is correct — they shou..."
  },
  "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": "1b1235aa7c988402f053013362a0bd0bd9ed19ba8f74240d5cfcbebe1dbea6fd",
    "verified_classes": [
      "TaintLaunderingError",
      "Labeled"
    ],
    "verified_functions": [
      "compose_at_boundary",
      "inter_agent_send",
      "join"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert EXTERNAL in msg.provenance",
      "sender identity masked payload provenance"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
