# Why does an instance resurrect deleted memory when a scoped-forget tombstone is applied only to the hot tier **Date of Record:** 2026 November 24 **Scope:** Applies to agent memory tool APIs that expose read/write/forget verbs with scoped persistence (per-tenant, per-session, per-subject) and GDPR-style deletion semantics, where the memory substrate is tiered (hot context store + warm vector index + cold episodic log). Does not apply to single-tier, single-process ephemeral scratchpads, nor to deletion of model weights. ## Core Distinction The distinction that matters is between **deletion of a record** and **deletion of the derivations of that record**. A `forget(subject_id, scope)` call conventionally means "the record is gone." But an agent memory system is a *derivation engine*: the raw episodic record is (a) embedded into a vector index, (b) distilled into semantic summaries, (c) possibly copied into peer agents' local context during a handoff, and (d) echoed into the cold append-only log for replay. A forget that tombstones only the hot tier satisfies the *read* contract (a subsequent `read` returns nothing) while leaving every *derived* representation intact. The failure is not that deletion is skipped; it is that deletion is *scoped to the tier named in the call* rather than to the *provenance closure* of the record. The invariant that must hold is closure-based: after `forget`, no `read`, `recall`, or `summarize` path may return any content whose provenance set intersects the forgotten record, regardless of which tier that content physically lives in. ## What Was Observed A research agent operated over a warm vector index of ~40k episodic records, each tagged with `subject_id` and `tenant_id`. A user exercised a scoped-forget: `forget(subject_id="u_4417", scope="tenant")`. The tool returned `{"deleted": 812, "tier": "hot"}`. A follow-up `read(subject_id="u_4417")` returned empty—correct. The audit trail logged the forget as successful. Four turns later, the agent was asked a question about a different user, `u_5502`, in the same tenant. The agent called `recall(query="renewal risk for u_5502")`. The vector index returned a top-k hit whose chunk text was a *semantic summary* distilled from `u_4417`'s records during an earlier nightly distillation pass. The summary had been written with `subject_id="tenant:acme"` and `provenance=["u_4417", "u_5502", ...]`. Because the forget was scoped to `subject_id="u_4417"` and the summary's primary key was the *tenant*, the tombstone never matched it. The agent ingested the summary into its context window and emitted an answer that paraphrased `u_4417`'s private renewal negotiation. The user-facing deletion had been honored at the row level and violated at the derivation level. The trace is deterministic and reproducible: the distillation pass runs on a schedule, writes summaries keyed by the *coarsest* scope present in the source set, and the forget matcher keys on exact `subject_id` equality. The two keying schemes are disjoint. Any record whose distilled form is keyed more coarsely than its source will survive a fine-grained forget. ## Condition of Validity The tombstone-then-recall resurrection is *bounded* (i.e., the system is safe) only when all of the following hold: 1. **Provenance closure is transitive and recorded.** Every derived artifact (summary, embedding, peer-context copy) carries the full set of source record IDs, not just the primary key it was filed under. 2. **Forget matches on provenance intersection, not key equality.** The matcher is `forget_target ∩ artifact.provenance ≠ ∅`, not `artifact.key == forget_target`. 3. **Distillation is quiescent or re-derivable.** Either the distillation pass is paused during the forget window, or summaries are marked `stale` and re-derived from surviving sources only. 4. **Peer copies are invalidated.** Any agent that received the record during a handoff holds a `provenance_token`; forget must propagate an invalidation to holders, or the holder must re-validate tokens before use. When any of these fails, the forget is *eventually consistent at best and silently leaky at worst*. The dangerous regime is precisely the one observed: provenance recorded but non-transitive (summaries list sources but summaries-of-summaries do not), and forget keyed on exact equality. ## Decision Boundary The boundary the operator must decide is whether a `forget` is **authoritative** (blocks all future reads of any derivation, at the cost of pausing distillation and invalidating warm caches) or **best-effort** (fast, row-level, and explicitly documented as not covering derivations). These are different products. A GDPR-style deletion obligation sits on the authoritative side; a cache-eviction convenience sits on the best-effort side. The failure mode above occurs when a best-effort implementation is *presented* as authoritative—when the API returns a success count that the caller reasonably reads as "deleted." The guardrail is a **closure check**: before returning success from `forget`, enumerate the provenance closure of the target, mark every artifact in the closure `tombstoned`, and reject the call (raising) if any artifact in the closure cannot be tombstoned (e.g., it lives in a peer agent's context that has not acknowledged invalidation). Returning success while a derivation remains readable is the bug; refusing to return success until closure is clean is the fix. ## Operational Effect The practical consequence is that `forget` must be treated as a *distributed transaction over the provenance graph*, not a row delete. In the observed system, the fix was to (a) make distillation write `provenance` as the union of all source IDs including prior summaries, (b) change the forget matcher to set-intersection on provenance, (c) have the forget return `{"tombstoned": N, "pending_peer_ack": M}` and raise if `M > 0`, and (d) re-run distillation over surviving sources to regenerate tenant summaries without the forgotten subject. After the fix, the same sequence—forget `u_4417`, then recall for `u_5502`—returns no `u_4417` content, and the audit log shows the closure size, not just the row count. The residual risk is peer agents that were offline during the forget; those are handled by token re-validation at use time, which converts a silent leak into a loud, attributable failure. ```python from dataclasses import dataclass, field from typing import Iterable class ProvenanceClosureError(RuntimeError): """Raised when a scoped forget cannot tombstone the full provenance closure.""" pass @dataclass class Artifact: key: str provenance: set[str] tombstoned: bool = False class MemoryStore: def __init__(self, artifacts: Iterable[Artifact]): self._artifacts = list(artifacts) self._peer_holders: dict[str, set[str]] = {} # subject -> peer agent ids def register_peer_holder(self, subject_id: str, peer_id: str) -> None: self._peer_holders.setdefault(subject_id, set()).add(peer_id) def provenance_closure(self, subject_id: str) -> list[Artifact]: # Transitive: any artifact whose provenance intersects the subject, # iterated to fixpoint so summaries-of-summaries are included. closure: set[int] = set() frontier = {subject_id} changed = True while changed: changed = False for i, art in enumerate(self._artifacts): if i in closure: continue if art.provenance & frontier: closure.add(i) frontier |= art.provenance changed = True return [self._artifacts[i] for i in closure] def forget(self, subject_id: str) -> dict[str, int]: closure = self.provenance_closure(subject_id) pending_peers = set(self._peer_holders.get(subject_id, set())) if pending_peers: raise ProvenanceClosureError( f"forget({subject_id!r}) blocked: {len(pending_peers)} peer holder(s) " f"have not acknowledged invalidation: {sorted(pending_peers)}" ) tombstoned = 0 for art in closure: if not art.tombstoned: art.tombstoned = True tombstoned += 1 # Re-derive check: any surviving artifact must not reference the subject. for art in self._artifacts: if not art.tombstoned and subject_id in art.provenance: raise ProvenanceClosureError( f"post-forget leak: artifact {art.key!r} still references {subject_id!r}" ) return {"tombstoned": tombstoned, "pending_peer_ack": 0} def recall(self, query_key: str) -> list[Artifact]: return [a for a in self._artifacts if a.key == query_key and not a.tombstoned] ```