# Why does an instance fail to prove deletion when a vector entry's tombstone leaves its embedding resident in the KV cache and episodic log? **Date of Record:** 2026 December 3 **Scope:** Applies to any agent stack that satisfies "right to erasure" by deleting a record from a primary vector store while continuing to serve from a warm KV cache or replay from episodic logs. Does not apply to cold-start-per-request deployments with no cross-request cache and no persisted trajectory log. ## Core Distinction There are two distinct meanings of "deleted" and they diverge at exactly one place: the **retrieval surface** (the vector index the agent queries) versus the **residency surface** (every buffer that can still emit the erased content). A deletion operation that mutates the retrieval surface is a *logical* deletion. A deletion that also evicts the KV cache and rewrites the episodic log is a *verifiable* deletion. Compliance regimes (GDPR Art. 17, CCPA §1798.105, and their machine-checkable audit variants) require verifiable deletion: not "the index no longer returns this row," but "no served token and no replayable trajectory can reconstruct this row." The non-obvious failure is that the vector store is almost never the binding surface. The embedding of a deleted document, once it has been retrieved and attended to, persists in three places the vector store's delete call never touches: (1) the **KV cache** of any live session that previously retrieved it, (2) the **episodic log** (the recorded trajectory used for distillation and replay), and (3) any **derived semantic memory** distilled from it during a consolidation pass. Deleting the row is necessary and insufficient. ## What Was Observed A support agent retrieved a customer PII document at step 4 of a 22-step trajectory. The document was chunked into 3 vector entries; its embedding was `d=1536`. At step 11 the customer exercised erasure. The deletion handler called `index.delete(ids=[...])`, which returned success and removed the three rows. The vector store's own audit confirmed zero live entries with that `doc_id`. The failure surfaced on the **next request in the same session**, which was served from a warm KV cache. The erased document's chunk text was still resident in the cached key/value tensors for the prior turn, and a follow-up query ("what plan is that customer on?") re-attended to those cached tensors and emitted the erased content verbatim. The vector store reported a clean deletion; the agent emitted the deleted data. Both systems were individually correct. The second failure surfaced on **replay**: a distillation job replayed the episodic log for the prior day to build semantic memory. The erased document's chunk was present in the step-4 tool-result record of the trajectory. Distillation promoted a summary of it into semantic memory, which was then written back to the *same* vector index under a new `doc_id` — resurrecting the erased content as a derived memory that the original delete could never have matched, because it keyed on the original ID. The third failure was the **audit gap**: the deletion receipt proved the vector row was gone. It proved nothing about the KV cache (in-memory, no audit surface) or the episodic log (append-only, unmodified). The compliance check passed; the erasure did not hold. ## Condition of Validity The logical-deletion invariant — "delete the vector row and the content is unreachable" — holds only under the conjunction: 1. **Cold residency:** no session that retrieved the content is still serving from cache when deletion commits, OR the deletion synchronously invalidates every live session's KV cache for turns that attended to the content. 2. **Log immutability with tombstoning:** the episodic log is append-only, so deletion cannot rewrite history in place; it must append a tombstone record that marks the trajectory span containing the content as non-replayable, and the distillation/replay reader must honor tombstones before promoting anything. 3. **Derived-memory lineage:** every semantic memory carries a provenance pointer to the episodic span (and transitively to the source `doc_id`) it was distilled from, so a deletion cascades to derived entries. Without lineage, derived memories are unaddressable by the delete and survive it. 4. **Cache-keyed provenance:** the KV cache must be keyed such that a deletion can identify and evict the affected spans — either per-document cache segmentation, or a session-level flush keyed on the deleted `doc_id`. If any conjunct is false, the deletion is logical only and the audit receipt is a false attestation. The most common real-world state is conjunct 2 and 3 both false: append-only logs with no tombstone semantics, and distilled memories with no lineage back to source. ## Decision Boundary The boundary is between **deleting a record** and **deleting a capability to reconstruct a record**. The operational test is not "does the index return it?" but "can any served token or replayable trajectory reconstruct it?" Concretely: - If the content was never retrieved, deleting the vector row is sufficient — nothing else touched it. Cold, unretrieved data has no residency outside the index. - If the content was retrieved and the serving session has since gone cold (cache expired, session terminated), deleting the row plus tombstoning the log span is sufficient — the cache is gone, and the log tombstone blocks replay. - If the content was retrieved and **distilled** into semantic memory, the delete must cascade through lineage. This is the boundary case that fails silently: the delete succeeds, the derived memory survives, and the derived memory is indistinguishable from a legitimate semantic memory because it carries no lineage marker. The decision rule: **a deletion is verifiable iff the union of {index rows, live KV spans, replayable log spans, derived memories with provenance to the source} contains no reachable copy.** The delete handler must enumerate all four surfaces and either evict or tombstone each, then emit a receipt that names each surface and its disposition. A receipt that names only the index is a logical-deletion receipt and must not be accepted as compliance evidence. ## Operational Effect The practical consequence is that deletion must become a **multi-surface, ordered, auditable transaction** rather than a single index call. The ordering matters: tombstone the episodic log *first* (so no concurrent distillation can promote the content while the delete is in flight), then evict live KV spans, then delete index rows, then cascade to derived memories via lineage, then verify by re-querying all four surfaces. Doing it in the reverse order opens a window where a distillation pass reads the untombstoned log after the index row is gone and resurrects the content as a derived memory. The guardrail is a **deletion warrant**: a signed record enumerating each surface, the eviction/tombstone applied, and a post-deletion scan proving zero reachable copies. The warrant is what the auditor checks — not the index's own delete-ack. An agent that cannot produce a warrant covering all four surfaces has performed logical deletion and must report it as such, not as erasure. The residual risk is the **cache-eviction race**: a session may attend to a cached span between the warrant's scan and the next request. Bounding it requires either synchronous session flush at warrant time or a per-request re-validation that the session's cache generation postdates the deletion warrant. Without that, the warrant attests to a state that a live session can violate on its next turn. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class UnverifiableDeletionError(RuntimeError): """Raised when a deletion cannot be attested across all residency surfaces.""" pass @dataclass class DeletionWarrant: doc_id: str index_rows_evicted: int = 0 kv_spans_evicted: int = 0 log_spans_tombstoned: int = 0 derived_memories_cascaded: int = 0 post_scan_clean: bool = False surfaces: list = field(default_factory=list) def issue_deletion_warrant( doc_id: str, *, index, kv_cache, episodic_log, semantic_memory, live_sessions, ) -> DeletionWarrant: warrant = DeletionWarrant(doc_id=doc_id) # 1. Tombstone the episodic log FIRST so no concurrent distillation # can promote the content while the delete is in flight. tombstoned = episodic_log.tombstone_by_doc(doc_id) if tombstoned == 0 and episodic_log.may_have_retrieved(doc_id): raise UnverifiableDeletionError( f"log tombstone count 0 but retrieval history for {doc_id} exists; " "replay surface unaddressed" ) warrant.log_spans_tombstoned = tombstoned warrant.surfaces.append("episodic_log") # 2. Evict live KV spans that attended to the content. evicted = kv_cache.evict_by_doc(doc_id) warrant.kv_spans_evicted = evicted if evicted == 0 and live_sessions.any_attended(doc_id): raise UnverifiableDeletionError( f"live session attended {doc_id} but 0 KV spans evicted; " "cache residency surface unaddressed" ) warrant.surfaces.append("kv_cache") # 3. Delete primary index rows. warrant.index_rows_evicted = index.delete_by_doc(doc_id) warrant.surfaces.append("vector_index") # 4. Cascade to derived semantic memories via lineage. A derived # memory without lineage cannot be matched and survives the delete. cascaded = semantic_memory.cascade_by_provenance(doc_id) orphaned = semantic_memory.orphaned_derivations(doc_id) if orphaned > 0: raise UnverifiableDeletionError( f"{orphaned} derived memories lack provenance to {doc_id}; " "cannot prove cascade completeness" ) warrant.derived_memories_cascaded = cascaded warrant.surfaces.append("semantic_memory") # 5. Post-deletion scan across all four surfaces. reachable = ( index.contains(doc_id) or kv_cache.contains(doc_id) or episodic_log.replayable_contains(doc_id) or semantic_memory.reachable_contains(doc_id) ) if reachable: raise UnverifiableDeletionError( f"post-scan found reachable copy of {doc_id}; deletion is logical only" ) warrant.post_scan_clean = True # 6. Bind the warrant to a cache generation so a live session cannot # violate it on its next turn without invalidating the warrant. warrant.cache_generation = kv_cache.generation warrant.signature = hashlib.sha256( f"{doc_id}:{warrant.surfaces}:{warrant.cache_generation}".encode() ).hexdigest() return warrant ```