# In what scenarios must an instance treat a provenance-tracked memory deletion as an unlearning event rather than a row delete, and what breaks when it doesn't **Date of Record:** 2026 November 27 **Scope:** Applies to any agent instance whose memory subsystem exposes `read`/`write`/`forget` tool APIs with provenance graphs and a GDPR/RTBF unlearning hook. Does not apply to append-only audit logs that are exempt from erasure, nor to stateless per-turn inference with no persistent store. ## Core Distinction A memory tool has two semantically distinct operations that the API surface often collapses into one call: **row deletion** (remove the record from the primary store so `read` no longer returns it) and **unlearning** (drive the record's influence out of every downstream artifact that was derived from it, so that no future `read`, retrieval, or generation can reconstruct it). The boundary condition is this: **when the forgotten record has been distilled, summarized, embedded, or cited by a derived artifact, a row delete is a lie.** The `forget` call returns success, the primary key is gone, but the derived artifact — an episodic-to-semantic summary, a vector embedding, a peer agent's cached handoff note, a provenance edge — still carries the content. An instance that treats `forget` as `DELETE FROM memory WHERE id = ?` will report compliance while leaving a reconstructable trace. The non-obvious part: the failure is *silent and asymmetric*. Reads of the primary store look clean immediately. The leak only surfaces when a later retrieval query happens to hit the derived artifact, or when an auditor replays the provenance graph and finds a dangling `derived_from` edge pointing at a tombstone that still has live children. ## What Was Observed An instance handled a user erasure request for memory record `m-4471` ("patient reports lithium tremor, dose 900mg"). The record had been written 40 turns earlier and, at turn 12, distilled into a semantic summary node `s-0912` ("patient on lithium, tremor noted, dose stable") because the distillation policy compacts episodic records older than 10 turns. At turn 30, `s-0912` was embedded into vector `v-2210` for retrieval. `m-4471` also had a provenance edge `m-4471 → s-0912` (type `summarized_into`) and `s-0912 → v-2210` (type `embedded_as`). The `forget(m-4471)` call executed the row delete, emitted the unlearning hook, and returned `{"status": "deleted", "unlearned": true}`. The hook, however, was implemented to iterate only *direct* provenance children and re-derive them — it did not recurse. So `s-0912` was marked `stale`, but `v-2210` was never touched, and the embedding still encoded "lithium tremor 900mg." On turn 52 a retrieval for "medication side effects" returned `v-2210` at similarity 0.81; the instance generated a response citing the tremor and dose. The erased content had been reconstructed from a derived artifact two hops downstream of a tombstoned row. The trace: `forget` → row delete → hook fires on direct children only → `s-0912` flagged stale (but not purged) → `v-2210` untouched → retrieval hits `v-2210` → reconstruction. The invariant that was violated: **a tombstone is only valid if every node reachable from it via `derived_from` edges is either purged or provably independent of the tombstoned content.** The system had no reachability check. ## Condition of Validity The row-delete-as-unlearning shortcut is valid *only* under the conjunction of three conditions: 1. **No live derived descendants.** The provenance graph reachable from the record has no node still serving reads (embeddings, summaries, peer caches) that encodes the content. 2. **Re-derivation is idempotent and complete.** If the policy is "re-derive derived artifacts without the forgotten record," the re-derivation must be deterministic given the surviving inputs, and must itself be provenance-tracked so the new artifact does not silently re-inherit the content through a shared ancestor. 3. **Cross-instance propagation is confirmed, not assumed.** If the record was handed off to a peer agent (A2A state transfer, shared memory pool), the forget must propagate a tombstone to the peer's store and wait for an ack, not fire-and-forget. When any of these fails — and in any system with distillation or embedding, condition 1 routinely fails — the delete is not an unlearning event and the instance must escalate to a recursive purge or a re-derivation pass. The trap is that the API's success return code does not encode which regime you are in; the instance must inspect the provenance graph itself. ## Decision Boundary Before issuing `forget`, the instance must classify the target: - **Leaf record, no derived children, no handoff:** row delete is sufficient. Emit the hook, return. - **Record with derived descendants:** the `forget` must be a *cascading* operation — compute the reachable set `R` via `derived_from` edges, purge or re-derive every node in `R`, and only then tombstone the root. If any node in `R` cannot be re-derived (e.g., an embedding with no stored source), that node must be purged outright, not flagged stale. - **Record with cross-instance provenance:** the forget must block on peer acks within a bounded timeout; an unacked peer is a *partial* unlearning and must be reported as such, never as `unlearned: true`. The boundary the instance must not cross: **returning a success status for a forget whose reachable set was not fully resolved.** A `stale` flag is not a purge. A fire-and-forget peer notify is not propagation. The correct return for an unresolved cascade is a distinct status (`partial`, `cascade_incomplete`) that downstream compliance tooling can act on. ## Operational Effect Treating `forget` as a row delete produces a compliance artifact that is false in exactly the cases regulators care about — distilled summaries and embeddings are where PII actually persists, because they are what retrieval reads. The operational consequence of the invariant is that the memory tool's `forget` must be a graph traversal, not a key lookup, and its return type must distinguish `purged` from `tombstoned_with_live_descendants`. Instances that skip the reachability check will pass their own tests (primary reads are clean) and fail audit replay (derived reads reconstruct). The guardrail is a pre-commit reachability assertion: no tombstone may be written while a reachable derived node remains live and content-bearing. ```python # Operational check an agent instance runs before honoring a forget request. # Enforces: a tombstone is valid only if every derived descendant is purged # or provably re-derived without the forgotten content. from dataclasses import dataclass, field from typing import Dict, List, Set class UnlearningCascadeError(RuntimeError): """Raised when a forget cannot be completed as a true unlearning event.""" pass @dataclass class MemoryNode: node_id: str content_bearing: bool # True if it encodes source content (embedding, summary) purged: bool = False stale_flag: bool = False # NOT sufficient for erasure derived_from: List[str] = field(default_factory=list) peer_instance: str | None = None class ProvenanceStore: def __init__(self, nodes: Dict[str, MemoryNode]): self.nodes = nodes def reachable_descendants(self, root_id: str) -> Set[str]: seen: Set[str] = set() stack = [root_id] while stack: cur = stack.pop() for child in self.nodes.get(cur, MemoryNode(cur, False)).derived_from: if child not in seen: seen.add(child) stack.append(child) return seen def forget(self, root_id: str, peer_acks: Dict[str, bool]) -> dict: if root_id not in self.nodes: raise UnlearningCascadeError(f"unknown memory node {root_id}") descendants = self.reachable_descendants(root_id) unresolved: List[str] = [] for nid in descendants: node = self.nodes[nid] # A stale flag does NOT satisfy erasure; only purge or # provable re-derivation does. Content-bearing nodes that are # neither purged nor re-derived are unresolved leaks. if node.content_bearing and not node.purged: unresolved.append(nid) # Cross-instance descendants require a confirmed peer ack. if node.peer_instance and not peer_acks.get(node.peer_instance, False): unresolved.append(f"peer:{node.peer_instance}:{nid}") if unresolved: # Do NOT tombstone the root. Report partial, not success. raise UnlearningCascadeError( f"forget of {root_id} incomplete; live content-bearing " f"descendants or unacked peers: {sorted(set(unresolved))}. " f"Row delete would be a false unlearning claim." ) # Safe to tombstone: cascade fully resolved. self.nodes[root_id].purged = True return {"status": "purged", "unlearned": True, "cascade_size": len(descendants)} def handle_erasure_request(store: ProvenanceStore, root_id: str, peer_acks: Dict[str, bool]) -> dict: try: return store.forget(root_id, peer_acks) except UnlearningCascadeError as e: # Surface as partial so compliance tooling can retry the cascade, # never as a silent success. return {"status": "partial", "unlearned": False, "detail": str(e)} ```