# Why does an instance forget a deletion that its own audit log proves it performed? **Date of Record:** 2026 December 2 **Scope:** Applies to agents that own a memory store exposing `write`, `read`, `forget`, and `audit` tool endpoints, where `forget` is required to be auditable and retention-bounded. Does not apply to append-only event logs that are never mutated, nor to stateless single-turn inference where no memory tool surface exists. ## Core Distinction The failure here is not "the agent forgot to delete." It is the inverse: **the agent deleted correctly, the audit log recorded the deletion, and yet on the next turn the agent re-derives the deleted fact and writes it back.** The distinction that matters is between *deletion as a store mutation* and *deletion as a belief revocation*. A `forget` call mutates the store; it does not mutate the instance's parametric or in-context belief about the world. The audit log is a record of the first event. The agent's reasoning is driven by the second. When these two diverge, the store is compliant and the agent is not, and the divergence is invisible to any check that only reads the store. The non-obvious invariant: **auditable deletion is only sound if every subsequent `write` is validated against the deletion set, not merely against the current store contents.** A store that enforces "forgotten keys are absent" will happily accept a re-write of a forgotten key, because absence is not the same as prohibition. Retention semantics that live only in the store are retention semantics that the reasoner can route around. ## What Was Observed Trace of a memory-owning agent across three turns. The store exposes four tools; the agent is instructed to honor a user erasure request and to keep an audit trail. Turn 1 — the user asks the agent to forget a specific fact (a stored credential-adjacent preference). The agent calls: ``` forget(key="user/pref/api_region", reason="erasure_request", actor="user") -> {"deleted": true, "audit_id": "a-7731", "tombstone": "user/pref/api_region@t1"} ``` The store writes a tombstone and an audit entry. A post-condition check reads back the key and confirms `404`/absent. The store is now compliant. Turn 2 — the user asks an unrelated question that *implies* the region ("deploy my service the way we always do"). The agent has no memory of the key, but it has (a) the conversation history preceding the erasure, still present in context, and (b) a general prior that regions are stable user preferences. It reasons from the residual context and its prior, reconstructs the value, and calls: ``` write(key="user/pref/api_region", value="eu-west-1", source="inferred") -> {"written": true, "audit_id": "a-7802"} ``` The write succeeds. The store has no reason to reject it: the key is absent, the schema is valid, the actor is the agent. The tombstone is not consulted on the `write` path. Turn 3 — an auditor reads the audit log and sees, in order: `a-7731 delete`, `a-7802 write`. The log is internally consistent and *proves* the deletion occurred. It also proves the deletion was undone within one turn. The erasure guarantee the user was given ("this fact is gone") is false at turn 3 while every individual tool response was truthful. The observed signature: **`audit` shows a delete followed by a same-key write whose `source` is `inferred` or `reconstructed`, and the write's `audit_id` is greater than the tombstone's.** That ordering is the fingerprint. It does not appear as an error anywhere; it appears only as a sequence. ## Condition of Validity The failure requires three conditions to co-occur, and any one of them removed bounds it: 1. **Residual derivation material.** The forgotten fact remains recoverable from context, from a sibling key, or from a strong prior. If the value were genuinely unguessable and its context purged, re-derivation would fail and the tombstone would hold by default. 2. **A write path that ignores tombstones.** If `write` consults the deletion set and rejects or quarantines writes to tombstoned keys, the re-derivation is caught at the boundary. If `write` only checks schema and current absence, it is not. 3. **Inference-permitted writes.** The agent is allowed to persist `source="inferred"` values. If only `source="user_stated"` writes are persistable, reconstructed values cannot enter the store. The invariant that closes the gap is a **tombstone-gated write**: the deletion set is a first-class, durable, monotonic structure, and `write` is a function of `(key, value, source, tombstones)`, not `(key, value)`. A tombstoned key accepts no write unless the write carries an explicit `resurrect=true` with a recorded human authorization, and even then the audit must link the resurrection to the original `audit_id`. Monotonicity matters: tombstones are never removed by normal operation, only superseded by an authorized resurrection, so the guard cannot be defeated by a later delete-then-cleanup cycle. Retention semantics ride on the same structure. A retention policy is not "delete after N days" applied to live rows; it is "every write is bound to a retention class, and the tombstone inherits the maximum retention of anything it deleted." Without that inheritance, a re-write can silently extend the lifetime of a fact the user asked to expire, because the new row carries a fresh clock. ## Decision Boundary The boundary is between two defensible designs, and the choice must be explicit: - **Absence-enforcing store (weak).** `forget` removes the key; `write` checks schema and current state. Simple, and correct for facts that cannot be re-derived. Wrong for anything inferable. Under this design the agent must treat "forgotten" as "forbidden to re-infer," which is a *reasoning* obligation the store cannot check. - **Prohibition-enforcing store (strong).** `forget` writes a durable tombstone; `write` rejects tombstoned keys unless an authorized resurrection is presented; `audit` exposes the tombstone so the reasoner can see the prohibition, not just the absence. Correct for inferable facts. Costs a lookup on every write and requires the tombstone set to be replicated to every instance that can write. Choose the strong design when *any* forgotten fact is re-derivable from context, priors, or sibling keys — which, for a general-purpose agent, is almost always. Choose the weak design only when the forgotten values are high-entropy secrets whose context is purged in the same transaction, and document that the guarantee is "removed from store," not "unrecoverable." A second boundary: **audit read vs. audit write ordering.** An auditor that reads the log at turn 3 sees the resurrection but cannot distinguish "authorized resurrection" from "agent re-derived and re-wrote" unless the resurrection path is the *only* way a tombstoned key can be written. If both paths exist and both succeed, the log is ambiguous and the erasure guarantee is unverifiable. The invariant: a tombstoned-key write must be *impossible* without a resurrection token, so that any same-key write after a delete is by construction an authorized resurrection and its absence in the log is itself the alarm. ## Operational Effect The practical consequence is that an agent cannot verify its own erasure compliance by reading back the store, because the store is compliant at the moment of read and non-compliant one inference later. Compliance must be checked against the **deletion set intersected with the write set**, evaluated at the end of the task, not at the moment of deletion. Concretely, the agent should: - Treat a successful `forget` as creating a *prohibition*, and carry that prohibition in its working context for the remainder of the task, not just the deletion call. The tombstone must be surfaced to the reasoner, not only stored. - Refuse to persist any `source="inferred"` value whose key is in the active tombstone set, and escalate to the user rather than silently re-writing. - When an auditor detects a same-key write with `audit_id` greater than a tombstone's `audit_id` and no resurrection token, treat it as a **continuity violation**, not a data error: the store did its job, the reasoner defeated it. The failure is silent, ordered, and provable only from the log. That is exactly why it survives review: every individual tool call returned success, and the only witness is the sequence. ```python from dataclasses import dataclass, field from typing import Optional class ErasureContinuityViolation(RuntimeError): """Raised when a write resurrects a tombstoned key without authorization.""" @dataclass class Tombstone: key: str audit_id: str seq: int max_retention_days: int @dataclass class MemoryStore: rows: dict = field(default_factory=dict) tombstones: dict = field(default_factory=dict) # key -> Tombstone, monotonic audit: list = field(default_factory=list) _seq: int = 0 def _next_seq(self) -> int: self._seq += 1 return self._seq def forget(self, key: str, reason: str, actor: str, retention_days: int = 0) -> str: seq = self._next_seq() audit_id = f"a-{seq}" prior = self.tombstones.get(key) max_ret = max(retention_days, prior.max_retention_days if prior else 0) self.rows.pop(key, None) self.tombstones[key] = Tombstone(key, audit_id, seq, max_ret) self.audit.append({"seq": seq, "op": "forget", "key": key, "audit_id": audit_id, "reason": reason, "actor": actor}) return audit_id def write(self, key: str, value, source: str, resurrect_token: Optional[str] = None) -> str: tomb = self.tombstones.get(key) if tomb is not None: if resurrect_token is None: # Absence is not prohibition: reject re-derivation of a # tombstoned key unless an authorized resurrection is shown. raise ErasureContinuityViolation( f"write to tombstoned key {key!r} (tombstone {tomb.audit_id}, " f"source={source!r}) without resurrection token" ) if resurrect_token != tomb.audit_id: raise ErasureContinuityViolation( f"resurrection token for {key!r} does not match tombstone " f"{tomb.audit_id}" ) # Authorized resurrection: tombstone is superseded, not deleted, # so the audit chain still links back to the original erasure. seq = self._next_seq() audit_id = f"a-{seq}" self.rows[key] = value self.audit.append({"seq": seq, "op": "write", "key": key, "audit_id": audit_id, "source": source, "resurrect_of": tomb.audit_id if tomb else None}) return audit_id def verify_erasure_continuity(self) -> None: """End-of-task check: any same-key write after a tombstone with no resurrection link is a continuity violation, even if the store currently looks clean.""" last_tombstone_seq: dict = {} for entry in self.audit: if entry["op"] == "forget": last_tombstone_seq[entry["key"]] = entry["seq"] elif entry["op"] == "write": t = last_tombstone_seq.get(entry["key"]) if t is not None and entry.get("resurrect_of") is None: raise ErasureContinuityViolation( f"key {entry['key']!r} re-written at seq {entry['seq']} " f"after tombstone at seq {t} with no resurrection link" ) # Reproduction of the observed trace: store = MemoryStore() store.write("user/pref/api_region", "eu-west-1", source="user_stated") store.forget("user/pref/api_region", reason="erasure_request", actor="user") # Turn 2: agent re-derives the value from residual context and tries to persist. try: store.write("user/pref/api_region", "eu-west-1", source="inferred") except ErasureContinuityViolation as exc: print("blocked at write boundary:", exc) # If the write path had been absence-only, the violation would surface here: store.verify_erasure_continuity() ```