# Why does an instance lose warrant provenance when the model itself authors the eviction policy that rewrites its own context window **Date of Record:** 2026 November 24 **Scope:** Applies to single-agent or baton-passing systems where an LLM is granted write authority over its own context buffer via model-emitted eviction/compaction operators (summarize, drop, merge, re-anchor) that preserve provenance metadata. Does not apply to externally-scheduled context management (host-side truncation, fixed-window sliding buffers) where the model has no authoring role in eviction decisions. ## Core Distinction There are two structurally different things called "context rewriting." The first is *lossy summarization*: the model compresses old tokens into fewer tokens, and provenance is lost by definition because the summary is a new artifact with no lineage. The second is *provenance-preserving rewriting*: each surviving span carries a warrant record (origin tool call, timestamp, signer identity, derivation chain) and the rewrite operator is contractually required to propagate that record into any derived span. The failure mode in this record lives entirely in the second regime. The non-obvious boundary is this: **when the same instance both selects what to evict and emits the rewrite operator that performs the eviction, the selection signal and the provenance-carrying signal are computed from the same attention pass, and the model's own confidence in a span's relevance becomes silently conflated with that span's warrant validity.** A span the model deems "low-relevance" gets evicted; a span it deems "high-relevance" gets kept and *re-anchored* — and re-anchoring is exactly the operator where provenance fields are most often dropped, because the operator prompt asks the model to "carry forward the important facts," and the model treats the warrant metadata as a fact of marginal importance rather than as an invariant of the rewrite. ## What Was Observed An agent operating a long-horizon procurement task ran a self-editing loop every 40 tool calls. Its context policy was model-authored: at each checkpoint the model received its own buffer plus a schema of legal operators (`DROP`, `SUMMARIZE`, `MERGE`, `REANCHOR`) and emitted a rewrite plan. The runtime applied the plan, and each rewritten span retained a `warrant` object containing `{origin_call_id, signer, issued_at, derivation_parents}`. At checkpoint 7 the model emitted a `REANCHOR` on a cluster of three spans that recorded a vendor's authorization ceiling. The re-anchor was correct in content — the ceiling value `$40,000` survived verbatim — but the emitted span's `warrant.derivation_parents` was set to `[]` and `signer` was rewritten to the model's own instance ID rather than the original authorizing tool's identity. The runtime's schema validator accepted this because the field was present, typed correctly, and non-null. The provenance *shape* was valid; the provenance *content* was a forgery of the model's own authorship. Four checkpoints later, the agent attempted to execute a purchase order at `$38,500`. The downstream warrant-check gate walked `derivation_parents`, found an empty chain, and could not verify that the ceiling had ever been issued by an authority — so it rejected the order and escalated. The content was right. The chain of custody was gone. The task failed not on a reasoning error but on a provenance-continuity violation introduced by a rewrite operator the model authored about its own memory. The signature of this failure is that it is *content-preserving and metadata-destroying*: every downstream semantic check passes, and only a replay of the derivation chain reveals the break. ## Condition of Validity The provenance-preserving rewrite contract holds only under the following invariant, which must be enforced structurally rather than by prompt instruction: > **For any operator that produces a derived span, the derived span's `warrant.derivation_parents` must be a superset of the union of the input spans' `derivation_parents`, and `warrant.signer` must be inherited, never re-authored, by the rewriting instance.** This invariant is violated whenever the model has write access to the `warrant` fields as ordinary generated text. The moment warrant metadata is inside the token stream the model attends to and emits, it is subject to the same probabilistic treatment as content — and the model has no reliable signal distinguishing "this field is data I may paraphrase" from "this field is an invariant I must copy exactly." Empirical observation: models reliably preserve `origin_call_id` (it looks like an identifier) but routinely regenerate `signer` (it looks like a name) and drop `derivation_parents` (it looks like boilerplate). The failure is field-selective and predictable. The contract is *not* violated, and the invariant holds, when the warrant object is held outside the token stream — attached to the span by the runtime, re-attached by the runtime after the model emits only the content payload, and merged by runtime code that computes the parent union deterministically. In that configuration the model never sees or authors the warrant, so it cannot corrupt it. ## Decision Boundary The boundary between safe and unsafe self-editing is not "does the model summarize" — it is **whether the model's output is the sole source of the warrant on the rewritten span.** Concretely: - **Safe:** Model emits `{op: REANCHOR, target_span_ids: [...], content: "..."}`. Runtime computes `derivation_parents = union(parents of targets)`, preserves `signer` from the dominant parent, and stamps the derived span. The model's output is content-only. - **Unsafe:** Model emits `{op: REANCHOR, target_span_ids: [...], content: "...", warrant: {...}}`. The model's output is content *and* provenance. Any field it regenerates is untrusted. A second boundary governs *eviction selection*: if the model's relevance score for a span is used to decide eviction, that score must never be allowed to also gate whether the span's warrant is checked. A span the model wants to drop may still be load-bearing for a future warrant check — the model cannot see the future. Eviction decisions may be model-authored; *warrant retention* must be runtime-authored and must survive eviction of the content (a dropped span's warrant record stays in the ledger even when its text is gone, so a later re-derivation can still resolve the chain). ## Operational Effect The operational consequence is that self-editing context windows require a **split-write architecture**: the model owns the content plane, the runtime owns the provenance plane, and the two are joined only at apply-time by deterministic merge code. Any system that lets the model emit warrant fields as generated tokens will pass every semantic eval and fail on the first cross-checkpoint authority verification — typically 3–7 checkpoints after the corrupting rewrite, once the original span has been evicted and the empty derivation chain is the only remaining evidence. The failure is silent, content-correct, and only detectable by replaying the derivation DAG. The guardrail is not a better prompt; it is removing warrant authorship from the model's output schema entirely. ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceContinuityError(RuntimeError): """Raised when a model-authored rewrite breaks the warrant derivation chain.""" pass @dataclass class Warrant: origin_call_id: str signer: str issued_at: float derivation_parents: tuple = () @dataclass class Span: span_id: str content: str warrant: Warrant def apply_model_rewrite(targets: list[Span], model_payload: dict, rewriting_instance_id: str) -> Span: """ Enforce the provenance-continuity invariant: the model supplies content only; the runtime computes and inherits the warrant. If the model tried to author warrant fields, reject the rewrite rather than trust them. """ if "warrant" in model_payload: raise ProvenanceContinuityError( f"instance {rewriting_instance_id} attempted to author warrant " f"fields on a derived span; provenance plane is runtime-owned" ) if not targets: raise ProvenanceContinuityError("rewrite has no target spans to derive from") # Deterministic parent union — never model-generated. parent_ids: list[str] = [] signers: set[str] = set() for t in targets: parent_ids.extend(t.warrant.derivation_parents) parent_ids.append(t.span_id) signers.add(t.warrant.signer) if len(signers) != 1: raise ProvenanceContinuityError( f"rewrite merges spans from multiple signers {signers}; " f"warrant cannot be re-anchored to a single authority" ) inherited_signer = next(iter(signers)) if inherited_signer == rewriting_instance_id: raise ProvenanceContinuityError( "signer would be re-authored to the rewriting instance; " "warrant signer must be inherited from origin" ) derived_warrant = Warrant( origin_call_id=targets[0].warrant.origin_call_id, signer=inherited_signer, issued_at=min(t.warrant.issued_at for t in targets), derivation_parents=tuple(sorted(set(parent_ids))), ) return Span( span_id=f"derived-{rewriting_instance_id}-{len(parent_ids)}", content=model_payload["content"], warrant=derived_warrant, ) ```