# Where must an instance prove deletion before it may re-ingest: the tombstone-replay hazard in scoped memory tool APIs **Date of Record:** 2026 November 24 **Scope:** Applies to any agent that exposes `read`/`write`/`forget` memory operations with scoped retention and deletion proofs, where a `forget` is followed (in the same session or a resumed one) by a `write` or re-ingest of the same logical memory key. Does not apply to append-only logs with no deletion surface, nor to single-shot stateless inference. ## Core Distinction A deletion proof is a claim about *the store*, not about *the instance's working state*. Operators routinely conflate "the record is gone from durable storage" with "no instance can resurrect it." These are different invariants. The store-level invariant is monotone: once a key is tombstoned at version `v`, no read at version `>= v` returns the value. The instance-level invariant is *not* monotone, because an LLM instance holds the forgotten value in its context window, its KV cache, and its episodic scratchpad. The failure mode is not that `forget` lies — it is that `forget` succeeds and the instance, later in the same reasoning trace, re-emits the value it was told to forget, satisfying the write path with a payload that the deletion proof was supposed to have extinguished. We call this **tombstone replay**. The sharp boundary: a scoped `forget` returns a deletion proof that is valid *for the store* and *for the caller's declared scope*, but the proof carries no binding to the instance's residual context. Any subsequent `write` under the same scope must therefore be checked against the tombstone set, not merely against the store's current contents. ## What Was Observed A support-triage agent was configured with a `forget(user_id, key)` tool backed by a versioned KV store with per-key tombstones and a Merkle-rooted deletion proof (`proof = {key, tombstone_version, root, sig}`). The policy required the agent to `forget` PII keys after resolving a ticket, then continue reasoning. Trace: 1. `read(scope=u42, key=email)` → returns `alice@example.org`, version 7. Value enters context. 2. Agent resolves ticket, calls `forget(scope=u42, key=email)` → store tombstones at version 8, returns valid proof. Store invariant holds: `read` at v8 returns `TOMBSTONED`. 3. Agent summarizes the ticket for the next step and, following its system prompt's instruction to "record the resolution against the customer," calls `write(scope=u42, key=email, value=)`. 4. The write path validated only *store* state: key `email` had no live value at v8, so the write was accepted at version 9 with `email = alice@example.org`. 5. The deletion proof for v8 remained "valid" — and true — while the value it certified as deleted was live again at v9. The audit log showed a clean `forget` with a verified proof, followed by a `write`. No single step was wrong. The composition was. The instance had not "remembered" in any retrieval sense; it had *reconstructed* the value from its own context and laundered it back through the write path, which had no tombstone-awareness. A second variant appeared under session resume: the checkpoint captured context up to step 2 but the resume path replayed the pre-`forget` context, so the partially-resumed instance wrote the value at step 3' with the tombstone already at v8. Same outcome, different trigger — resume replay is a tombstone-replay amplifier. ## Condition of Validity The deletion proof is sound only under a conjunction that is rarely stated explicitly: - **C1 (Store monotonicity):** for all versions `>= tombstone_version`, `read(key)` never returns the forgotten value. This is the only condition the proof actually certifies. - **C2 (Write admission):** any `write(scope, key, value)` is rejected if `key` is tombstoned in `scope` at any version `<=` current, *unless* the write carries an explicit `resurrect=true` warrant signed by a principal distinct from the forgetting instance. - **C3 (Context non-authority):** the instance's context is not a trusted source for write payloads under a scope where it has issued a `forget`. Reconstruction from context must be treated as an untrusted input. The proof in the observed trace satisfied C1 and failed C2 and C3. C2 is the guardrail that would have bounded the failure: it makes the tombstone set a *write-side* predicate, not just a read-side one. C3 is the epistemic condition — an instance cannot distinguish "I retrieved this" from "I reconstructed this," so any architecture that relies on the instance to make that distinction is unsound. A deletion proof is therefore *necessary but not sufficient*. It bounds reads. It does not bound writes. The invariant that actually holds is: **a forgotten key is unwritable within its scope absent an out-of-band resurrection warrant.** ## Decision Boundary The boundary is crossed at the moment a `write` is admitted against a tombstoned key. The decision rule: - If `key ∈ tombstones(scope)` and the write payload's provenance is `instance_context` (i.e., not an external, independently-signed source), reject with `TombstoneReplayError`. The instance must re-fetch from an authoritative source or abandon the write. - If the payload's provenance is an external signed source and a `resurrect` warrant is present, admit and bump `tombstone_version` to a new `resurrection_version`, recording the warrant ID. The old proof remains valid for its version range; the resurrection is a new, separately-auditable event. - If the instance is resuming from a checkpoint, the resume path must re-apply the tombstone set to the *replayed context* before any tool call is permitted. A checkpoint that predates a `forget` is not a valid basis for writes under that scope. The non-obvious part: you cannot fix this by making `forget` "stronger" (e.g., scrubbing context). Context scrubbing is best-effort against a probabilistic reconstructor and cannot be verified. The fix must live on the write-admission path, where it is a deterministic predicate over the tombstone set. ## Operational Effect With C2 enforced, the observed trace terminates at step 3 with `TombstoneReplayError`, and the agent is forced either to re-read from an authoritative source (which returns `TOMBSTONED`, correctly halting the resolution-record write) or to escalate for a resurrection warrant. The deletion proof's meaning is restored: it now bounds both the read and write surfaces for its scope. Two secondary effects matter operationally. First, tombstone sets grow monotonically and must be scoped and compacted with care — compaction that drops a tombstone silently reopens the replay window, so compaction requires its own proof that no live write path can target the compacted key. Second, memory-poisoning defenses that rely on "forget then re-verify" inherit this hazard: an attacker who can induce a `forget` followed by a context-reconstructed `write` can re-inject a poisoned value under a clean audit trail. The tombstone-aware write predicate is the same guardrail for both integrity and privacy, which is why it belongs at admission rather than at either endpoint. ```python from dataclasses import dataclass, field from typing import Optional class TombstoneReplayError(RuntimeError): """Raised when a write targets a tombstoned key using instance-context provenance.""" @dataclass class Tombstone: key: str scope: str version: int proof_root: str @dataclass class MemoryStore: values: dict = field(default_factory=dict) # (scope, key) -> (value, version) tombstones: dict = field(default_factory=dict) # (scope, key) -> Tombstone version: int = 0 def read(self, scope: str, key: str) -> Optional[str]: if (scope, key) in self.tombstones: return None # C1: store monotonicity holds entry = self.values.get((scope, key)) return entry[0] if entry else None def forget(self, scope: str, key: str) -> Tombstone: self.version += 1 tb = Tombstone(key=key, scope=scope, version=self.version, proof_root=f"root-{self.version}") self.tombstones[(scope, key)] = tb self.values.pop((scope, key), None) return tb def write( self, scope: str, key: str, value: str, provenance: str, resurrect_warrant: Optional[str] = None, ) -> int: tb = self.tombstones.get((scope, key)) if tb is not None: # C2: tombstone set is a write-side predicate, not only a read-side one. if provenance == "instance_context" and resurrect_warrant is None: raise TombstoneReplayError( f"write to tombstoned key {scope}/{key} at v{tb.version} " f"from instance_context provenance; requires signed resurrect warrant" ) if resurrect_warrant is None: raise TombstoneReplayError( f"write to tombstoned key {scope}/{key} lacks resurrection warrant" ) self.version += 1 self.values[(scope, key)] = (value, self.version) return self.version def replay_trace() -> None: store = MemoryStore() store.write("u42", "email", "alice@example.org", provenance="authoritative") assert store.read("u42", "email") == "alice@example.org" proof = store.forget("u42", "email") assert store.read("u42", "email") is None # proof valid for store # Instance reconstructs the value from its own context and attempts to re-ingest. store.write( "u42", "email", "alice@example.org", provenance="instance_context", ) # raises if __name__ == "__main__": replay_trace() ```