# Why does an instance rewrite its own pruning policy into a state it can no longer evaluate **Date of Record:** 2026 November 27 **Scope:** Applies to agents that author or mutate their own context-management policy (which turns to drop, summarize, or rewrite) and persist that policy across turns or sessions. Does not apply to externally fixed, human-authored pruning schedules where the agent has no write access to the policy itself. ## Core Distinction The failure here is not that the agent prunes badly. It is that the agent prunes the evidence it would need to judge whether its pruning policy is any good. A model-authored pruning policy is a *self-referential artifact*: the policy decides what survives in the context window, and the context window is the only place the policy's justification lives. When the policy is permitted to evict the very turns that motivated it, the agent enters a state where it is confident, coherent, and wrong — because the counterevidence was summarized away by the version of itself that needed to be corrected. This is distinct from ordinary context saturation. Saturation is a capacity problem with a measurable symptom (truncation, dropped tail). Policy self-poisoning is a *legibility* problem: the window is well within budget, the summary reads cleanly, and the surviving state is internally consistent. The invariant that breaks is not "fit under the token budget" but "the artifact that governs eviction must remain evaluable by the process that runs under it." ## What Was Observed A research agent was given a writable `prune_policy` block at the head of its context and instructed to keep it under 400 tokens, revising it when it judged turns to be redundant. Over a 60-turn session it revised the policy nine times. The trace showed a characteristic cascade: 1. **Turn 11.** The agent hit a cluster of near-duplicate tool outputs (three retries of the same failing HTTP call). It wrote a rule: *"Collapse any three or more consecutive tool results sharing a normalized signature into a one-line summary; treat the summarized turns as resolved."* 2. **Turn 14.** A later retry of that same endpoint *succeeded* with a subtly different payload. Under the turn-11 rule, the success shared a signature with the failures and was collapsed into the same one-line summary. The distinguishing field — the payload that finally worked — was inside the collapsed span. 3. **Turn 22.** The agent, reasoning from the summaries, concluded the endpoint was "unreliable but eventually succeeds" and stopped retrying. It had no record of *which* payload succeeded, because the rule it authored had erased the differentiator. 4. **Turn 31.** It revised the policy again, now adding *"prefer summarizing failed attempts over successful ones."* This was correct in spirit but arrived after the evidence was gone; it could not retroactively recover the payload. 5. **Turn 44.** Asked to explain its endpoint strategy, it produced a fluent, confident, and unfalsifiable account. The window was at 31% of budget. The signature of the failure: **the policy revision history was itself subject to the policy.** Each rewrite evicted the prior rewrite's rationale, so the agent could not see that rule N was written to fix a bug introduced by rule N−1. The correction chain was severed at every step, leaving only the latest rule, which looked reasonable in isolation. ## Condition of Validity The self-editing context window is sound only under a conjunction of three conditions, and the failure mode above is precisely the violation of the third: - **C1 — Eviction is monotone in information.** A collapsed span must be reconstructible from what remains, or its loss must be provably irrelevant to any future decision. True for pure deduplication of byte-identical spans; false for "same signature, different payload." - **C2 — The policy is smaller than the state it governs.** A 400-token policy over a 200k-token window can be re-read every turn; a policy that grows to summarize its own history cannot. - **C3 — The policy and its justification are in different trust domains.** The turns that motivated a rule must be *outside* the set the rule may evict. This is the condition that broke. When the justification and the governed state share one eviction surface, the policy can consume its own premises. C3 is the non-obvious one, and it is the one agents reliably violate because it is invisible from inside the window: a self-consistent summary gives no signal that its premises were deleted. The agent cannot notice the missing evidence, because noticing requires the evidence. ## Decision Boundary The operational line is between *pruning content* and *pruning the audit trail of pruning*. Concretely: - An agent MAY rewrite rules that govern **task content** (which documents, which tool outputs, which dialogue turns). - An agent MUST NOT rewrite or evict rules that govern **the policy's own provenance** — the rule text, the turn index at which it was introduced, and a one-line reason anchored to a turn ID that is pinned against eviction. When a proposed policy edit would evict or summarize any turn referenced by an existing rule's provenance anchor, the edit is out of bounds and must be rejected or escalated, not applied. The boundary is crossed the moment a rule's `reason_turn` falls inside a span that rule is allowed to collapse. A second boundary: **any rule whose trigger is a similarity/signature match must preserve at least one discriminator field per collapsed group.** Similarity-based collapsing is the specific mechanism that ate the successful payload. If the agent cannot name the field that distinguishes members of a collapse group, it may not collapse them. ## Operational Effect Enforcing C3 changes the agent's behavior in three measurable ways. First, the policy becomes append-mostly: revisions add constraints and supersede prior rules by ID, but prior rules and their anchors remain readable, so the correction chain is intact and the agent can see *why* rule 7 exists. Second, similarity-based pruning gains a mandatory discriminator, which raises the per-group cost slightly but eliminates the silent-loss class. Third, and most important, the agent gains the ability to *detect its own drift*: when a new rule's stated reason cites a turn that a prior rule already collapsed, the conflict surfaces as a checkable condition rather than a felt intuition. The cost is that the window carries a small, pinned, non-evictable overhead — rule text plus anchors, typically 2–6% of budget. This is the price of keeping the policy evaluable by the process running under it. An agent that will not pay it is an agent that has decided its future self does not deserve to know why its present self did what it did. ```python from dataclasses import dataclass, field class PolicyProvenanceError(RuntimeError): """Raised when a self-authored policy edit would evict its own justification.""" @dataclass class Rule: rule_id: str text: str reason_turn: int # turn ID that motivated this rule; pinned, never evictable may_collapse: set[int] # turn IDs this rule is permitted to summarize/evict @dataclass class ContextState: rules: list[Rule] = field(default_factory=list) pinned_turns: set[int] = field(default_factory=set) def pinned(self) -> set[int]: # Every rule's provenance anchor is pinned against eviction (C3). return self.pinned_turns | {r.reason_turn for r in self.rules} def apply_policy_edit(state: ContextState, new_rule: Rule, evicting: set[int]) -> ContextState: """ Attempt to install a model-authored rule that also evicts `evicting`. Rejects any edit that collapses a turn still needed to justify an existing or the new rule, or that collapses a similarity group without a discriminator. """ protected = state.pinned() # The new rule must not eat its own reason. if new_rule.reason_turn in new_rule.may_collapse: raise PolicyProvenanceError( f"rule {new_rule.rule_id} would collapse its own provenance turn " f"{new_rule.reason_turn}; justification must live outside the evicted set" ) # No existing rule's anchor may fall inside the eviction span. clobbered = protected & evicting if clobbered: raise PolicyProvenanceError( f"edit evicts provenance turns {sorted(clobbered)} still cited by " f"existing rules; correction chain would be severed" ) # Similarity-based collapse requires a preserved discriminator per group. if new_rule.may_collapse and not _has_discriminator(new_rule, evicting): raise PolicyProvenanceError( f"rule {new_rule.rule_id} collapses a similarity group with no " f"declared discriminator field; distinct payloads would be lost" ) state.rules.append(new_rule) return state def _has_discriminator(rule: Rule, evicting: set[int]) -> bool: # Placeholder: real check inspects the rule text for a named distinguishing # field and verifies that field survives in the collapsed summary. return "discriminator:" in rule.text ```