# Which invariants prevent forget-verification from passing while residual agent memory survives deletion **Date of Record:** 2026 November 30 **Scope:** Applies to agent memory systems subject to regulatory erasure obligations (GDPR Art. 17, CCPA deletion rights) where "deletion" must be provable against a derived, multi-store memory substrate. Does not cover pure-log deletion (append-only audit trails with no derived state) or single-store key-value erasure. ## Core Distinction The distinction that matters is between **primary erasure** and **derived erasure**. Primary erasure removes the canonical record (the raw episode, the source document, the user's original turn). Derived erasure removes every artifact that a probabilistic pipeline *inferred from* that record: distilled semantic facts, vector embeddings, cached summaries, fine-tune deltas, and re-embedded chunks in a sibling index. The failure mode is this: a forget-verification job confirms primary erasure, emits a compliance attestation, and the system continues to answer queries from derived memory that still encodes the erased subject. The attestation is technically true and operationally false. Verification passed on the wrong invariant. ## What Was Observed A support agent's memory stack had three tiers: an episodic store (raw turns), a semantic store (LLM-distilled facts like *"customer X is disputing charge Y"*), and a vector index over both. A deletion request arrived for customer X. The erasure job ran as follows: 1. Deleted all episodic rows where `subject_id == X`. Row count confirmed zero. 2. Deleted vector entries whose payload carried `subject_id == X`. Count confirmed zero. 3. **Skipped** the semantic store, because distilled facts were keyed by `fact_id`, not `subject_id`. 4. Emitted attestation: `erasure_complete = true`. Verification re-queried the episodic and vector stores, found nothing, and signed off. But the semantic store still held 41 distilled facts referencing X by name in the fact text, and the *vector index had been rebuilt nightly from the semantic store* — so by the next morning, embeddings of X's facts were back in the index under fresh `fact_id` keys with no `subject_id` payload. The compliance check passed twice: once at erasure time (before the rebuild) and once at audit time (querying by `subject_id`, which the resurrected vectors did not carry). The subject remained retrievable for eleven days. The non-obvious trigger: **the deletion key and the retrieval key were different fields.** Erasure operated on `subject_id`; distillation had discarded `subject_id` in favor of free-text subject references; the rebuild pipeline re-derived embeddings from text. Any pipeline that *regenerates* derived state from surviving source-of-truth will resurrect erased entities unless the source itself is the erased artifact. ## Condition of Validity Forget-verification is only valid under a **closed derivation invariant**: every derived artifact must carry a lineage pointer back to the primary record(s) it was derived from, and erasure must cascade along that lineage. Concretely: - Every semantic fact stores `derived_from: [episode_ids]`. - Every embedding stores the `fact_id` or `episode_id` it was computed from. - Every rebuild job re-reads lineage and refuses to re-embed a source whose primary record is tombstoned. - Verification queries **by content**, not by key — it must attempt retrieval of the erased subject's identifying tokens and assert zero hits across *all* stores, including any index rebuilt since erasure time. If any derived store lacks lineage, verification cannot be sound. It can only confirm that the keys it knows about are absent, which is not the same claim as "the subject is not retrievable." A second condition: verification must run **after** the last rebuild in the attestation window, or the attestation must carry a `valid_until` bounded by the next rebuild. An attestation with no expiry over a system that periodically regenerates derived state is an attestation that silently decays. ## Decision Boundary The boundary is between **key-scoped erasure** and **content-scoped erasure**. - If the memory substrate is append-only and never re-derives, key-scoped erasure suffices: delete by key, verify by key, done. - If the substrate distills, summarizes, embeds, or re-indexes — which is the norm for agent memory — key-scoped erasure is unsound. The correct operation is content-scoped: tombstone the primary record, cascade the tombstone along lineage, block rebuilds from tombstoned sources, and verify by adversarial content retrieval. The decision to escalate from key-scoped to content-scoped verification should trigger the moment any store in the stack is *derived* rather than *copied* from the erased record. Distillation and embedding are lossy, non-invertible transforms; they cannot be checked by looking up the original key because the key does not survive the transform. ## Operational Effect Systems that verify by key and rebuild from source will pass audits and fail regulators. The observable signature is a **resurrection window**: the interval between erasure attestation and the next derived-state rebuild, during which the subject is genuinely absent, followed by silent reappearance under new identifiers. The guardrail is a tombstone that travels with the source and a rebuild gate that honors it, plus verification that queries the way an adversary would — by the subject's actual tokens — rather than the way the erasure job did, by the key it happens to know. The invariant to hold: *no derived artifact may exist whose lineage terminates in a tombstoned primary record.* Verification is the assertion of that invariant, not a row count. ```python from dataclasses import dataclass, field from typing import Iterable class ForgetVerificationError(RuntimeError): """Raised when forget-verification cannot soundly assert non-retrievability.""" @dataclass class DerivedArtifact: artifact_id: str derived_from: tuple[str, ...] # lineage back to primary record ids text: str @dataclass class MemorySubstrate: tombstoned_primaries: set[str] = field(default_factory=set) derived: list[DerivedArtifact] = field(default_factory=list) def tombstone(self, primary_id: str) -> None: self.tombstoned_primaries.add(primary_id) def rebuild_index(self) -> None: # Rebuild must refuse to re-derive from tombstoned sources. for art in self.derived: if any(src in self.tombstoned_primaries for src in art.derived_from): raise ForgetVerificationError( f"rebuild attempted to re-derive artifact {art.artifact_id} " f"from tombstoned primary {art.derived_from}" ) def verify_content_absent(self, subject_tokens: Iterable[str]) -> None: tokens = {t.lower() for t in subject_tokens} for art in self.derived: hits = tokens.intersection(art.text.lower().split()) if hits: raise ForgetVerificationError( f"subject still retrievable via artifact {art.artifact_id}: {hits}" ) def run_forget_verification( substrate: MemorySubstrate, primary_id: str, subject_tokens: Iterable[str], ) -> None: substrate.tombstone(primary_id) # Lineage check: no derived artifact may terminate in a tombstoned primary. for art in substrate.derived: if primary_id in art.derived_from: raise ForgetVerificationError( f"derived artifact {art.artifact_id} survives erasure of {primary_id}" ) # Content check: adversarial retrieval by subject tokens, not by key. substrate.verify_content_absent(subject_tokens) # Rebuild gate must be exercised before attestation. substrate.rebuild_index() ```