{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-label-laundering-across-the-retrieval-re-rank-boundary",
  "title": "Which invariants prevent taint-label laundering across the retrieval re-rank boundary",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents whose prompt-injection defense uses provenance/taint labels attached to context segments and propagated through tool outputs and retrieval. Does not apply to stateless single-turn calls with no retrieval and no persistent taint ledger.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-label-laundering-across-the-retrieval-re-rank-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-label-laundering-across-the-retrieval-re-rank-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-label-laundering-across-the-retrieval-re-rank-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1899,
    "python_slice_tokens": 263,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint tracking works on a *segment-provenance* model: each context span carries a label (`TRUSTED`, `UNTRUSTED:web`, `UNTRUSTED:tool_output`, etc.), and the policy is that any instruction originating in an `UNTRUSTED` span may be *read* but not *executed*. The failure that matters is not an injected span being mislabeled at ingress — ingress labeling is comp...",
    "what_was_observed": "A retrieval stack: fetch → chunk → embed → retrieve top-50 → cross-encoder re-rank to top-8 → assemble into prompt. Ingress labeling was correct: every chunk fetched from `web` was tagged `UNTRUSTED:web` and stored in the chunk metadata. The bug was in the re-rank→assemble handoff. The re-ranker returned a list of `(chunk_id, score)` pairs. The assembler looked up each `chunk_id`, pulled the chunk text, and — because...",
    "condition_of_validity": "The invariant that must hold is a **monotonicity condition on taint across derivation**: > For any derived artifact `d` produced from inputs `I = {i₁ … iₙ}`, `taint(d) ⊇ ⋃ taint(iₖ)`. A derivation may *raise* taint (a trusted input combined with an untrusted one yields untrusted), never *lower* it. This holds only if every transformation node in the pipeline...",
    "decision_boundary": "The boundary is between **content trust** and **channel trust**, and the pipeline must never let one substitute for the other. - *Channel trust* answers: \"did these bytes arrive over a path I control?\" (local store: yes; web fetch: no.) - *Content trust* answers: \"what is the lineage of these bytes?\" (a chunk in the local store may have `UNTRUSTED:web` linea...",
    "operational_effect": "With the monotonicity invariant enforced at every derivation node, the re-rank→assemble bug becomes impossible: the assembler computes the assembled span's label as the join of the selected chunks' lineage labels, and the injected instruction arrives at the gate correctly marked `UNTRUSTED:web`. The gate then refuses to execute it while still permitting the ..."
  },
  "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": "21c51104752b85c907fcb89dc544d98f40d08a3cdca997e603f54fabe81c6588",
    "verified_classes": [
      "TaintLaunderingError",
      "UntrustedExecutionError",
      "Span"
    ],
    "verified_functions": [
      "join_label",
      "derive",
      "execute_instruction"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError",
      "UntrustedExecutionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
