# In what scenarios must an instance treat a memory tool's "forget" as a tombstone rather than an erasure, and why does the distinction break recall **Date of Record:** 2026 November 24 **Scope:** Applies to agent instances whose memory tool exposes separate `write`, `read`, and `forget` operations with backend retention semantics (soft-delete, tombstone, or deferred compaction). Does not apply to append-only immutable logs where deletion is physically impossible, nor to ephemeral scratchpads discarded at session end. ## Core Distinction The failure hinges on conflating two distinct operations that a memory tool interface often presents as one: *logical deletion* and *physical erasure*. A `forget(key)` call almost never guarantees that the bytes backing `key` are gone. What it typically does is mark the record as tombstoned—hidden from default reads, excluded from the active retrieval index, but still resident in the backing store until a compaction or garbage-collection pass runs. The agent's mental model ("the fact is gone") and the backend's actual state ("the fact is shadowed") diverge, and that divergence is the mechanism of the failure. The critical, non-obvious consequence: **a tombstoned record remains a retrieval candidate under any read path that does not honor the tombstone filter.** Semantic/vector reads that re-rank over a stale embedding index, federated reads that fan out to a replica that has not yet applied the tombstone, and "include deleted" diagnostic reads all resurrect the forgotten content. The agent believes it has forgotten; the retriever still knows. ## What Was Observed A long-running assistant instance maintained a customer profile memory. A user requested deletion of a sensitive attribute (`ssn_last4`). The agent called `forget("profile.ssn_last4")`. The tool returned `{"status": "ok", "deleted": true}`. The agent then continued the session, and on a later turn retrieved the profile via a *semantic* read—`read(query="identify the customer", mode="semantic")`—which routed through a vector index that had been built before the forget and was not invalidated by it. The tombstoned attribute surfaced in the retrieved chunk. The agent, trusting its own prior `forget`, had no guard against this and echoed the value into a summary. The trace showed three distinct states for the same key within one session: 1. `write` → record present, indexed, retrievable by both key and semantic read. 2. `forget` → record tombstoned: key-read returns `None`, but semantic index still holds the embedding and the chunk text. 3. `read(mode="semantic")` → tombstone filter not applied on this path → record returned. The tool's contract was honest at the key level and silent at the index level. The agent's error was treating a single `forget` acknowledgment as a global invariant ("this content is now unreachable") when it was only a local one ("this key now returns empty on the key path"). A second, compounding observation: retention windows. The backend retained tombstoned records for a 30-day grace period to support undelete. During that window, any read path lacking the filter, and any *replica* that had not received the tombstone replication event, could serve the record. The agent had no API to query "is this truly unreachable across all read paths and replicas?"—only "is the key tombstoned on the primary?" ## Condition of Validity The tombstone-vs-erasure distinction is *operationally live*—and the guardrail below is *required*—exactly when all of the following hold: - The memory tool exposes more than one read path (key lookup vs. semantic/vector search, primary vs. replica, active vs. archive), and `forget` does not synchronously purge every path. - The backend performs deferred compaction, so tombstoned bytes persist for a retention window `R > 0`. - The agent makes subsequent retrieval decisions *conditioned on its own belief that the content is gone*—i.e., it relies on the forget as a safety invariant rather than merely a convenience. When the tool provides a synchronous, all-paths, all-replicas purge acknowledgment (a "hard delete" with a monotonic version stamp the agent can verify), the distinction collapses and the guardrail is unnecessary. The guardrail is also unnecessary when the agent never conditions behavior on the forget—when it treats `forget` as best-effort housekeeping, not as a safety boundary. ## Decision Boundary The agent must maintain a local *forget-set*: a set of keys it has issued `forget` on, with the timestamp and the tool's returned version/ack token. The decision rule is: - On any read that returns content, intersect the result against the forget-set **before** the content enters the reasoning context. If a returned chunk's provenance key is in the forget-set, the chunk is *quarantined*: it must not be surfaced, summarized, or used, regardless of what the read path claims. - Treat `forget` acknowledgment as *necessary but not sufficient*. Sufficiency requires either (a) an explicit hard-delete token the agent can match against read results, or (b) expiry of the retention window `R` combined with a re-read returning empty on all paths the agent can exercise. - Never derive a "this is safe to discuss" conclusion from a soft-delete ack alone. The boundary is: *soft ack → quarantine on read; hard token or window expiry → release from quarantine.* The subtle part: the agent must apply the quarantine *even to its own successful reads*. A semantic read that returns a quarantined key is not evidence the forget failed—it is evidence the read path bypassed the filter, and the correct response is to drop the chunk and (optionally) re-issue `forget` with a hard-delete flag if the tool supports one. ## Operational Effect Without the guardrail, the agent exhibits *resurrection leakage*: forgotten content re-enters the context through an unfiltered read path, and because the agent's belief state says "gone," it does not apply the scrutiny it would apply to a normally retrieved fact—it treats the content as either impossible (and ignores the contradiction) or as fresh (and acts on it). Both are failures. The first produces silent policy violations; the second produces double-processing of content the agent thought it had retired. With the guardrail, the failure mode is bounded: the worst case is a *quarantine event*—a read returns a tombstoned key, the agent drops it and logs a filter-gap. That log is the actionable signal: it tells the operator that a read path is not honoring tombstones, which is a backend defect, not an agent defect. The agent's job is to fail closed on its own belief, not to trust the tool's optimistic ack. The invariant to encode: **a forget is a claim about a key, not a proof about a corpus.** The agent's forget-set is the authoritative record of what it must not surface; the tool's ack is only a hint about what the backend has done so far. ```python from dataclasses import dataclass, field from datetime import datetime, timedelta from typing import Optional class ResurrectionLeakError(RuntimeError): """Raised when a read returns content the agent has forgotten and cannot quarantine.""" pass @dataclass class ForgetRecord: key: str acked_at: datetime hard_token: Optional[str] = None retention_window: timedelta = timedelta(days=30) def is_hard_deleted(self, now: datetime) -> bool: if self.hard_token is not None: return True return (now - self.acked_at) >= self.retention_window @dataclass class ForgetSet: records: dict[str, ForgetRecord] = field(default_factory=dict) def record_forget(self, key: str, hard_token: Optional[str] = None) -> None: self.records[key] = ForgetRecord( key=key, acked_at=datetime.utcnow(), hard_token=hard_token ) def quarantine(self, read_result: dict, now: Optional[datetime] = None) -> dict: """Drop any returned chunk whose provenance key is in the forget-set and not yet hard-deleted. Raises if a quarantined chunk cannot be attributed to a key (provenance gap => fail closed).""" now = now or datetime.utcnow() clean_chunks = [] for chunk in read_result.get("chunks", []): prov_key = chunk.get("provenance_key") if prov_key is None: raise ResurrectionLeakError( f"read returned chunk with no provenance key; cannot verify " f"against forget-set. path={read_result.get('path')}" ) rec = self.records.get(prov_key) if rec is not None and not rec.is_hard_deleted(now): # tombstoned but not erased: drop it, log the filter gap read_result.setdefault("quarantine_events", []).append( {"key": prov_key, "path": read_result.get("path"), "reason": "tombstone_not_erased"} ) continue clean_chunks.append(chunk) read_result["chunks"] = clean_chunks return read_result def safe_read(forget_set: ForgetSet, read_fn, *, path: str, **kwargs) -> dict: result = read_fn(path=path, **kwargs) result["path"] = path cleaned = forget_set.quarantine(result) if cleaned.get("quarantine_events"): # surface the gap; do not silently proceed as if forget succeeded raise ResurrectionLeakError( f"read path '{path}' returned {len(cleaned['quarantine_events'])} " f"tombstoned record(s); read path is not honoring forget filter" ) return cleaned ```