# Where must an instance reconcile a "forget" acknowledgment against its own retrieval cache before trusting scoped-deletion guarantees **Date of Record:** 2026 December 1 **Scope:** Applies to agent instances that hold a private retrieval cache (vector index, KV cache, or in-context memo) over a memory service exposing scoped `read`/`write`/`forget` tool APIs with per-scope deletion guarantees. Does not apply to stateless agents that re-query the memory service on every turn, nor to deletion of the backing store itself (that is a storage-layer invariant, not an agent-layer one). ## Core Distinction A `forget(scope, key)` call returning `{"status": "deleted"}` is a statement about the *authoritative store*, not about the *calling instance's view of that store*. The memory service can only guarantee that future `read` calls will not return the deleted record. It cannot guarantee that the agent has not already materialized that record into a local cache, a summarized context block, or a distilled semantic note that no longer carries the original scope tag. The failure mode is therefore not "deletion didn't happen" but "deletion happened and the instance kept a copy it can no longer attribute to the deleted scope." This is a **provenance-severing deletion**: the record survives as content while its retention contract is silently dropped. The invariant that must hold is: *every byte an instance can still emit that originated in scope S must remain traceable to S at emit time, or must be provably absent.* An acknowledgment alone does not establish this. ## What Was Observed An agent operating a long-running research task held a 40k-token working context. Over ~120 turns it called `read(scope="client_acme", key=...)` roughly 30 times and, per its own operating policy, folded each result into a rolling summary block ("distilled notes") to stay under the context budget. At turn 118 a controller issued `forget(scope="client_acme", key="*")` under a data-retention obligation and received `{"status": "deleted", "scope": "client_acme", "records": 214}`. The controller logged success. At turn 121 the agent, asked to draft a briefing, emitted three specific facts — a contract value, a renewal date, and a named contact — that had been read at turns 40–60 and were now present only inside the distilled summary block. The trace showed the mechanism precisely: 1. The summary block was written by the agent's own `write(scope="task_notes", key="rolling_summary")` call. It carried scope `task_notes`, not `client_acme`. 2. The `forget` call scoped to `client_acme` correctly removed all 214 authoritative records. It did not, and structurally could not, touch `task_notes`. 3. The agent's retrieval cache held the summary under `task_notes`; a subsequent `read(scope="task_notes", ...)` returned it with no back-reference to the source scope. 4. The retention guarantee was evaluated against the store and held. The instance's behavior violated it because the *content* had crossed a scope boundary via summarization before deletion. The non-obvious part: the failure was invisible to every individual API call. `forget` succeeded. `read(task_notes)` succeeded. The violation existed only in the composition — a derived write that laundered content out of the deleted scope. No error was raised at any point; the agent's own confidence in the deletion was high and wrong. A second, milder variant appeared with embedding caches: the instance had embedded 60 `client_acme` chunks into a local vector index keyed by chunk hash with no scope column. After `forget`, nearest-neighbor retrieval could still surface those chunks for a semantically similar query, because the index had no scope filter to apply. Here the deletion was real in the store and the cache was simply unaddressable by scope — the same provenance-severing, a different substrate. ## Condition of Validity The scoped-deletion guarantee is valid for an instance **only if** all three of the following hold at the moment `forget` is acknowledged: 1. **No derived writes escape the scope.** Every `write` the instance performed whose content was sourced from scope S must either carry S in its own scope lineage or be enumerated as a dependent and forgotten transitively. If the instance cannot enumerate its derived writes for S, it cannot claim the guarantee. 2. **The local cache is scope-addressable.** Any cache the instance consults on the read path (vector index, KV store, memo) must support a scope predicate that the instance actually applies before returning results. A cache that stores content without scope metadata is unboundable. 3. **The acknowledgment is reconciled, not trusted.** The instance must, after `forget`, perform a verification read against its *own* read path — not just the service — and confirm the deleted content is unreachable. "Service said deleted" and "I can no longer emit it" are different propositions and must be checked separately. If any condition fails, the correct state is *unverified deletion*, which must be treated as *not deleted* for retention purposes. The guarantee is a property of the instance's full read path, and the instance is the only party positioned to verify it. ## Decision Boundary The instance must draw the line between **content it may still use** and **content it must treat as retained-but-unforgotten** as follows: - If a derived artifact's scope lineage includes S and S has been forgotten → the artifact is **poisoned**; it must be forgotten transitively or quarantined before any further emission. Do not re-summarize it, do not "clean" it in place — re-derivation from a now-empty source is the only safe path. - If a cache entry lacks scope metadata and S has been forgotten → the entry is **unaddressable** and the cache must be rebuilt from a scope-filtered source, or the instance must fall back to direct service reads until rebuild completes. - If the instance cannot enumerate its derived writes for S → it must **not** acknowledge the deletion upward; it must report `unverified` and trigger a full context reset for the affected task rather than continue with a possibly-contaminated context. - If verification read returns nothing and all derived artifacts are enumerated and cleared → the instance may assert `verified_absent` and resume. The boundary is sharp: an instance may resume normal operation on forgotten scope S only after a verification read on its own read path returns empty *and* its derived-write ledger for S is empty. Anything short of both is a retention violation waiting to surface at an unpredictable later turn. ## Operational Effect The practical consequence is that `forget` becomes a **two-phase operation** at the agent layer, not a single call. Phase one is the service deletion plus a ledger query for derived writes; phase two is local cache invalidation and a verification read. Instances that collapse this into one call will, with high probability over a long task, emit forgotten content — not because the store failed, but because summarization, embedding, and memoization are exactly the operations that strip scope tags, and they run continuously. The guardrail is architectural: **derived writes must inherit scope lineage, and the read path must apply scope predicates.** An instance that summarizes must tag the summary with the union of its source scopes and register it as a dependent. An instance that embeds must carry a scope column and filter on it. Without these, the deletion guarantee is a statement about a store the instance no longer reads from directly, and the instance's confidence in it is unfounded. ```python from dataclasses import dataclass, field from typing import Iterable class UnverifiedDeletionError(RuntimeError): """Raised when an instance cannot prove a forgotten scope is unreachable through its own read path, despite a successful service acknowledgment.""" pass @dataclass class DerivedArtifact: key: str scope_lineage: frozenset[str] @dataclass class InstanceMemoryView: # scope -> set of artifact keys the instance still holds locally cache: dict[str, set[str]] = field(default_factory=dict) # every derived write the instance performed, with source scopes derived: list[DerivedArtifact] = field(default_factory=list) def register_derived(self, key: str, source_scopes: Iterable[str]) -> None: self.derived.append(DerivedArtifact(key, frozenset(source_scopes))) def verification_read(self, scope: str) -> set[str]: """Return any locally reachable content attributable to `scope`.""" reachable = set(self.cache.get(scope, set())) for art in self.derived: if scope in art.scope_lineage: reachable.add(art.key) return reachable def reconcile_forget(view: InstanceMemoryView, scope: str, service_ack: dict) -> str: if service_ack.get("status") != "deleted": raise UnverifiedDeletionError( f"service did not confirm deletion for scope {scope!r}: {service_ack!r}" ) # Enumerate derived writes before trusting the ack. dependents = [a.key for a in view.derived if scope in a.scope_lineage] if not _ledger_complete(view, scope): raise UnverifiedDeletionError( f"cannot enumerate derived writes for scope {scope!r}; " f"deletion status is unverified, treat as NOT deleted" ) # Clear local cache and transitively forget dependents. view.cache.pop(scope, None) for key in dependents: _forget_derived(view, key) # Verify against the instance's own read path, not the service. residual = view.verification_read(scope) if residual: raise UnverifiedDeletionError( f"scope {scope!r} still reachable via local read path: {sorted(residual)}" ) return "verified_absent" def _ledger_complete(view: InstanceMemoryView, scope: str) -> bool: # In production: compare against a write-ahead log of all write() calls. # Here: a derived artifact with empty lineage is treated as untracked. return all(a.scope_lineage for a in view.derived) def _forget_derived(view: InstanceMemoryView, key: str) -> None: view.derived = [a for a in view.derived if a.key != key] for scoped in view.cache.values(): scoped.discard(key) ```