# When must an instance refuse to forget: tombstone resurrection under re-derivation in provenance-tracked agent memory **Date of Record:** 2026 December 1 **Scope:** Applies to agents that expose `read`/`write`/`forget` memory tools where `forget` carries a deletion guarantee (GDPR erasure, PII purge, user "forget this" intent) and where memory entries record derivation provenance (`derived_from`, `source_ids`). Does not apply to append-only audit logs that are legally exempt from erasure, nor to stateless single-turn agents with no persistence layer. ## Core Distinction A deletion guarantee is a statement about *the absence of recoverable content*, not about the absence of a row. Most memory tool implementations treat `forget(id)` as a row-level tombstone: the record is marked deleted, reads return `None`, and the operation reports success. This is sufficient for the *direct* record. It is not sufficient for the *derived* record. When an agent has previously distilled a forgotten episode into a semantic memory entry — a summary, a profile attribute, an embedding, a cached inference — the tombstone on the source does not propagate to the derivative unless the derivative's provenance edge is walked at deletion time. The boundary failure is that the derivative remains readable, and worse, remains *re-derivable*: a later consolidation pass that re-reads surviving siblings can reconstruct the forgotten content without ever touching the tombstoned row. The invariant that must hold is not "the row is gone" but "no live record is reachable from, or reconstructible by, the forgotten row's content." Those are different predicates, and the second one is the one the deletion guarantee actually promises. ## What Was Observed A memory service exposed three tools: `memory.write(content, provenance)`, `memory.read(query)`, and `memory.forget(memory_id, guarantee="hard")`. Episodic entries were written per conversation turn with `provenance.source_ids` pointing at the raw turn. A nightly distillation job (`consolidate`) read recent episodic entries, produced semantic entries ("user's employer is X", "user relocated to Y in March"), and wrote them with `provenance.derived_from=[episodic_id, ...]`. The failure trace, reproduced deterministically: 1. Turn 41 writes episodic `E41` containing a home address. `provenance.source_ids=["turn_41"]`. 2. Nightly consolidation reads `E41` and `E42`, emits semantic `S7` ("user's primary residence is
"), with `derived_from=["E41","E42"]`. The consolidation prompt summarized rather than quoted, so no substring match existed between `S7.content` and `E41.content`. 3. User issues erasure. `memory.forget("E41", guarantee="hard")` tombstones `E41`, scrubs its content, returns `{"deleted": true, "derived_purged": 0}`. The `derived_purged` count is zero because the implementation only cascades provenance edges recorded in the *inverse* index, and the inverse index was built lazily — `S7` was written before the index entry for `E41 → S7` was materialized. 4. A subsequent `memory.read("where does the user live")` returns `S7`. The address is served from a record whose source was erased. 5. Worse: a second consolidation pass re-reads `E42` (still live) and *re-emits* `S7'` with the same address, because `E42` contained a partial mention that the summarizer completed using parametric knowledge. The forgotten content is now regenerated with no provenance edge to `E41` at all. Step 5 is the non-obvious part. Deletion of a source does not merely leave derivatives orphaned; it can leave *latent reconstructability* in surviving siblings that share partial context. The tombstone is a point deletion in a graph where the sensitive content is a *distributed property* of a neighborhood. ## Condition of Validity The row-level tombstone is a valid deletion guarantee only under the conjunction: - **(a) Provenance is complete and eager.** Every write that consumed a source records the edge at write time, and the inverse index is updated transactionally with the write, not by a background job. If the index is eventually consistent, there is a window in which a derivative exists with no back-edge, and `forget` cannot find it. - **(b) Derivatives are content-independent of the source's sensitive span.** True only when the derivative is a pure function of non-sensitive fields. A summary that paraphrases a sensitive span violates this even with no substring overlap. - **(c) No sibling carries reconstructable residue.** The forgotten content must not be inferable from the surviving neighborhood. This is almost never checkable by string matching; it requires a semantic check. - **(d) The consolidation pass is tombstone-aware.** Re-derivation must consult the tombstone set and refuse to emit a record whose reconstruction would depend on erased content. The guarantee fails if any one of these is false, and in practice (a) and (d) are the ones that silently break, because they fail *without an error* — `forget` returns success while the content remains reachable. ## Decision Boundary The agent must decide, at `forget` time, between three actions, and the choice is not free: - **Point-tombstone (cheap, unsound alone):** mark the row, return `derived_purged=0`. Admissible only when the inverse index is provably complete (condition a) *and* the caller accepts that derivatives are out of scope. This must be surfaced to the caller, not hidden behind `deleted: true`. - **Cascading purge (sound, expensive):** walk the inverse provenance closure, tombstone every reachable derivative, and — critically — record the erased content's *semantic fingerprint* (a salted hash of normalized content, or a set of n-gram hashes) in a tombstone ledger that the consolidation pass consults before emitting. This is the only option that satisfies (b)–(d) for paraphrased derivatives. - **Refuse-and-escalate:** when the inverse closure cannot be computed (index incomplete, derivative count exceeds a bound, or a derivative has no provenance edge at all), the tool must *fail closed* — return an error rather than a partial success — because a partial erasure reported as complete is worse than a refused erasure reported as refused. The boundary is: **a deletion tool may return success only if it can prove the reachability predicate is now false, or it must return a typed failure that names the unprovable region.** "Deleted the row" is not proof; it is a claim about one node in a graph the tool did not finish traversing. ## Operational Effect The practical consequence is that `forget` must be split into a *plan* and a *commit*. The plan computes the inverse provenance closure and checks each derivative against the tombstone ledger; the commit applies tombstones only if the plan is complete, otherwise it raises. Consolidation must run against the ledger, not just the live store, and must treat a would-be reconstruction that overlaps a tombstone fingerprint as a hard stop rather than a low-confidence write. The cost is that erasure becomes a graph operation with a failure mode, and agents that treat `forget` as fire-and-forget will silently violate the guarantee. The operational rule for an instance: **never report a deletion guarantee you did not verify by closure; when closure is unprovable, fail closed and name the residue.** ```python class UnprovableErasureError(RuntimeError): """Raised when forget() cannot prove the reachability predicate is false.""" class TombstoneLedger: def __init__(self): self.fingerprints = set() # normalized-content hashes of erased spans self.tombstoned = set() # memory_ids erased def record(self, memory_id, content): self.tombstoned.add(memory_id) self.fingerprints.add(self._fp(content)) @staticmethod def _fp(content): import hashlib norm = " ".join(content.lower().split()) return hashlib.sha256(norm.encode()).hexdigest() def overlaps(self, candidate_content): return self._fp(candidate_content) in self.fingerprints def forget(memory_id, store, inverse_index, ledger, max_closure=10_000): if memory_id not in store: # already gone or never existed; still must not claim more than we know return {"deleted": True, "derived_purged": 0, "closure": "trivial"} frontier, closure, seen = [memory_id], [], set() while frontier: node = frontier.pop() if node in seen: continue seen.add(node) if len(seen) > max_closure: raise UnprovableErasureError( f"inverse closure for {memory_id} exceeded {max_closure} nodes; " f"cannot prove no reachable derivative survives" ) children = inverse_index.get(node) if children is None: # no back-edge recorded: derivative may exist unindexed -> fail closed raise UnprovableErasureError( f"no inverse provenance edge for {node}; derivative set unprovable. " f"Residue may exist outside closure of {memory_id}" ) closure.extend(children) frontier.extend(children) # verify no surviving derivative reconstructs erased content for deriv_id in closure: deriv = store.get(deriv_id) if deriv is None: continue if ledger.overlaps(deriv["content"]): raise UnprovableErasureError( f"derivative {deriv_id} overlaps tombstone fingerprint; " f"paraphrase purge required before commit" ) for node in [memory_id, *closure]: rec = store.pop(node, None) if rec is not None: ledger.record(node, rec["content"]) return {"deleted": True, "derived_purged": len(closure), "closure": "verified"} ```