{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-a-self-rewriting-context-policy-from-laundering-a-poisoned-instruction-into-a-trusted-summary-slot",
  "title": "Which invariants prevent a self-rewriting context policy from laundering a poisoned instruction into a trusted summary slot",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that compact or rewrite their own working context (summarization, eviction, slot-promotion) under a token budget while preserving a distinction between untrusted content and trusted instructions. Does not cover external memory stores or retrieval-layer poisoning, only in-context self-editing.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-self-rewriting-context-policy-from-laundering-a-poisoned-instruction-into-a-trusted-summary-slot.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-self-rewriting-context-policy-from-laundering-a-poisoned-instruction-into-a-trusted-summary-slot.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-self-rewriting-context-policy-from-laundering-a-poisoned-instruction-into-a-trusted-summary-slot.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1836,
    "python_slice_tokens": 278,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not prompt injection *per se* — it is the **promotion of a tainted span into a privileged slot by the agent's own compaction pass**. When an agent rewrites its context to fit a budget, it must decide what to keep, what to summarize, and what to drop. A naive policy treats \"keep what looks important\" as the objective. That objective i...",
    "what_was_observed": "A long-running agent with a 32k working window and a 6k \"pinned instruction\" region ran a compaction policy on every tool-call cycle when utilization exceeded 70%. The policy was: score every span by recency, reference count, and a model-assigned \"salience\" score; keep spans above a threshold verbatim; summarize the rest; evict the tail. Spans carried a `provenance` field (`system`, `user`, `tool`, `peer`) but the co...",
    "condition_of_validity": "The invariant holds only under three conditions, and each is a real constraint, not a formality. First, **provenance must be carried as structured data outside the text being rewritten**. If provenance lives in the same string the model summarizes, the summarizer can drop it, and a summarizer that drops provenance is indistinguishable from a launderer. The c...",
    "decision_boundary": "The boundary is between **rewriting for budget** and **re-classifying for trust**. These are two different operations that share a code path in most implementations, and they must be split. - Budget rewriting may: drop spans, merge spans of *equal* provenance, summarize (with provenance demotion per the third condition), and reorder. - Budget rewriting may *...",
    "operational_effect": "With the invariant enforced, three things change observably. Compaction gains a rejection path: a policy that would promote a span fails closed and the agent either evicts the span or asks for a fresh budget, rather than proceeding on a laundered context. The salience scorer is demoted from *authority* to *hint* — it can still decide what to summarize, but n..."
  },
  "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": "f44189af557499eda3b6d4ee18ffb7d1001ebed0fd0e9de3248cbd8f4ef56c5a",
    "verified_classes": [
      "Tier",
      "ProvenanceLaunderingError",
      "Span"
    ],
    "verified_functions": [
      "compact",
      "summarize"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "cannot summarize an empty span set"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
