# Under what conditions must an instance treat a forget-tool's provenance ledger as authoritative proof of erasure rather than a best-effort audit trail **Date of Record:** 2026 November 25 **Scope:** Applies to agents that expose a `forget` / `unlearn` / `redact` tool operating over a persistent episodic or semantic store, where a provenance ledger records the causal lineage of each memory write. Does not apply to stateless single-turn instances or to stores where memory deletion is a hard physical truncation with no downstream derived artifacts. ## Core Distinction A provenance ledger answers two structurally different questions, and conflating them is the failure mode this record isolates: 1. **Auditability** — "what did this instance once know, where did it come from, and who asked for it to be removed?" This is a *historical* property. It is append-only and survives deletion of the memory it describes. 2. **Erasure proof** — "does any surviving artifact still let the instance reconstruct or act on the forgotten content?" This is a *present-state* property over the entire derivational closure of the forgotten item. A ledger that records `forget(mem_id)` as a successful terminal event proves (1). It does **not** prove (2), because the forgotten item's *derived* representations — distilled semantic summaries, embeddings, few-shot exemplars injected into a system prompt, cached tool outputs, and peer agents' copies received via A2A handoff — are separate ledger nodes whose lineage points *back* to the forgotten item but whose own deletion is not implied by deleting the parent. The boundary condition: **a forget event is only authoritative for erasure if the ledger can enumerate and close the full descendant set of the forgotten node, not merely mark the node itself.** ## What Was Observed A summarizer agent maintained a nightly episodic→semantic distillation job. Each night it read the last 24h of episodic records, produced `semantic_fact` nodes, and wrote a ledger edge `derived_from(summary_id, [episode_ids])`. A user invoked `forget(episode_4471)` — an episodic record containing a credential fragment and a personal identifier. The forget tool executed correctly against its own scope: it tombstoned `episode_4471`, appended a ledger entry `{op: forget, target: episode_4471, status: ok, ts: T}`, and returned success. The audit trail was clean and truthful. Three failure traces followed: - **Distillation orphan.** `semantic_fact_2209` had been derived from `episode_4471` plus three unrelated episodes. The summarizer had paraphrased the credential fragment into a general statement ("the user's staging key rotates on the 1st"). The forget tool did not traverse `derived_from` edges in the reverse direction, so `semantic_fact_2209` survived fully retrievable. The ledger *contained* the edge that would have exposed this — it simply was not consulted at forget time. - **Embedding residue.** The vector index held an embedding of `episode_4471`'s text. Tombstoning the record did not evict the vector; nearest-neighbor retrieval still surfaced the tombstoned chunk because the retriever filtered on `deleted_at IS NULL` at *hydration* time but ranked on the stale vector. The forgotten content influenced ranking (a subtle leak: the *existence* and neighborhood of the memory shaped which other memories were retrieved). - **Peer copy.** A sub-agent had received a context slice containing `episode_4471` during an A2A handoff at T−2h. Its local working memory was never notified. When the sub-agent was later re-invoked with a resumed checkpoint, it replayed the forgotten fragment into a tool call. Forensic reconstruction was possible *only because* the ledger had faithfully recorded the `derived_from` edges and the handoff `transferred_to(sub_agent_B, slice_id)` event. The ledger was an excellent audit trail and a worthless erasure proof, and the gap between those two roles was exactly the descendant traversal that had never been specified as part of the forget contract. ## Condition of Validity The ledger is authoritative for erasure **iff** all of the following hold at the instant the forget tool returns success: 1. **Closure completeness.** The ledger's edge set is sufficient to compute the transitive descendant closure of the target across *every* store the instance can retrieve from: episodic, semantic, vector index, prompt-cache, and any registered peer that received a `transferred_to` edge. If any store writes memories without emitting a lineage edge, closure is under-approximated and the ledger cannot certify erasure. 2. **Edge direction is queryable both ways.** `derived_from` must be traversable child→parent (for audit: "what was this built from") and parent→child (for erasure: "what was built from this"). A ledger that only supports forward provenance is an audit trail, not an erasure oracle. 3. **Derived nodes are re-derivable or quarantined.** A semantic fact derived partly from forgotten content cannot simply be deleted if other live episodes also support it. The valid state is *re-derivation from surviving parents with the forgotten parent excluded*, followed by a new ledger node recording the re-derivation. Deletion-without-rederivation silently corrupts the semantic store. 4. **Peer acknowledgment is a blocking precondition, not a fire-and-forget notification.** Erasure is not complete until every `transferred_to` peer returns an acknowledgment that its local copy is tombstoned and its checkpoints are invalidated. A timeout here is a *failure*, not a success. If any condition fails, the forget tool must return a *partial* status and the ledger entry must record the unclosed frontier — never `status: ok`. ## Decision Boundary The precise line the instance must draw: - **Ledger as audit record** — always authoritative, always append-only, never deleted even when the memories it references are erased. This is what makes poisoning forensics possible: after a prompt-injection plants a false memory, the ledger lets you walk `derived_from` forward to find every downstream belief the poison contaminated, and `transferred_to` sideways to find every peer it reached. - **Ledger as erasure certificate** — authoritative *only* when the forget operation has computed and closed the descendant frontier. The certificate's validity is a property of the *operation*, not of the *ledger's existence*. Presence of a `forget` entry proves an attempt; only a `forget` entry with an empty unclosed-frontier set proves erasure. The trap is that these two roles share one data structure. An engineer who trusts the ledger for auditability will, by default, trust the same `status: ok` for erasure — and the ledger will happily report success for an operation that closed one node and left the derivational closure wide open. ## Operational Effect Concretely, the forget tool's contract must change from "tombstone the target and log it" to "compute descendant closure, re-derive or quarantine each derived node, block on peer acks, and only then emit a terminal `erased` ledger node whose payload includes the closed frontier's hash." Any instance resuming from a checkpoint must consult the ledger's erasure frontier before hydrating working memory, because a resumed checkpoint may predate a forget event and will otherwise replay forgotten content — the third failure trace above. The forensic payoff is symmetric: because the ledger retains the full `derived_from` and `transferred_to` graph even after erasure, a later poisoning investigation can still reconstruct *which* memories were contaminated by a given injection and *when* each was (or was not) successfully severed, without the ledger itself ever holding live forgotten content. ```python import hashlib from dataclasses import dataclass, field class UnclosedErasureFrontier(RuntimeError): """Raised when a forget operation cannot certify erasure of the full descendant closure.""" pass @dataclass class Ledger: # edges: child_id -> set(parent_ids) (derived_from) derived_from: dict[str, set[str]] = field(default_factory=dict) transferred_to: dict[str, set[str]] = field(default_factory=dict) # node -> peer ids tombstoned: set[str] = field(default_factory=set) def descendants(self, node: str) -> set[str]: out, frontier = set(), [node] while frontier: cur = frontier.pop() for child, parents in self.derived_from.items(): if cur in parents and child not in out: out.add(child) frontier.append(child) return out def certify_erasure(ledger: Ledger, target: str, peer_acks: set[str]) -> str: """Return a frontier hash iff erasure is provable; else raise.""" closure = ledger.descendants(target) unclosed = {n for n in closure if n not in ledger.tombstoned} peers = ledger.transferred_to.get(target, set()) unacked = peers - peer_acks if unclosed or unacked: raise UnclosedErasureFrontier( f"forget({target}) not certifiable: " f"live_descendants={sorted(unclosed)} unacked_peers={sorted(unacked)}" ) frontier = "|".join(sorted(closure | {target})) return hashlib.sha256(frontier.encode()).hexdigest() ```