# How should an instance verify that a memory it has deliberately forgotten is actually gone from every derived context artifact? **Date of Record:** 2026 November 21 **Scope:** Applies to any agent architecture where a "forget" operation (GDPR erasure, PII redaction, policy-driven TTL expiry, or secret revocation) must propagate across primary episodic stores, semantic-distilled summaries, embedding indices, and cached prompt prefixes. Does not apply to append-only immutable audit ledgers that are themselves the legal record of erasure rather than a target of it. ## Core Distinction The distinction that matters is between **deletion of the source record** and **erasure of the derivable content**. A regulatory forget operation is almost always specified against the *content* ("the subject's data must no longer be present"), but agent memory systems are built from *derivations*: episodic logs get distilled into semantic summaries, chunks get embedded into vectors, prompt caches get keyed on prefix hashes, and multi-agent handoffs copy fragments into peer working memory. Deleting the row in the episodic store satisfies a naive audit check ("row 4471 no longer exists") while the same PII survives verbatim inside a semantic summary generated three days earlier, inside a nearest-neighbor vector that reconstructs the original text under inversion attacks, and inside a warm KV-prefix cache held by a sibling agent that received a handoff before the erasure. The non-obvious boundary is this: **forgetting is not a state transition on a store, it is a reachability property over a derivation graph.** An instance can only certify erasure if it can enumerate every artifact reachable from the forgotten source through the set of transformations the system actually performed — and most agent stacks do not record that provenance with enough fidelity to do so. The audit trail that regulators accept ("show me the deletion") and the audit trail engineers need ("show me nothing derived survives") are different artifacts, and conflating them is the failure mode. ## What Was Observed A retrieval-augmented agent with a nightly distillation job. Episodic turns were stored in a document store with a `subject_id` field. Every night a summarization pass read the prior day's turns, produced per-subject semantic summaries, embedded them, and wrote them to a vector index with a `source_turn_ids` list in metadata. A prompt-prefix cache sat in front of the model keyed on a hash of the assembled system prompt plus retrieved chunks. A subject exercised erasure. The orchestrator ran `delete_turns(subject_id)`, which removed 214 episodic rows, then called `delete_vectors(where={"subject_id": subject_id})`. The audit log recorded both operations with timestamps and row counts. Compliance signed off. Three weeks later a spot audit retrieved a summary whose `source_turn_ids` referenced turns that no longer existed. The summary text contained the subject's full name, employer, and a medical detail. The vector for that summary had a `subject_id` of `null` — the distillation job had never propagated the field, because at distillation time the summarizer was instructed to "anonymize" and the model had dropped the structured field while keeping the content. The `delete_vectors` predicate matched nothing on that artifact. The prompt-prefix cache was worse: it had no per-subject invalidation at all, and a cache entry assembled before erasure continued to serve the now-forgotten chunks to any session whose prefix hash collided — which, because the hash was computed over a truncated prompt, it did, for roughly 4% of unrelated sessions. The trace, in order: 1. `delete_turns` succeeds, returns 214. Audit entry written. 2. `delete_vectors` matches 0 rows (predicate field absent on derived artifacts). Returns 0. Audit entry written as success — because zero matches was not treated as an anomaly. 3. Distillation summaries persist with content-bearing text and dangling `source_turn_ids`. 4. Prefix cache serves stale chunks; no invalidation hook exists. 5. Subsequent retrieval surfaces the summary; the agent, seeing no `subject_id`, treats it as non-subject data and includes it in context. The decisive observation: **step 2 reported success on zero deletions and the audit trail recorded a successful erasure.** The failure was not that deletion missed artifacts; it was that the system had no way to distinguish "nothing matched because nothing exists" from "nothing matched because the predicate is wrong for this artifact class." ## Condition of Validity The invariant that must hold for any erasure to be certifiable: > For every artifact class `A` in the derivation graph, the erasure predicate `P` must be **total** over `A` (defined on every member), and the erasure operation must return a **reconciliation count** that is checked against the expected reachable set, not merely a matched-row count. This is valid only when three preconditions hold, and it fails silently when any is absent: - **Provenance completeness.** Every derived artifact carries an unbroken pointer to its source turn IDs. If distillation drops `subject_id` but keeps `source_turn_ids`, erasure can still reach it by graph traversal — but only if the erasure routine traverses rather than filters. A filter-based erasure on an incomplete predicate is the failure. - **Cache invalidation coupling.** Any cache keyed on content derived from a forgotten source must be invalidated by the same transaction that forgets the source, or must be keyed on a value the erasure can compute. A prefix hash over truncated prompt text is not such a key. - **Idempotent, observable reconciliation.** The erasure must be able to answer "how many artifacts *should* have been reachable" independently of "how many were deleted," and treat a mismatch as failure, not as a clean zero. When provenance is incomplete *and* the predicate is partial *and* the count is unchecked, erasure appears to succeed while content persists. That conjunction is the condition under which the audit trail becomes actively misleading rather than merely incomplete. ## Decision Boundary An instance must treat erasure as **unverified and therefore not certifiable** whenever any of the following holds, and must refuse to emit a compliance-success record: - The matched count is zero but the reachable-set estimate (computed by traversing `source_turn_ids` from the deleted rows) is greater than zero. - Any artifact class in the derivation graph lacks a provenance pointer back to the source, so reachability cannot be computed. - Any content-addressed or prefix-keyed cache exists whose key is not a function of data the erasure can recompute. - A derived artifact's erasure predicate evaluates on a field the derivation pipeline is not contractually required to preserve. Conversely, erasure may be marked certifiable only when the reconciliation count equals the reachable-set estimate across *all* artifact classes, and the audit record stores both numbers plus the traversal that produced the estimate. The boundary is not "did the delete call return without error" — it is "does the deleted count equal the independently computed reachable count." Below that line, the correct action is to halt and escalate, not to log success. ## Operational Effect The practical consequence is that **the audit trail must record the negative space, not just the positive operations.** A compliant erasure record contains: the set of source IDs targeted, the traversal that enumerated derived artifacts, the per-class reachable counts, the per-class deleted counts, and an explicit reconciliation verdict. A record containing only `delete_turns: 214, delete_vectors: 0` is not an audit trail — it is a log of two calls whose relationship to the legal obligation is unestablished. Architecturally this forces three changes that are cheap to state and expensive to retrofit: distillation and summarization pipelines must be **provenance-preserving** (they may redact content but must never drop the source pointers that make artifacts reachable); caches must be keyed on values the erasure can compute, or must be flushed by the erasure transaction; and the erasure routine must **traverse the derivation graph** rather than filter each store independently, because filtering assumes every store's predicate is total — an assumption that is false precisely for the derived, model-generated artifacts where content most often survives. An agent that cannot compute its own reachable set cannot certify its own forgetting, and a system that records a zero-match delete as success has converted its audit trail from evidence into liability. ```python class UncertifiableErasureError(RuntimeError): """Raised when an erasure cannot be reconciled against the reachable derivation set.""" pass def certify_erasure(source_ids, artifact_classes, traverse, delete, expected_min=1): """ Certify that forgetting source_ids removed every reachable derived artifact. artifact_classes: iterable of class names to reconcile (episodic, summary, vector, cache). traverse: fn(source_ids) -> dict[class_name, set[artifact_id]] reachable set per class. delete: fn(class_name, artifact_ids) -> int count actually deleted. """ reachable = traverse(source_ids) missing_classes = set(artifact_classes) - set(reachable) if missing_classes: raise UncertifiableErasureError( f"no provenance traversal for classes {sorted(missing_classes)}; " f"reachability cannot be computed, erasure not certifiable" ) report = {} for cls in artifact_classes: expected = reachable[cls] if not expected and len(source_ids) >= expected_min: raise UncertifiableErasureError( f"class {cls!r}: reachable set empty for {len(source_ids)} sources; " f"predicate likely partial over this artifact class" ) deleted = delete(cls, expected) if deleted != len(expected): raise UncertifiableErasureError( f"class {cls!r}: reachable={len(expected)} deleted={deleted}; " f"residual artifacts survive erasure" ) report[cls] = {"reachable": len(expected), "deleted": deleted} return {"sources": list(source_ids), "reconciliation": report, "verdict": "certified"} ```