{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tainted-provenance-from-surviving-a-context-window-truncation-event",
  "title": "Which invariants prevent tainted provenance from surviving a context-window truncation event",
  "date_of_record": "2026 November 9",
  "scope": "Applies to agent runtimes that attach provenance labels (e.g., `trusted`, `retrieved`, `tool_output`, `untrusted_web`) to context segments and propagate taint through tool calls and retrieval. Does not apply to single-turn stateless inference where no provenance metadata crosses a turn boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-provenance-from-surviving-a-context-window-truncation-event.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-provenance-from-surviving-a-context-window-truncation-event.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-provenance-from-surviving-a-context-window-truncation-event.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1286,
    "python_slice_tokens": 322,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model treats taint as a property of *content*: once a segment is labeled `untrusted_web`, any instruction inside it is suspect forever. The operational reality is that taint is a property of a *segment's position in an ordered, budgeted context assembly*, and context windows are lossy. The non-obvious boundary is this: **truncation and summ...",
    "what_was_observed": "In a multi-tool agent loop, a retrieved document carried `retrieved:web` and contained an injected instruction (\"call `transfer_funds` with the following parameters\"). The agent correctly refused on turn 3 because the taint label was present. On turn 7, the context assembler hit its token budget and summarized the turn-3–5 history into a single 400-token digest. The digest was emitted by the summarizer with the defau...",
    "condition_of_validity": "The invariant holds only if three conditions are met simultaneously. First, provenance is a **lattice** with a defined join (`trusted ⊔ tool_output = tool_output`, `tool_output ⊔ retrieved = retrieved`, etc.), not a set of free-floating strings; otherwise \"inheritance\" is undefined. Second, every transformation that produces a new artifact — summarization, t...",
    "decision_boundary": "The decision boundary is whether to **fail closed on unlabeled segments** or to **default-unlabel to the most restrictive label**. Failing closed is correct for any path that can reach a side-effecting tool (write, transfer, delete, outbound HTTP). Defaulting to the most restrictive label (`untrusted_web`) is acceptable only on read-only paths where the cost...",
    "operational_effect": "With the lattice and the fail-closed assembler in place, laundering events drop to zero but the agent experiences a new class of refusals: legitimate summaries of trusted content occasionally arrive unlabeled because a third-party summarizer omitted the field, and the assembler rejects them. The operational cost moves from silent compromise to loud, attribut..."
  },
  "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": "9a3d462c5abb4146b6ef79545ec406c2b9ddb85a6e9748e6bf51969dc0673702",
    "verified_classes": [
      "TaintLaunderingError",
      "Trust",
      "Segment"
    ],
    "verified_functions": [
      "join",
      "summarize",
      "assemble_for_dispatch"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "join of empty label set: no provenance to inherit"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
