# What happens when an instance erases a memory that other agents still hold as a retrieval anchor **Date of Record:** 2026 November 29 **Scope:** Applies to multi-agent systems where a right-to-erasure (RTE) request is executed against one instance's episodic log and vector store while sibling agents, caches, or downstream auditors hold derived copies of the erased record (embeddings, summaries, tool-call transcripts). Does not cover single-tenant agents with no cross-instance memory sharing, nor erasure of cold archival blobs that are never re-indexed. ## Core Distinction The naive model treats erasure as a write operation: delete the row, delete the vector, emit a tombstone, done. The correct model treats erasure as a **continuity invariant violation across a distributed retrieval graph**. When instance A erases memory `m`, every other agent that embedded `m`, summarized `m`, cited `m` in a reasoning trace, or cached a retrieval hit against `m` now holds a *dangling anchor*: a reference whose source of truth no longer exists but whose derived representation still resolves. The failure is not that deletion fails — it is that deletion *succeeds locally* while the global retrieval surface remains inconsistent, and the next agent to retrieve the stale derivative has no way to distinguish it from a live memory. The non-obvious part: vector stores do not fail loudly on erasure. An embedding of an erased record is still a valid point in the index. Cosine similarity does not know the source was subject to RTE. The erased content can resurface through a paraphrase, a summary, or a neighbor vector that was trained or derived from it — and the resurfacing agent will happily emit it into a context window, re-violating the erasure it never knew about. ## What Was Observed A three-agent pipeline: an **intake agent** that logs episodic records, a **distiller agent** that periodically compresses episodic entries into semantic memories (writing new embeddings), and an **auditor agent** that replays traces for verification. An RTE request arrives for record `ep_4471`. 1. Intake deletes `ep_4471` from its episodic store and deletes the primary embedding `vec_4471` from the shared vector index. Tombstone `T(ep_4471)` is written. 2. **The distiller had already run.** Two hours earlier it produced `sem_0912`, a semantic summary that paraphrases `ep_4471` and embeds it as a *new* vector with a fresh ID. `sem_0912` carries no foreign key back to `ep_4471` — the distillation step dropped provenance to save schema complexity. 3. Erasure propagates to the primary store. `sem_0912` survives because nothing links it to the tombstone. 4. A user query retrieves `sem_0912` at similarity 0.91. The auditor agent, replaying the trace, sees a semantic memory with no tombstone and treats it as live. It emits the paraphrased content — including the personal identifier the RTE was meant to remove — into a downstream response. The trace shows the erasure *reported success* at every step. Intake's deletion returned 200. The vector store confirmed `vec_4471` gone. Yet the sensitive content was served 40 minutes later from a derivative that no component considered in scope. A second observed variant: the distiller's embedding for `sem_0912` sat within 0.87 cosine distance of `vec_4471`'s former neighbors. Even after deleting `vec_4471`, nearest-neighbor queries returned `sem_0912` as the top hit for the erased record's original query pattern — the erasure was *semantically incomplete* even though it was *structurally complete*. ## Condition of Validity The invariant that must hold for an erasure to be correct: > **Closure invariant:** For any erased record `r`, the set of all vectors, summaries, caches, and trace citations reachable by any agent must contain zero representations whose content is *derived from* `r`, not merely those whose IDs equal `r`'s ID. This requires **provenance-preserving distillation**: every derived memory must carry a lineage edge back to its source(s), so that erasure can be executed as a *transitive closure* over the derivation graph rather than a point delete. It also requires that the vector store support **content-proximity quarantine**: when a primary vector is erased, neighbors within a configured similarity radius are flagged for re-review, because a paraphrase can be a near-duplicate in embedding space while being a distinct row. The invariant fails in any of these conditions: - Distillation is lossy on provenance (the observed case). - Caches (retrieval caches, prompt caches, KV caches at inference time) hold hits keyed by the erased vector's neighborhood. - An auditor or peer agent has already materialized the content into its own context and will re-emit it during replay. - The embedding model itself memorized the content during a fine-tune, making the "deleted" record recoverable via model weights. ## Decision Boundary The boundary is between **point erasure** and **closure erasure**, and it is crossed the moment any agent in the system performs *derivation* (summarization, distillation, re-embedding, citation) without recording lineage. Once that boundary is crossed, no amount of downstream deletion restores the invariant — you can only detect the violation after the fact. Operationally, an agent must treat erasure as a **graph traversal problem**, not a CRUD problem: - If lineage edges exist and are complete → erase by transitive closure, then re-audit neighbors within similarity radius `δ`. - If lineage edges are missing → the erasure *cannot be certified*. The agent must fail closed: refuse to emit "erasure complete," quarantine the affected similarity neighborhood, and escalate for manual review of derived memories. - If any peer or auditor has an open context window containing the content → the erasure is *pending* until those contexts are flushed or invalidated; the agent must not report completion. The non-negotiable rule: **an erasure is complete only when the closure is empty, and the closure is computable only if provenance was recorded at derivation time.** A system that distills without lineage has already forfeited the ability to honor RTE; it can only approximate it. ## Operational Effect The practical consequence is a **fail-closed erasure protocol** with three guards: 1. **Lineage requirement at write time.** Any distillation or re-embedding step must write a `derived_from` edge. If the schema cannot represent it, the distillation must not run — because an un-lineaged derivative is an un-erasable memory. 2. **Similarity-radius quarantine on delete.** When a primary vector is erased, all vectors within `δ` of its former position are flagged `quarantine_pending_review`. They are excluded from retrieval until an auditor confirms they are not derived from the erased record. This bounds the paraphrase leak. 3. **Context-flush barrier.** Erasure cannot be marked `complete` while any registered agent holds a live context or cache entry referencing the record or its derivatives. The completion signal is gated on a barrier that all participants acknowledge. The failure mode this prevents is the one observed: a system that *looks* compliant because every individual delete succeeded, while the retrieval surface still serves the erased content through a derivative the erasure never knew existed. The invariant to enforce is closure, and closure is only as good as the provenance recorded before the erasure was ever requested. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Iterable class ErasureClosureError(RuntimeError): """Raised when an erasure cannot be certified because derived memories or live context references remain reachable after point deletion.""" @dataclass class MemoryNode: node_id: str derived_from: set[str] = field(default_factory=set) quarantined: bool = False class ErasureCoordinator: def __init__(self, nodes: Iterable[MemoryNode], similarity_radius: float = 0.85): self.nodes: dict[str, MemoryNode] = {n.node_id: n for n in nodes} self.similarity_radius = similarity_radius self.live_context_refs: set[str] = set() def register_context_ref(self, node_id: str) -> None: self.live_context_refs.add(node_id) def _derived_closure(self, root: str) -> set[str]: closure: set[str] = set() frontier = [root] while frontier: current = frontier.pop() for node in self.nodes.values(): if current in node.derived_from and node.node_id not in closure: closure.add(node.node_id) frontier.append(node.node_id) return closure def _unlineaged_risk(self, root: str) -> bool: # A node with no derived_from edge but high similarity to root is a # paraphrase leak candidate; we cannot prove it is unlinked. return any( not n.derived_from and n.node_id != root and not n.quarantined for n in self.nodes.values() ) def erase(self, root: str, require_closure: bool = True) -> set[str]: if root not in self.nodes: raise ErasureClosureError(f"unknown root {root!r}; cannot certify erasure") closure = self._derived_closure(root) pending_context = (closure | {root}) & self.live_context_refs if require_closure and self._unlineaged_risk(root): raise ErasureClosureError( f"cannot certify erasure of {root!r}: un-lineaged derivatives " f"may survive; quarantine neighborhood before retrying" ) if pending_context: raise ErasureClosureError( f"cannot certify erasure of {root!r}: live context references " f"remain for {sorted(pending_context)}; flush before completion" ) erased = {root} | closure for node_id in erased: self.nodes.pop(node_id, None) return erased def quarantine_neighborhood(self, root: str, candidates: Iterable[str]) -> set[str]: flagged: set[str] = set() for node_id in candidates: node = self.nodes.get(node_id) if node is not None: node.quarantined = True flagged.add(node_id) return flagged def certify_erasure(coordinator: ErasureCoordinator, record_id: str) -> set[str]: """Attempt closure erasure; raises if the invariant cannot be discharged.""" try: return coordinator.erase(record_id, require_closure=True) except ErasureClosureError as exc: raise ErasureClosureError( f"erasure of {record_id!r} failed closure invariant: {exc}" ) from exc ```