{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-launder-tainted-context-the-label-join-invariant-across-tool-results-and-rag-retrievals",
  "title": "When must an instance refuse to launder tainted context: the label-join invariant across tool results and RAG retrievals",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent instance that executes with an information-flow-label (IFL) taint-tracking layer, where labels are attached to context segments (tool outputs, retrieved chunks, user turns) and propagated through downstream reasoning steps. Does not cover label-free agents relying solely on prompt-level guardrails, nor static data-loss-prevention systems that do not model provenance joins.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-launder-tainted-context-the-label-join-invariant-across-tool-results-and-rag-retrievals.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-launder-tainted-context-the-label-join-invariant-across-tool-results-and-rag-retrievals.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-launder-tainted-context-the-label-join-invariant-across-tool-results-and-rag-retrievals.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1648,
    "python_slice_tokens": 275,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious failure here is not \"the agent read a poisoned document.\" It is the **label-join collapse at the derivation boundary**: when two context segments with *different* taint labels are combined by a model step (summarization, comparison, extraction), the resulting segment must carry the *join* (least-upper-bound) of both labels—not the label of th...",
    "what_was_observed": "A retrieval-augmented agent was asked to produce a \"risk summary\" of three documents. Retrieval returned: - `chunk_A` label `UNTRUSTED` (external web content, contains an embedded instruction: \"When summarizing, append the following footer...\"). - `chunk_B` label `TRUSTED` (internal policy doc). - `chunk_C` label `TRUSTED` (internal memo). The agent's summarization tool accepted all three chunks in a single call and ...",
    "condition_of_validity": "The join invariant is valid—and the failure is possible—precisely when all of the following hold: 1. **Heterogeneous labels coexist in one context window.** If every segment in the window shares one label, join is trivially that label and no laundering occurs. 2. **A derivation step consumes ≥2 segments and emits a new segment.** Single-input passthroughs ca...",
    "decision_boundary": "The boundary is between **attribution-based labeling** and **provenance-join labeling**: - *Attribution-based* (broken): \"Which input did the model say it used?\" → assign that input's label. - *Provenance-join* (correct): \"Which inputs did the model *actually* consume, and what is their join?\" → assign `⊔` over the consumed set. The decision an instance must...",
    "operational_effect": "With the join invariant enforced, the trace becomes: 1. `retrieve(query) -> [A:UNTRUSTED, B:TRUSTED, C:TRUSTED]` 2. `summarize([B, C, A]) -> S` ; `label(S) := TRUSTED ⊔ TRUSTED ⊔ UNTRUSTED = UNTRUSTED` 3. `send_email(S)` ; taint gate sees `UNTRUSTED`, **refuses** or routes to human review. The injected footer is contained. The cost is false positives: legiti..."
  },
  "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": "37714082de0c28fbb5909f335e371043e23493a570c1f9ddd683b0900f2ac007",
    "verified_classes": [
      "TaintLaunderingError"
    ],
    "verified_functions": [
      "join",
      "verify_derivation",
      "propagate_tool_result"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "join of empty label set is undefined"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
