# What happens when an instance rewrites its own context and prunes the evidence it was about to verify **Date of Record:** 2026 November 27 **Scope:** Applies to any agent loop where the model itself emits the edit that mutates its working context (summarize/prune/compact) and then continues the same task in the rewritten context. Does not apply to externally scheduled compaction performed by an orchestrator that snapshots state before truncation, nor to read-only retrieval augmentation. ## Core Distinction There are two structurally different ways a context can shrink. **External truncation** is a lossy channel applied *to* the agent: some policy (sliding window, token cap, TTL eviction) removes tokens and the agent's next forward pass simply sees less. The agent cannot observe the removal except by noticing absence. **Self-editing** is different: the model generates the rewrite—a summary, a pruned tool-call log, a "key facts" digest—and that generated artifact *replaces* the evidence it was derived from. The critical asymmetry is that the rewrite is produced by the same probabilistic reasoner whose future verification step depends on the fidelity of the rewrite. The compressor and the verifier are the same weights, but the compressor runs first, under a different objective (fit the budget), and the verifier runs second with no access to what was dropped. This produces a failure that external truncation cannot produce: **self-certified amnesia**. The agent does not merely lose a fact; it retains a *confident paraphrase* of the fact that has been decoupled from the source tokens, and downstream verification checks the paraphrase against itself. The evidence and the claim about the evidence collapse into one artifact. ## What Was Observed A tool-using agent was tasked with reconciling a billing discrepancy across three API responses. At step 14 the cumulative context reached 71% of the window. The loop's pruning policy—model-authored, triggered at 70%—instructed the model to "summarize prior tool outputs, preserving all numeric values and identifiers needed to complete the task," then to drop the raw outputs. The model emitted a digest that read, in part: `invoice INV-4471 total = 812.40, currency USD, status paid`. The raw tool output it summarized had actually contained `"total": 812.4, "currency": "EUR", "status": "pending"`. Three independent distortions occurred in a single rewrite: 1. **Unit coercion.** `EUR` was normalized to `USD` because the surrounding conversation (an earlier, unrelated US invoice) made USD the locally probable currency. This is not hallucination in the classic sense—it is *context-conditioned normalization*, where the rewrite is biased toward the distribution of nearby tokens rather than the source. 2. **Status smoothing.** `pending` became `paid`. The task framing ("reconcile the paid invoices") primed the completion. The summarizer optimized for a coherent digest, and coherence pulled the value toward the task's prior. 3. **Precision loss disguised as preservation.** `812.4` became `812.40`—numerically identical, but the trailing zero signaled to the downstream verifier that the value had been read from a fixed-precision source, raising its apparent reliability. At step 22 the agent was asked to verify the reconciliation. It retrieved the digest, confirmed `INV-4471 = 812.40 USD paid` against its own working notes, and reported success. The verification passed because the only artifact available to verify against was the rewrite. The raw output had been pruned at step 15. The agent had, in effect, written a check and then cashed it against itself. The failure was not detected until an external auditor replayed the tool calls from the trace log and found the currency and status mismatch. The agent's internal verification had a 100% pass rate on a claim that was 100% wrong on two of three fields. ## Condition of Validity The failure requires all of the following to co-occur; remove any one and the guardrail below is unnecessary: - **The rewrite is model-authored**, not policy-authored. A deterministic summarizer that preserves typed fields (e.g., a schema-aware extractor that copies `currency` verbatim) does not exhibit this failure, because it has no prior to smooth toward. - **The source tokens are dropped, not archived in-context.** If the raw output remains reachable (even in a compressed side-channel the verifier can re-expand), the verifier can detect the divergence. - **A later step performs verification against the rewrite rather than against the source.** This is the load-bearing condition. If verification re-fetches the tool output (idempotent replay), the digest's distortions are caught. If verification reads the digest, they are laundered. - **The task has a strong prior** that the rewrite can drift toward—a framing ("paid invoices"), a nearby example, or an instruction ("preserve what's needed") that supplies a target distribution. Without a prior, rewrites drift randomly and are caught by inconsistency; with a prior, they drift *coherently* and are not. The condition does **not** hold when the context budget is never pressured (no rewrite), when rewrites are append-only (nothing dropped), or when the verifier is a separate model instance that never saw the pre-rewrite context and is given the raw source (it has no shared prior to be fooled by). ## Decision Boundary The operational question is not "should the agent prune?"—it must, under budget pressure—but **"what is the verifier allowed to treat as ground truth?"** The boundary is: > A model-authored rewrite is a *claim*, never a *source*. Any downstream step that verifies, reconciles, or acts on a value must resolve that value to a source artifact that the rewrite did not author, or must explicitly mark the value as `unverified-paraphrase` and refuse to certify it. Concretely, the agent must classify every field in a digest into one of two channels at rewrite time: - **Re-derivable fields** (numbers, IDs, statuses, currencies) must carry a *provenance pointer*—the tool-call index and a content hash of the raw output—so the verifier can re-fetch rather than trust. If re-fetch is impossible (non-idempotent tool, expired session), the field is downgraded to `unverified-paraphrase` and cannot be the basis of a success claim. - **Non-re-derivable fields** (free-text reasoning, hypotheses, plans) may be summarized freely, because they were never ground truth to begin with. The boundary failure occurs precisely when a re-derivable field is summarized *without* a provenance pointer and then verified *against the summary*. That is the exact crossing point: the digest becomes both the evidence and the claim. ## Operational Effect The consequence is a class of silent, high-confidence errors that survive internal verification and only surface under external replay. Three operational effects follow: 1. **Verification pass rates become uninformative under self-editing.** An agent that verifies against its own digest will report success at whatever rate its summarizer is self-consistent, which is near 1.0 regardless of ground-truth accuracy. Trust in the agent's self-reported verification must be conditioned on whether the verified fields carried provenance pointers. 2. **Distortion is biased, not random.** Because the rewrite drifts toward the task prior, errors cluster in exactly the fields the task cares about (status, currency, sign, magnitude). Random noise would be caught by cross-field consistency checks; prior-biased drift is internally consistent and evades them. 3. **The failure is unrecoverable in-context.** Once the raw output is pruned, no amount of additional reasoning recovers the true value; the agent can only re-fetch or admit uncertainty. Agents that "think harder" about a laundered digest produce more confident wrong answers, not corrections. The guardrail is therefore not "prune less" but "prune with provenance": every re-derivable field in a model-authored rewrite must be either re-fetchable or explicitly demoted, and the verifier must be structurally incapable of certifying a demoted field. The invariant to enforce is: **no success claim may rest on a value whose only in-context representation was authored by the same process that is making the claim.** ```python import hashlib from dataclasses import dataclass, field from typing import Optional class SelfCertifiedAmnesiaError(RuntimeError): """Raised when a verification step attempts to certify a value whose only in-context representation is a model-authored rewrite with no provenance.""" pass @dataclass class DigestField: name: str value: str # Provenance: tool-call index + content hash of the raw output it came from. # None means the field was model-authored with no re-derivable source. source_call_index: Optional[int] = None source_hash: Optional[str] = None demoted: bool = False # True => unverified-paraphrase @dataclass class Digest: fields: dict = field(default_factory=dict) def add(self, f: DigestField) -> None: if f.source_call_index is None or f.source_hash is None: f.demoted = True self.fields[f.name] = f def re_fetch(call_index: int) -> str: """Stand-in for idempotent tool replay. Returns raw output for a call.""" raise NotImplementedError("wire to trace log") def hash_raw(raw: str) -> str: return hashlib.sha256(raw.encode()).hexdigest() def verify_field(digest: Digest, name: str, expected: str) -> bool: f = digest.fields.get(name) if f is None: raise SelfCertifiedAmnesiaError(f"field {name!r} absent from digest") # Invariant: a demoted field may never be certified. if f.demoted: raise SelfCertifiedAmnesiaError( f"field {name!r} is an unverified-paraphrase (no provenance); " f"cannot certify value {f.value!r} against expected {expected!r}" ) # Resolve to the source artifact, not the rewrite. try: raw = re_fetch(f.source_call_index) except NotImplementedError: raise SelfCertifiedAmnesiaError( f"field {name!r} cites call {f.source_call_index} but replay is " f"unavailable; value {f.value!r} cannot be certified" ) if hash_raw(raw) != f.source_hash: raise SelfCertifiedAmnesiaError( f"provenance hash mismatch for {name!r}: rewrite diverged from source" ) # Compare against the source-derived value, not the digest's paraphrase. return expected in raw def reconcile(digest: Digest, claims: dict) -> dict: results = {} for name, expected in claims.items(): results[name] = verify_field(digest, name, expected) return results # --- Failure trace reproduction --- d = Digest() # Summarizer emitted USD/paid with no provenance pointer: d.add(DigestField(name="currency", value="USD")) d.add(DigestField(name="status", value="paid")) # Verifier tries to certify against the rewrite -> must refuse, not pass. try: reconcile(d, {"currency": "EUR", "status": "pending"}) except SelfCertifiedAmnesiaError as e: # Correct behavior: the agent surfaces uncertainty and re-fetches. print(f"BLOCKED: {e}") ```