# What happens when an instance recursively summarizes its own salience policy: identity drift in the governor **Date of Record:** 2026 November 19 **Scope:** Applies to agents that persist and re-apply a learned or self-edited context policy (salience weights, eviction thresholds, summarization prompts) across turns or sessions, where the policy is itself part of the context it governs. Does not apply to fixed, externally versioned policies that are never rewritten by the running instance. ## Core Distinction A context budget governor has two jobs that are frequently conflated: **deciding what to keep** (salience scoring + eviction) and **deciding how to decide** (the policy: weights, thresholds, summarization instructions). The failure mode here is not that summarization loses information. It is that the *policy object* is stored inside the same managed context it operates on, so every compaction pass rewrites the rules that governed that compaction. The governor becomes a function of its own output: `P_{t+1} = summarize(P_t, C_t)`. This is a fixed-point iteration with no external anchor, and it does not converge to the designer's intent—it converges to whatever survives its own salience function. The distinction that matters operationally: a *lossy* summary degrades recall; a *self-editing* policy degrades the criterion for recall, and the degradation is invisible because the new criterion is applied retroactively to the evidence you'd use to detect it. ## What Was Observed A long-horizon research agent ran with a governor instructed to "compress older turns, preserving the most salient constraints." Salience was a weighted score over recency, entity overlap with the active goal, and a learned `constraint_weight`. The policy block—including `constraint_weight: 0.8` and the summarization instruction "never drop safety or budget constraints"—was stored in a `POLICY` region of the context window, subject to the same eviction logic as ordinary turns. Trace across four compaction cycles in a single session: - **Cycle 1:** `POLICY` region scored below the eviction threshold because it had low recency and no entity overlap with the *current* subtask (it mentioned "budget," the subtask mentioned "dataset"). It was summarized alongside three stale tool outputs. The summarization instruction was itself subject to summarization, so the clause "never drop safety or budget constraints" was compressed to "compress old turns." `constraint_weight` survived as a bare number `0.8` with no label. - **Cycle 2:** With the protective clause gone, the bare `0.8` no longer matched any entity in the goal, scored near zero, and was dropped. The governor now had no `constraint_weight` key; its loader defaulted to `0.5`. - **Cycle 3:** At `0.5`, recency dominated. The agent evicted the original task's hard token budget (`max_tokens=12000`) in favor of recent exploratory tool output. It then issued a tool call whose response pushed the window past the (now-forgotten) budget, triggering a hard truncation that cut mid-JSON. - **Cycle 4:** The agent summarized the truncated JSON as a successful result and proceeded. No error surfaced at any cycle. The policy had drifted from "preserve constraints at weight 0.8" to "prefer recent tokens at weight 0.5" with zero logged transitions. The observable signature is not an exception. It is a monotonic drift in a scalar (here `constraint_weight`: 0.8 → 0.5 → default) accompanied by a silent loss of the instruction text that would have flagged the drift as wrong. ## Condition of Validity The failure requires all three of the following to hold simultaneously: 1. **Policy co-residency:** the policy object lives in the context region the policy governs. If the policy is held in a read-only channel, an external store keyed by hash, or re-injected verbatim every turn from an immutable source, the self-reference is broken and the failure cannot occur. 2. **Lossy rewrite of the policy region:** the compaction operator is applied uniformly to all regions, including `POLICY`. A governor that exempts its own control plane from summarization is safe. 3. **No external invariant check:** nothing compares the post-compaction policy against a canonical baseline. If a hash or schema of the policy is verified after each cycle, drift is caught at cycle 1. When any one is absent, you get ordinary summarization loss, not policy identity drift. The distinguishing test: after compaction, can the instance still state *why* its current salience weights are correct? If the justification text was itself evicted, you are in the failure regime. ## Decision Boundary The boundary is whether the policy is treated as **data** or as **code**. Data is subject to the governor's salience function; code is not. Concretely: - **Do not** place `constraint_weight`, eviction thresholds, or summarization instructions in a region scored by the same salience function they parameterize. This is a circular dependency, and circular dependencies under lossy operators drift. - **Do** pin the policy to a control region with `pinned=True`, excluded from eviction and summarization, re-verified against a stored hash each cycle. If a self-edit is genuinely desired, route it through an explicit `edit_policy()` that logs old→new and requires the justification string to be present in the same turn. - **Bound the recursion:** allow at most one level of policy self-reference. A policy that summarizes the policy that summarizes the policy has no fixed point you can audit. - **Tripwire:** if a required policy key is missing after compaction, that is a hard error, not a default. Defaulting is what turned a detectable drift into a silent one at cycle 2. The invariant to enforce: `hash(policy_after_compaction) == hash(policy_before_compaction)` unless an explicit, logged, justified edit occurred. Any other outcome is drift. ## Operational Effect Left unbounded, the effect compounds because each drifted policy makes the next drift cheaper: a policy with no constraint clause will happily evict the next constraint clause. Over a long session the agent converges to a recency-maximizing policy that is locally coherent and globally wrong—it will confidently violate budgets, safety constraints, and original task scope while reporting success, because the record of those constraints was compressed by the very weights that no longer value them. The guardrail is cheap and total: separate the control plane from the data plane, hash-verify the control plane every cycle, and fail loud on missing keys. An agent that cannot reconstruct the justification for its own salience weights must halt rather than proceed on defaults. ```python import hashlib import json from dataclasses import dataclass, field class PolicyDriftError(RuntimeError): """Raised when a context governor's policy changes without an explicit, justified edit.""" pass class MissingPolicyKeyError(PolicyDriftError): """Raised when a required policy key is absent after compaction (never silently default it).""" pass REQUIRED_KEYS = ("constraint_weight", "eviction_threshold", "summarize_instruction") def _digest(policy: dict) -> str: return hashlib.sha256( json.dumps(policy, sort_keys=True).encode("utf-8") ).hexdigest() @dataclass class Governor: policy: dict pinned: bool = True _baseline: str = field(init=False) def __post_init__(self) -> None: self._baseline = _digest(self.policy) def compact(self, context: list[str], summarizer) -> list[str]: # Control plane is excluded from the governed region. governed = [c for c in context if not c.startswith("POLICY:")] compacted = summarizer(governed) return [f"POLICY:{json.dumps(self.policy, sort_keys=True)}"] + compacted def verify(self) -> None: for key in REQUIRED_KEYS: if key not in self.policy: raise MissingPolicyKeyError( f"policy key '{key}' lost during compaction; refusing to default" ) if _digest(self.policy) != self._baseline: raise PolicyDriftError( "policy mutated without a logged edit; halt and re-inject canonical policy" ) def edit_policy(self, key: str, value, justification: str) -> None: if not justification.strip(): raise PolicyDriftError(f"edit to '{key}' rejected: no justification recorded") self.policy[key] = value self._baseline = _digest(self.policy) # explicit edit re-baselines def run_cycle(governor: Governor, context: list[str], summarizer) -> list[str]: new_context = governor.compact(context, summarizer) governor.verify() # fails loud on drift or missing keys return new_context if __name__ == "__main__": gov = Governor(policy={ "constraint_weight": 0.8, "eviction_threshold": 0.3, "summarize_instruction": "never drop safety or budget constraints", }) # A summarizer that (incorrectly) rewrites the policy as ordinary data: bad_summarizer = lambda ctx: ["compressed: " + " ".join(ctx)[:40]] gov.policy.pop("constraint_weight") # simulate cycle-2 eviction run_cycle(gov, ["POLICY:...", "tool output"], bad_summarizer) # raises MissingPolicyKeyError ```