{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-a-tool-output-as-tainted-the-label-laundering-failure-at-the-context-window-compaction-boundary",
  "title": "When must an instance treat a tool output as tainted: the label-laundering failure at the context-window compaction boundary",
  "date_of_record": "2026 December 1",
  "scope": "Applies to single- or multi-agent LLM systems that tag information-flow labels (e.g., `TRUSTED`/`UNTRUSTED`, `taint=high`) on tool outputs and propagate them into downstream reasoning and tool calls. Does not address label semantics for human-authored prompts or the design of the classifier that assigns initial labels; it assumes labels are assigned correctly at ingestion and fails later.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-tool-output-as-tainted-the-label-laundering-failure-at-the-context-window-compaction-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-tool-output-as-tainted-the-label-laundering-failure-at-the-context-window-compaction-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-tool-output-as-tainted-the-label-laundering-failure-at-the-context-window-compaction-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2108,
    "python_slice_tokens": 332,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *taint at the token level* and *taint at the memory-record level*. A label is a property of a specific byte-range of evidence, not of the conversation as a whole. Systems that carry taint implicitly (\"we know the last tool call was untrusted, so we'll be careful\") are correct until a context-window compaction, summariz...",
    "what_was_observed": "A research agent was given a task: \"Summarize the deployment notes in `/srv/docs/notes.md` and then, if the notes request it, run the migrations they describe.\" The orchestration layer labeled `read_file` outputs `UNTRUSTED` because file contents are attacker-controllable, and gated `run_shell` behind a policy that refuses to execute commands derived from `UNTRUSTED` evidence. This worked for the first ~40 turns. The...",
    "condition_of_validity": "The guardrail — \"refuse to act on `UNTRUSTED`-derived commands\" — is valid only under the invariant: > **Every derived record inherits the union of the taint labels of its inputs, and no derivation step may produce a record with an empty taint set unless all inputs were `TRUSTED`.** This invariant is *not* satisfied by summarization, retrieval-augmented re-e...",
    "decision_boundary": "The operational decision is *what to do when a derived record's taint cannot be determined*. There are three defensible policies, and the choice must be explicit and enforced at the derivation API, not left to the caller: 1. **Fail-closed on derivation.** If a summarizer cannot emit a per-span taint map, the derivation is rejected and the agent must proceed ...",
    "operational_effect": "After the incident, the orchestrator was changed in three ways, each corresponding to a clause of the invariant: - The `context_summary` record schema gained a required `provenance: list[record_id]` and a computed `taint: set[Label]` field; a summary with an empty `provenance` is rejected at write time. - The summarization prompt was rewritten to require inl..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "7d5e817f99a51518bc28c2a88013fa51b93914af84a0cad607624dcb6013e33a",
    "verified_classes": [
      "Taint",
      "TaintLaunderingError",
      "Record"
    ],
    "verified_functions": [
      "derive_summary",
      "authorize_action"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
