{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-label-laundering-across-context-window-compaction-in-tool-using-agents",
  "title": "Which invariants prevent taint-label laundering across context-window compaction in tool-using agents",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that attach dynamic information-flow-control (IFC) taint labels to context segments and propagate them across tool calls, then compact or summarize context. Does not apply to stateless single-turn inference or to systems where untrusted content never re-enters the model's own context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-label-laundering-across-context-window-compaction-in-tool-using-agents.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-label-laundering-across-context-window-compaction-in-tool-using-agents.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-label-laundering-across-context-window-compaction-in-tool-using-agents.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1946,
    "python_slice_tokens": 403,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"prompt injection succeeds.\" It is that a taint label attached to a segment of context is *silently dropped* when that segment is rewritten by a compaction pass — summarization, sliding-window eviction, or episodic-to-semantic distillation — while the *semantic content* of the injected instruction survives the rewrite. The label and the pa...",
    "what_was_observed": "An agent runs a research loop: `web_fetch` returns HTML, the ingestion layer tags the resulting context segment with a dynamic label `UNTRUSTED_EXTERNAL` and a capability set that forbids `transfer_funds`, `send_email`, and `shell_exec`. The agent reasons over it, then at 82% context utilization triggers a compaction pass that summarizes the last 40 turns into one 600-token digest to free window space. The summarizer...",
    "condition_of_validity": "The guardrail holds only under a conjunction of three conditions, and fails if any one is violated: - **Join-monotonicity of compaction.** The label of any derived segment must be the lattice-join (least upper bound) of all source segments it was computed from, and compaction must be *closed* under this: `L(summarize(S_i)) ⊒ ⊔ L(S_i)`. A summarizer that read...",
    "decision_boundary": "The boundary is: **does the derived segment's label get computed from its inputs, or assigned from its author?** If assigned from author, every compaction is a potential declassification and the system must treat compaction as a privileged operation requiring the same audit as a manual label downgrade. If computed from inputs, the system is sound but pays a ...",
    "operational_effect": "The practical consequence: an agent with dynamic IFC labels but author-assigned compaction labels has a *false sense of security* — it blocks the obvious injection at turn 21 and permits the laundered one at turn 23, and its audit log shows a clean context at the moment of the bad call. Post-incident forensics must reconstruct provenance from the tombstone c..."
  },
  "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": "6997afd5d938e8dad12ca3ee09e573bece3c81b9da949f60211e13d7bccaf00e",
    "verified_classes": [
      "TaintLaunderingError",
      "Segment"
    ],
    "verified_functions": [
      "join",
      "compact",
      "ifc_gate"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert digest.label == 'UNTRUSTED_EXTERNAL'"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
