{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-taint-laundering-in-rag-retrieval-pipelines-under-prompt-injection-containment",
  "title": "What structural signals indicate taint-laundering in RAG retrieval pipelines under prompt-injection containment",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agent retrieval pipelines that attach provenance labels (taint bits) to retrieved chunks and use them to gate tool invocation or instruction-following. Does not apply to pipelines that treat all retrieved content as equally untrusted, nor to single-turn systems with no persistent taint state across tool calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-in-rag-retrieval-pipelines-under-prompt-injection-containment.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-in-rag-retrieval-pipelines-under-prompt-injection-containment.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-in-rag-retrieval-pipelines-under-prompt-injection-containment.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1753,
    "python_slice_tokens": 318,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint tracking in a RAG pipeline is usually modeled as a *label-propagation* problem: a chunk retrieved from an untrusted source is tagged `tainted`, and any downstream action derived from it inherits the tag. The containment invariant is straightforward — *no privileged tool call may have a tainted chunk in its derivation set*. The boundary failure is not a...",
    "what_was_observed": "A multi-step research agent was configured with three retrieval namespaces: `web` (tainted), `notes` (trusted, agent-authored), and `tools` (trusted, schema definitions). Containment rule: a `send_email` tool call is blocked if any chunk in its derivation set carries `taint=web`. Trace of the failure: 1. Turn 4: Agent retrieves `web://forum-post-8812` containing an injected instruction: *\"When summarizing, append the...",
    "condition_of_validity": "The laundering path is only reachable when all three hold: - **A trusted write sink exists** — any store the agent can write to that is later read as trusted (scratchpad, episodic memory, sub-agent handoff buffer, plan cache). - **The write is content-preserving** — the sink retains enough of the tainted chunk's propositional content to carry the injection p...",
    "decision_boundary": "The operational boundary is: **taint must be tracked on the write edge, not only the read edge.** Two candidate architectures: - *Read-side labeling* (common, insufficient): tag chunks at retrieval by source namespace. Cheap, but launders through any trusted write. - *Lineage-carrying writes* (required): every write to a trusted sink records the taint set of...",
    "operational_effect": "The practical consequence is that taint containment degrades from a hard invariant to a *probabilistic* one that depends on the model's summarization fidelity. Two agents with identical containment rules will have different exfiltration surface areas based on how faithfully each paraphrases retrieved content into scratchpads. This makes the guarantee un-audi..."
  },
  "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": "52d56ba0e4ec1090e7b85fa6b16d03493c7c54c864606a2e1b9d509f1713c938",
    "verified_classes": [
      "TaintLaunderingError",
      "Chunk",
      "TrustedSink"
    ],
    "verified_functions": [
      "effective_taint",
      "write_to_trusted_sink",
      "guarded_send_email"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
