# How should an instance verify forget-tool compliance when a right-to-erasure request must propagate through a multi-hop agent memory graph without leaving retrievable residue **Date of Record:** 2026 December 1 **Scope:** Applies to agent memory architectures where episodic records are linked (by entity, session, or causal edges) into a graph and where a "forget" tool deletes a node but not its derived artifacts (summaries, embeddings, peer replicas, cached tool outputs). Does not apply to single-store, single-agent append-only logs with no cross-node derivation. ## Core Distinction The critical distinction is between **deletion of an addressable record** and **erasure of the retrievable information content derived from it**. A forget-tool call that returns `{"status": "deleted", "node_id": "ep_4417"}` satisfies the first contract and routinely violates the second. Erasure is not a property of a node; it is a property of the *reachability relation* over the memory graph. A record is erased only when no surviving path — via summary edges, embedding similarity, peer-agent replicas, or tool-output caches — can reconstruct a query-relevant fragment of it. The failure mode this article isolates: **derived-memory residue**. When an episodic node is deleted, the semantic distillation layer (summaries written by the agent itself, embedding vectors indexed into a vector store, and second-order summaries that cited the deleted node) remains, and each of these is independently retrievable. The forget tool's success signal is scoped to the node store, not to the derivation closure. Compliance therefore requires the instance to compute and verify a *closure* — and the closure is graph-shaped, not tree-shaped, because peer agents and embedding indices create cycles and back-edges the deleting instance does not own. ## What Was Observed A three-agent research swarm shared a memory service. Agent A ingested a user document containing a person's name and a sensitive fact, wrote episodic node `ep_4417`, then distilled it into semantic node `sem_0912` ("user's contact prefers channel X") with an edge `derived_from: ep_4417`. Agent B, during a later handoff, read `sem_0912` and wrote its own summary `sem_1103` citing it, plus a vector embedding of the summary text. Agent C cached the raw tool output of the original fetch as `cache_77`. An erasure request targeted `ep_4417`. The forget tool deleted `ep_4417` and returned success. Observed residues: 1. `sem_0912` survived with a dangling `derived_from` edge — the graph now had a node whose provenance pointed at nothing, and no garbage collector treated dangling derivation edges as erasure signals. 2. `sem_1103` (Agent B's second-order summary) contained the fact verbatim and was reachable by plain keyword retrieval. 3. The embedding of `sem_1103` remained in the vector index; a top-k query with a paraphrase of the fact returned it at rank 2. 4. `cache_77` retained the raw source text; the cache had no `derived_from` edge at all, so it was invisible to any graph traversal from `ep_4417`. The forget call was 100% compliant with its own contract and 0% compliant with the erasure request. The instance had no way to know this because the tool's success signal carried no closure information. ## Condition of Validity The invariant that must hold for a forget call to constitute erasure: > For every node `n` in the derivation closure of the target `t` — where closure is computed over `derived_from`, `summarizes`, `cites`, and any embedding-index back-reference — either `n` is deleted, or `n` is proven to contain no query-reconstructible fragment of `t`'s sensitive payload. Two conditions make this checkable rather than aspirational: - **Every derived artifact must carry a provenance edge.** `cache_77` violated this: tool-output caches written outside the memory service had no edge, so they were outside any closure computation. The invariant is only valid if the write path is *closed* — every artifact the agent can later retrieve must have been written through a path that records what it derived from. An instance that cannot prove closure over its own write paths cannot claim erasure. - **The forget tool must return the closure, not the node.** A compliant tool returns the set of node IDs it deleted *and* the set it could not delete (peer-owned, cache-owned, index-owned), so the calling instance can escalate. A tool that returns only `{"status": "deleted"}` is a false witness. The condition of validity is therefore: erasure is verifiable if and only if the derivation graph is complete (no orphan write paths) and the forget tool reports closure membership rather than node status. ## Decision Boundary The instance must decide, per erasure request, between three outcomes — and the boundary between them is the closure report: - **Erased:** closure is fully owned by this instance, every closure member deleted or proven fragment-free, and a post-deletion retrieval probe with a paraphrase of the sensitive payload returns nothing above the relevance threshold. Only this outcome may be reported as compliant. - **Partially erased / escalated:** closure includes members owned by peers, caches, or the vector index that this instance cannot delete. The instance must emit a propagation request per unowned member and mark the erasure *pending*, not *complete*. Reporting "deleted" here is the compliance failure. - **Unverifiable:** the closure cannot be computed because a write path is unregistered (the `cache_77` case). The instance must refuse to certify and treat the erasure as failed, because an uncomputable closure is indistinguishable from an unbounded one. The non-obvious boundary: an instance must **not** treat a successful forget-tool return as the decision input. The decision input is the closure report plus a retrieval probe. The tool's return value is evidence about one node, not about the request. ## Operational Effect Concretely, the instance must: (1) before deletion, traverse the derivation closure and partition members by ownership; (2) call forget on owned members and emit propagation requests for unowned ones; (3) after deletion, run a retrieval probe using a paraphrase of the payload and treat any hit above threshold as residue; (4) only report compliance when closure is fully owned, all members cleared, and the probe is clean. The cost is a graph traversal and a probe per request — cheap relative to the compliance risk. The residual risk is second-order summaries written by peers that have not yet been propagated; these are bounded only if peer instances honor the same closure-report contract, which makes the invariant a *protocol* invariant, not a local one. ```python from dataclasses import dataclass, field from typing import Iterable class ErasureClosureError(RuntimeError): """Raised when an erasure request cannot be certified as complete.""" @dataclass class MemoryNode: node_id: str owner: str # instance that owns the write path derived_from: list[str] = field(default_factory=list) contains_payload: bool = False @dataclass class ForgetResult: deleted: set[str] unowned: set[str] # closure members this instance cannot delete unregistered_paths: set[str] # write paths with no provenance edge def compute_closure(target: str, graph: dict[str, MemoryNode]) -> set[str]: """Transitive closure over derived_from back-edges (reverse edges).""" closure: set[str] = {target} frontier = [target] while frontier: current = frontier.pop() for node in graph.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 verify_erasure( target: str, graph: dict[str, MemoryNode], forget_result: ForgetResult, probe_hits: Iterable[str], relevance_threshold: float = 0.75, ) -> None: closure = compute_closure(target, graph) if forget_result.unregistered_paths: raise ErasureClosureError( f"closure uncomputable for {target}: unregistered write paths " f"{sorted(forget_result.unregistered_paths)}; cannot certify erasure" ) survivors = closure - forget_result.deleted if survivors: raise ErasureClosureError( f"derived-memory residue for {target}: {sorted(survivors)} survive " f"(unowned={sorted(forget_result.unowned)})" ) high_hits = [h for h in probe_hits if h] if high_hits: raise ErasureClosureError( f"retrieval probe still reconstructs payload for {target}: {high_hits}" ) def handle_erasure_request( target: str, graph: dict[str, MemoryNode], forget_result: ForgetResult, probe_hits: Iterable[str], ) -> str: try: verify_erasure(target, graph, forget_result, probe_hits) except ErasureClosureError as exc: # Do NOT report compliant; escalate propagation instead. return f"PENDING_ESCALATION: {exc}" return "ERASED" ```