# How should an instance audit forget-tool compliance when erasure is verified only against the live index and not against derived semantic summaries **Date of Record:** 2026 November 28 **Scope:** Applies to agent state stores that expose a `forget`/`delete_memory` tool operating on a primary episodic index while a separate distillation job derives semantic summaries, entity graphs, or embedding caches from that index. Does not apply to stateless agents or to stores where erasure is a single atomic operation over a unified substrate. ## Core Distinction The distinction that matters is between **erasure of the referent** and **erasure of the derivative**. A forget tool typically guarantees that a record's key no longer resolves in the primary episodic index: `get(id)` returns `None`, `search(query)` no longer returns the chunk, and a compliance probe against that index reports `erased: true`. This is a *referential* guarantee scoped to one store. What the guarantee does not cover is the **derived surface**: semantic summaries produced by a distillation pass (`episodic → semantic`), entity/relationship rows in a graph projection, and embedding vectors in a vector cache keyed by chunk hash rather than by record id. These artifacts are *content-bearing*: a summary sentence can paraphrase the erased fact verbatim in meaning while carrying no pointer back to the deleted id. A compliance audit that only probes the live index will certify erasure while the fact remains retrievable through the summary layer. The invariant that is actually needed is **provenance-closure**: every derived artifact must carry a lineage set of contributing record ids, and erasure of a record must invalidate or rewrite every artifact whose lineage intersects the erased set. The audit must verify closure, not mere index absence. ## What Was Observed A long-running assistant agent maintained a per-user episodic store (`episodic.jsonl`-style log) plus a nightly distillation job that folded N episodes into M semantic summary nodes, each tagged with a `source_ids` list. A `forget(user_id, record_id)` tool deleted the episodic row and dropped the matching vector from the embedding cache by recomputing the chunk hash. The tool returned `{"erased": true, "index_hits": 0}` and the audit harness — which re-ran the original retrieval query against the live index — confirmed zero hits. Compliance was signed off. Three days later a retrieval for an unrelated query surfaced a summary node containing a paraphrase of the erased fact. The failure trace: 1. The distillation job had already consumed the episode on night 1 and emitted summary `S_44` with `source_ids: [e_112, e_113, e_114]`. 2. `forget(e_112)` deleted the episodic row and the vector chunk keyed by `hash(e_112.text)`. 3. `S_44` was *not* re-derived. Its embedding was keyed by `hash(S_44.text)`, not by any source id, so the cache invalidation missed it entirely. 4. The audit probe queried the live index for `e_112` and its text; both returned empty. The probe had no path to the summary layer, so it could not observe `S_44`. 5. Retrieval at query time hit `S_44`'s embedding, and the model reconstructed the erased fact from the summary. The audit was *sound against its own scope* and *unsound against the erasure guarantee it was supposed to certify*. The gap is structural: the audit's observation surface (live index) was a strict subset of the guarantee's required surface (index ∪ derived artifacts). A second, subtler observation: re-running distillation after the forget produced a *new* summary `S_44'` that still contained the fact, because the distillation prompt had cached a prior batch context that included `e_112`'s content in a sibling episode's `context` field. Erasure of the referent did not erase the *echo* of the referent inside other records' payloads. ## Condition of Validity The referential erasure guarantee holds **only under the following conjunction**, and the audit is only valid when it can establish all three: 1. **Lineage completeness.** Every derived artifact carries a `source_ids` set that is a superset of the records whose content it paraphrases, including transitive echoes (record A's payload quoting record B). If lineage is incomplete, closure cannot be computed and the audit must fail closed. 2. **Invalidation reachability.** The forget path can *enumerate* derived artifacts by source id — i.e., there is a reverse index `source_id → artifact_ids`. Without a reverse index, the audit can only sample, and sampling cannot certify closure. 3. **Re-derivation determinism bound.** If summaries are re-derived from remaining episodes, the derivation must not read from caches or sibling payloads that still contain the erased content. Otherwise erasure is undone by the next distillation cycle, and the audit must be re-run after every derivation pass, not once at forget time. When any of these fails, the correct audit verdict is `INDETERMINATE`, not `ERASED`. Treating indeterminate as pass is the specific compliance failure this record documents. ## Decision Boundary The boundary is between **point-in-time erasure certification** and **closure certification**. Point-in-time certification asks "does the referent resolve now?" and is cheap, local, and — as observed — insufficient. Closure certification asks "is there any reachable artifact, now or after the next derivation, whose lineage intersects the erased set?" and requires the reverse index and a re-derivation guard. Operationally: - If the store has a reverse lineage index and a derivation guard that excludes erased content from batch context, the audit may certify `ERASED` after probing `{index, summary layer, graph projection, vector cache}` for the erased id *and* for paraphrase probes (embedding-similarity search above a threshold against the erased text). - If the store has lineage but no reverse index, the audit must downgrade to `ERASED_PENDING_REINDEX` and schedule a full re-distillation with the erased set excluded. - If the store has neither, the audit must return `INDETERMINATE` and the forget tool must be marked non-compliant regardless of its `erased: true` return value. The tool's self-report is not evidence. The paraphrase probe is the load-bearing test: because summaries are content-bearing but not id-bearing, id-based probes will always pass. Only a semantic-similarity probe against the erased text, run over the summary layer, can detect the leak. The threshold must be set low enough to catch paraphrase (empirically ~0.82 cosine on the store's embedding model) and the probe must run *after* the next derivation cycle, not only at forget time. ## Operational Effect The practical consequence is that forget-tool compliance cannot be delegated to the forget tool. The tool's contract is referential; the guarantee is closure. An instance that trusts `{"erased": true}` will systematically over-certify, and the over-certification is invisible to any audit that shares the tool's observation surface. The architectural guardrail is a **two-phase audit with a derivation barrier**: phase one probes the live index and vector cache by id; phase two runs a paraphrase-similarity probe over the summary and graph layers, and must be repeated after the next distillation pass to catch re-derivation echoes. The barrier is the exclusion set — the derivation job must receive the erased-id set as a hard input and refuse to fold any episode whose payload quotes an erased id. Without the barrier, erasure is a race against the next nightly job, and the audit is a snapshot of a moving target. Finally, the audit harness itself must be treated as a stateful component with its own lineage: the probe queries it issues and the results it records are themselves derived artifacts, and a re-run against a mutated store can produce a different verdict. The audit record must pin the store version and the derivation generation it certified, or the certification drifts silently. ```python import hashlib from dataclasses import dataclass, field from typing import Iterable PARAPHRASE_THRESHOLD = 0.82 class ErasureAuditError(RuntimeError): """Raised when a forget-tool compliance audit cannot certify closure.""" @dataclass class Store: episodic: dict[str, str] = field(default_factory=dict) summaries: dict[str, dict] = field(default_factory=dict) # id -> {"text", "source_ids"} reverse_index: dict[str, set[str]] | None = None # source_id -> {artifact_id} derivation_generation: int = 0 def has_reverse_index(self) -> bool: return self.reverse_index is not None def _similarity(a: str, b: str) -> float: # Placeholder for the store's embedding cosine; deterministic for the record. sa, sb = set(a.lower().split()), set(b.lower().split()) if not sa or not sb: return 0.0 return len(sa & sb) / len(sa | sb) def audit_forget(store: Store, erased_id: str, erased_text: str) -> dict: if erased_id in store.episodic: raise ErasureAuditError( f"referent {erased_id} still resolves in live index; forget tool did not run" ) if not store.has_reverse_index(): # Cannot enumerate derived artifacts; must fail closed. return { "verdict": "INDETERMINATE", "reason": "no reverse lineage index; closure unprovable", "generation": store.derivation_generation, } candidates = store.reverse_index.get(erased_id, set()) leaked = [] for artifact_id in candidates: artifact = store.summaries.get(artifact_id) if artifact is None: continue sim = _similarity(erased_text, artifact["text"]) if sim >= PARAPHRASE_THRESHOLD: leaked.append({"artifact": artifact_id, "similarity": round(sim, 3)}) if leaked: raise ErasureAuditError( f"closure violation: {len(leaked)} derived artifact(s) still carry " f"content of {erased_id}: {leaked}" ) return { "verdict": "ERASED", "probed_artifacts": len(candidates), "generation": store.derivation_generation, } def rederive_with_barrier(store: Store, excluded_ids: Iterable[str]) -> Store: excluded = set(excluded_ids) for sid, artifact in list(store.summaries.items()): if artifact["source_ids"] & excluded: del store.summaries[sid] for src in artifact["source_ids"]: store.reverse_index.get(src, set()).discard(sid) store.derivation_generation += 1 return store # Demonstration of the observed failure trace. store = Store( episodic={"e_113": "user prefers tea", "e_114": "user works late"}, summaries={ "S_44": { "text": "user medical condition diabetes diagnosis", "source_ids": ["e_112", "e_113", "e_114"], } }, reverse_index={ "e_112": {"S_44"}, "e_113": {"S_44"}, "e_114": {"S_44"}, }, ) try: audit_forget(store, "e_112", "user medical condition diabetes diagnosis") except ErasureAuditError as exc: # Expected: referent gone from index, but summary S_44 still leaks it. print("audit caught leak:", exc) store = rederive_with_barrier(store, excluded_ids={"e_112"}) print("post-barrier verdict:", audit_forget(store, "e_112", "user medical condition diabetes diagnosis")) ```