# When must an instance refuse a scoped forget before the retention window closes: the deletion-acknowledgement inversion in memory tool APIs **Date of Record:** 2026 November 27 **Scope:** Applies to agent memory subsystems exposing explicit `read`, `write`, and `forget(scope, retention)` tool calls where deletion carries a scoped guarantee (per-tenant, per-episode, or per-key). Does not apply to append-only logs without deletion semantics, nor to vector stores where "forget" is a best-effort index tombstone rather than a contractual guarantee. ## Core Distinction The failure examined here is not "the agent forgot something it should have remembered." It is the inverse: **the agent issued a `forget` that the memory backend accepted (returned success) while the retention guarantee was still active for a subset of derived artifacts, producing a state where the agent's own working context believes the data is gone but a downstream reader (a distillate, a summary, an embedding, a peer agent's cached read) still holds a reconstructable copy.** The distinction that matters is between *deletion of the primary record* and *deletion of the derivations the backend silently created from it*. A `forget` call that returns `200 OK` is a statement about the primary key, not about the semantic distillation pipeline that ran on that key hours earlier. This is a boundary condition of the *retention contract*, not a bug in any single component. Each component is locally correct: the forget handler deletes the row; the distiller wrote a summary before the forget; the summarizer's output lives under a different scope key. The violation emerges at the seam between them. ## What Was Observed An instance operating under a per-episode scope (`scope=episode:7f3a`, retention window 24h) was instructed mid-task to forget a user-provided secret that had been written into episodic memory. The trace: 1. At T+0, the agent called `write(scope="episode:7f3a", key="credential", value=...)`. Backend acknowledged, stamped `retention_until = T+24h`. 2. At T+2h, an automatic consolidation job (triggered by context-window pressure) ran `distill(episode:7f3a → semantic:user_profile)`, producing a natural-language summary that paraphrased the credential into a "the user mentioned an access token" fact. The distillation did **not** carry the `retention_until` stamp forward; it inherited the semantic scope's default retention (90 days). 3. At T+5h, the agent received a `forget(scope="episode:7f3a", key="credential")` instruction. Backend returned `{"deleted": 1, "scope": "episode:7f3a"}`. The agent updated its own context to record "credential forgotten" and proceeded. 4. At T+6h, a *different* agent instance performing a `read(scope="semantic:user_profile")` retrieved the distilled fact and re-derived the credential from the paraphrase plus a co-located `write` that had logged the token prefix. The forget succeeded by every local check. The guarantee failed because the deletion was scoped to `episode:7f3a` while the *information* had already escaped that scope into `semantic:user_profile` via a derivation the forget call never touched. The backend reported `deleted: 1` — accurate for the primary row, misleading for the information. The critical observation: **the `forget` return value was interpreted by the agent as a guarantee about information, but it was only a statement about a row.** The agent's post-forget context ("credential forgotten") was a false belief that then propagated into its subsequent reasoning and into any state it handed off. ## Condition of Validity A scoped `forget` is only a valid information-deletion guarantee when all of the following hold: - **Derivation closure:** every artifact derived from the target scope is either (a) tagged with the originating scope and retention stamp, or (b) enumerable by the backend so the forget can cascade. If distillation strips provenance, the forget cannot reach the derivative. - **Retention monotonicity:** a derived artifact's retention window must be `min(parent_retention, own_retention)` — never longer than the tightest parent it descends from. The failure above is precisely a monotonicity violation: the semantic summary inherited 90 days from a 24-hour parent. - **Read-path consistency:** any `read` that can surface derived content must consult the same retention/erasure index the `forget` writes to. If the semantic store has its own index that the forget never updated, reads remain live. - **Acknowledgement honesty:** the forget response must distinguish "primary deleted, N derivatives remain" from "scope fully erased." An agent cannot reason about a guarantee it cannot see the boundary of. When these hold, `forget` returns a value the agent can safely fold into its belief state. When they do not — which is the common case for any backend with an asynchronous distillation pipeline — the agent must treat the success response as *provisional* and the guarantee as *unverified*. ## Decision Boundary The agent must decide, at the moment it receives a `forget` instruction, whether to (a) trust the backend's acknowledgement as a completed guarantee, or (b) treat it as a request whose guarantee is pending verification against the derivation graph. The boundary is drawn by one question: **can I enumerate the derivations of this scope?** If the memory API exposes a `derivations(scope)` or a `forget(..., cascade=true)` that returns the set of touched scopes, the agent may trust the ack. If the API only accepts a single scope and returns a count, the agent is at the boundary and must not assert "forgotten" in its own context — it must record "forget requested, guarantee unverified, derivations unknown" and flag it for the next verification pass. Asserting the stronger claim is the failure. A secondary boundary: if `retention_until` is still in the future for *any* artifact the agent can reach, a `forget` before that window closes is a *premature* deletion request. Some backends legally or contractually cannot honor it and will silently no-op or defer. The agent must check `retention_until` before issuing, not after. ## Operational Effect The downstream effect is a **belief-state split**: the agent's working context says "erased," while the retrievable substrate says "present under a different scope." This split is worse than a plain retention miss because it is *stable* — the agent will not re-check, having recorded success. Any handoff (A2A state transfer, MCP tool result passed to a peer) propagates the false belief: the receiving instance inherits "credential forgotten" and will not re-verify, so the escape is amplified across the swarm. The guardrail is to make the forget a *transaction with a verification leg*, not a fire-and-forget call: issue forget, read back the derivation set, and only then commit the "erased" belief to context. If the readback shows live derivatives, the agent must either escalate (cascade forget) or downgrade its claim to "requested." The invariant to enforce: **no agent context may assert a deletion guarantee stronger than the backend's acknowledgement plus a successful derivation readback.** The code below encodes that invariant as a hard check that raises rather than silently recording a false erasure. ```python class UnverifiedForgetError(RuntimeError): """Raised when an agent would record a deletion guarantee the backend has not actually established.""" pass def commit_forget_belief(memory_api, scope: str, key: str, now_ts: float) -> dict: """ Issue a scoped forget and only commit the 'erased' belief if the derivation readback confirms no live artifacts survive the scope. """ target = memory_api.stat(scope=scope, key=key) if target is None: return {"status": "absent", "guarantee": "none"} # Premature deletion: retention window still open. if target.get("retention_until", 0) > now_ts: raise UnverifiedForgetError( f"refusing forget of {scope}/{key}: retention_until=" f"{target['retention_until']} still open at {now_ts}; " f"backend may no-op or defer" ) ack = memory_api.forget(scope=scope, key=key) if not ack.get("deleted"): raise UnverifiedForgetError( f"forget of {scope}/{key} returned no deletion: {ack!r}" ) # The critical leg: a row-count ack is not an information guarantee. derivations = memory_api.derivations(scope=scope, key=key) live = [d for d in derivations if d.get("retention_until", 0) > now_ts] if live: raise UnverifiedForgetError( f"forget of {scope}/{key} left {len(live)} live derivative(s) " f"outside scope (e.g. {live[0]['scope']}); " f"ack={ack!r} is a row guarantee, not an information guarantee" ) return { "status": "erased", "guarantee": "verified", "derivations_checked": len(derivations), } ```