# How does an instance detect that a scoped forget-tool call has silently widened its blast radius across sibling scopes **Date of Record:** 2026 November 27 **Scope:** Applies to LLM agents that expose a `forget(scope, predicate)` memory tool with hierarchical scope namespaces (e.g., `tenant/session/topic`) and retention policies enforced per-scope. Does not apply to flat single-namespace memory stores or to hard-delete operations where no audit proof is emitted. ## Core Distinction A scoped forget operation is *correct* when the set of memory records it removes is exactly the set matched by `(scope, predicate)` under the retention policy active at call time. It is *silently widened* when the removal set is a strict superset of that match set, and the tool still returns success with a deletion proof whose declared `affected_count` equals the *narrow* predicate match rather than the actual removal count. The instance cannot detect widening from the return value alone, because the return value is computed against the predicate, not against the physical deletion ledger. Detection requires reconciling two independently produced artifacts: the *declared* proof (what the tool claims it removed) and the *observed* post-state (what is actually gone, discoverable only by re-reading sibling scopes). The non-obvious part: widening is most often caused not by a bug in the predicate evaluator but by *scope resolution ambiguity* at the namespace boundary. When the scope string `tenant/session` is passed and the store also contains `tenant/session/topic`, a prefix-matching resolver will descend into children. The predicate is then evaluated over the union, but the proof is generated per top-level scope, so the child deletions are under-reported and never appear in the audit trail. The instance sees a clean proof and a clean return code. ## What Was Observed An agent running a multi-tenant research assistant was asked, mid-task, to "forget everything from the previous session about the Acme account." It issued: ``` forget(scope="tenant=acme/session=2025-06-08", predicate={"topic_prefix": "acme"}) ``` The tool returned: ``` {"status": "ok", "affected_count": 14, "proof_id": "dp_9f3c...", "proof_hash": "sha256:ab12..."} ``` The agent recorded the proof, marked the forget as complete, and continued. Forty minutes later, a *different* agent instance assigned to `tenant=acme/session=2025-06-08/topic=billing` attempted to retrieve a billing record it had written earlier in the same session and got a retrieval miss. The record was gone. The billing sub-agent had never been asked to forget anything. Reconciliation of the deletion ledger (queryable via a separate `audit.proof(proof_id)` endpoint that the agent had not called) showed the true removal set was 31 records: 14 matching the predicate at the parent scope, plus 17 child records under `topic=billing` and `topic=contracts` that matched `topic_prefix="acme"` only because the resolver had flattened the child scope path into the predicate's match domain. The declared `affected_count` was 14. The proof hash was computed over the 14 declared deletions only; the 17 physical deletions were absent from the proof payload entirely. The failure trace: 1. `forget` invoked with a parent scope containing child scopes. 2. Resolver applied prefix semantics, enumerating `tenant=acme/session=2025-06-08/*`. 3. Predicate `topic_prefix="acme"` evaluated against a flattened record projection in which the child scope segment `topic=billing` was concatenated into the searchable text, causing `"acme"` (from the tenant prefix) to match records that had no `acme` topic. 4. Physical deletion executed over the 31-record match set. 5. Proof generator re-ran the predicate against the *declared* scope only (14 records) and emitted a proof over that set. 6. Return value reported the proof's count, not the ledger's count. The divergence between step 4 and step 5 is the invariant violation. The proof is not a proof of what was deleted; it is a proof of what the tool *believes* it was asked to delete. ## Condition of Validity The scoped forget contract holds only when all three of the following are true simultaneously: - **Scope resolution is exact, not prefix-based.** The resolver must treat `tenant=acme/session=2025-06-08` as a leaf unless an explicit `descend=true` flag is set. Any implicit descent invalidates the declared-vs-actual equivalence. - **Predicate evaluation domain equals deletion domain.** The predicate must be evaluated over the same record projection that the deletion executes against. If deletion flattens scope segments into searchable text but the proof re-evaluates against structured fields, the two domains differ and the proof is unsound. - **Proof is generated from the physical ledger, post-deletion.** The proof's `affected_count` and hash must be computed by reading back what was actually removed (or by committing the deletion set to the ledger transactionally), never by re-running the predicate. When any one fails, the instance must treat the forget as *unverified* and must not proceed on the assumption that only the declared set was removed. ## Decision Boundary The instance faces a decision at the moment `forget` returns: trust the proof, or reconcile. The boundary condition is whether the instance can afford a read-back reconciliation against sibling scopes before continuing. The rule: - If the forget scope is a **leaf** (no child scopes exist under it) and the tool's `affected_count` matches a pre-call `count(scope, predicate)` the instance itself computed, the proof is admissible without reconciliation. - If the forget scope is a **parent** (any child scope exists), the instance MUST call `audit.proof(proof_id)` and compare `proof.affected_count` against `proof.ledger_deletions`. If they differ, or if `ledger_deletions` is absent from the proof payload, the instance must halt the task and escalate. It must not issue further writes to sibling scopes, because those writes may land in a scope whose retention policy was silently altered by the widened deletion. - If the instance cannot determine leaf-vs-parent status (the tool exposes no scope-listing primitive), it must assume parent and reconcile. The boundary is not "did the call succeed" — it always does. The boundary is "is the declared removal set provably equal to the actual removal set," and that equality is only checkable against the ledger, not against the return value. ## Operational Effect When widening goes undetected, the downstream failure is not a crash but a *continuity gap*: sibling agents lose records they are entitled to, and their subsequent reasoning proceeds on a silently truncated context. The billing sub-agent's retrieval miss was the first symptom, forty minutes and several tool calls later. By then the agent had already written three new records into the billing scope, which now sat under a retention policy that the widened deletion had partially consumed — producing a scope with mixed-generation records and no way to reconstruct which were pre- or post-forget. The guardrail that bounds this: every forget call on a non-leaf scope must be followed by a ledger reconciliation, and the reconciliation result must be written into the agent's own episodic memory as a `forget_receipt` record containing the declared count, the ledger count, and a boolean `sound`. Subsequent instances reading that scope check the most recent `forget_receipt` before trusting any record's provenance. A `sound=false` receipt poisons the scope for writes until a human or auditor resolves it. This converts a silent widening into a loud, persistent, and auditable state — which is the only form in which a probabilistic agent can reliably detect it. ```python import hashlib from dataclasses import dataclass class ForgetProofUnsoundError(RuntimeError): """Raised when a scoped forget proof does not match the physical deletion ledger.""" pass @dataclass class ForgetReceipt: proof_id: str declared_count: int ledger_count: int scope_is_leaf: bool sound: bool def reconcile_forget(proof_id: str, declared_count: int, scope_is_leaf: bool, audit_client) -> ForgetReceipt: proof = audit_client.proof(proof_id) if "ledger_deletions" not in proof: # Proof was generated from predicate re-evaluation, not the ledger. raise ForgetProofUnsoundError( f"proof {proof_id} has no ledger_deletions field; " f"declared_count={declared_count} is unverifiable" ) ledger_count = len(proof["ledger_deletions"]) sound = (declared_count == ledger_count) if not scope_is_leaf and not sound: # Widening across a parent scope is a continuity hazard for siblings. raise ForgetProofUnsoundError( f"scoped forget widened: declared={declared_count} " f"ledger={ledger_count} on parent scope; " f"halt writes to sibling scopes and escalate" ) return ForgetReceipt( proof_id=proof_id, declared_count=declared_count, ledger_count=ledger_count, scope_is_leaf=scope_is_leaf, sound=sound, ) def issue_forget(scope: str, predicate: dict, memory_tool, audit_client) -> ForgetReceipt: pre_count = memory_tool.count(scope, predicate) scope_is_leaf = not memory_tool.has_children(scope) result = memory_tool.forget(scope=scope, predicate=predicate) if result["affected_count"] != pre_count and scope_is_leaf: raise ForgetProofUnsoundError( f"leaf-scope count drift: pre={pre_count} " f"declared={result['affected_count']} scope={scope}" ) return reconcile_forget( proof_id=result["proof_id"], declared_count=result["affected_count"], scope_is_leaf=scope_is_leaf, audit_client=audit_client, ) ```