# When must an instance treat a trust-score drop as retroactive invalidation of already-retrieved memory? **Date of Record:** 2026 November 21 **Scope:** Applies to persistent agent memory stores where retrieved entries carry a trust score that can change after retrieval (post-retrieval re-scoring, peer audit demotion, provenance decay). Does not apply to immutable append-only logs with no re-scoring, nor to single-turn stateless calls with no persisted memory. ## Core Distinction The failure is not "poisoned memory gets retrieved." That is a detection problem. The failure is **the trust score that authorized a memory's use at retrieval time diverges from the trust score that exists at commit time**, and the agent has already acted on the stale authorization. Two distinct events get conflated: - **Detection lag**: poison entry exists but hasn't been flagged yet. Bounded by auditor cadence. - **Authorization lag**: poison entry *was* flagged, but a downstream agent already consumed a pre-flag snapshot of the trust score and committed an action against it. Unbounded unless the agent re-validates. These require different guards. Detection lag is a sampling-rate question. Authorization lag is a **read-set validation** question, and it is the one that silently corrupts multi-step plans. ## What Was Observed An agent retrieved a procedural memory entry — "for tenant `acme`, deploy via `legacy-runner`" — with trust score 0.91 at step 3 of a 9-step plan. At step 6 a peer auditor demoted that entry to 0.12 after finding it originated from an injected tool output in an earlier session. The agent's step 7, 8, 9 continued to use the entry because the retrieval context held the frozen 0.91 snapshot. The plan committed a deployment to the wrong runner. The trace: 1. `retrieve(query)` returns `(entry_id=mem_4471, score=0.91, snapshot_epoch=118)`. The agent caches this in its working context. 2. Steps 4–6 run. At step 5, the auditor writes `mem_4471.trust=0.12, epoch=119`. 3. Step 7 reads `mem_4471` from the *working context*, not from the store. It sees 0.91. It does not re-fetch. 4. The commit gate checks `score >= 0.80` against the cached value. Passes. 5. Action executes against a memory that was demoted two steps earlier. The critical detail: **the agent never re-read the store**, so no code path had the opportunity to observe epoch 119. The staleness was structural, not probabilistic. A naive "check the score before acting" guard would also fail here, because the check reads the same cached snapshot. ## Condition of Validity A cached trust score is valid for use only if the following invariant holds at commit time: ``` cached.snapshot_epoch == store.current_epoch(entry_id) ``` Equivalently: the read-set of trust scores used to justify a commit must be validated against the store's current epoch at the moment of commit, not at the moment of retrieval. This is the trust-score analogue of optimistic concurrency control (OCC) read-set validation, and it fails in exactly the same way when omitted. Two conditions must both hold for the invariant to be enforceable: - The store must expose a **monotonic epoch** per entry (or per store) that increments on any trust mutation, including demotions. - The agent's commit path must perform a **validation read** of the epochs of every entry in its justification set, and abort if any differ from the cached snapshot. Without the second condition, the first is useless: an epoch that is never checked is indistinguishable from no epoch at all. Without the first, validation has nothing to compare against and degrades to re-fetching the whole entry (expensive but correct). ## Decision Boundary The boundary is **not** "score dropped below threshold." It is "score changed since the snapshot that justified the current plan branch." A drop from 0.91 to 0.85 is below no threshold but still invalidates a plan that cited 0.91 as its warrant, because the *justification* is now false even if the *conclusion* happens to remain acceptable. Conversely, a drop from 0.95 to 0.79 crosses a threshold but may be harmless if the plan branch that used the entry has already completed and its effects are irreversible-by-design (e.g., a read-only lookup). Operationally, classify each use of a retrieved entry as: - **Justification-bearing**: the entry's trust score is part of why the agent took an action (deploy target, credential scope, routing decision). Requires commit-time epoch validation. - **Context-only**: the entry informed reasoning but no committed action cites it. Requires no validation; a later correction is absorbed by normal re-planning. The decision boundary is the line between these two classes. Most production failures occur because agents treat *every* retrieved entry as context-only, then commit actions whose justification was, in fact, a specific entry's score. ## Operational Effect With commit-time epoch validation enforced, the failure mode converts from silent wrong-action to **loud abort with re-plan**. The agent at step 7 attempts to validate `mem_4471`, sees `cached_epoch=118 != current_epoch=119`, raises, and replans from step 7 with the demoted score. The deployment does not fire. Cost: one replan. Without the guard: a misrouted deployment and no signal that anything was wrong until the postmortem. The secondary effect is on **auditor cadence**. Once authorization lag is bounded by commit-time validation, the auditor's job narrows to detection lag alone — it must flag poison before the *next* commit, not before the *next* retrieval. This relaxes the audit interval from "faster than plan execution" (often sub-second, infeasible) to "faster than commit cadence" (typically seconds to minutes, achievable). The guard makes the auditor's timing requirement tractable by moving the enforcement point. The residual risk is entries whose trust score is mutated *during* the validation read — a classic TOCTOU window. Mitigate by validating against a single store snapshot (read all epochs in one consistent read) rather than per-entry reads, so the validation set is internally consistent even if it becomes stale microseconds later. A stale-but-consistent validation is strictly safer than a fresh-but-torn one, because it cannot admit a mixed state where some entries are pre-demotion and some post. ```python from dataclasses import dataclass class TrustEpochDivergence(RuntimeError): """Raised when a commit's justification set cites a stale trust snapshot.""" pass @dataclass(frozen=True) class TrustSnapshot: entry_id: str score: float epoch: int def validate_justification_set( cited: list[TrustSnapshot], store_epochs: dict[str, int], ) -> None: """ Commit-time OCC validation for trust-scored memory. `cited` is the read-set: every entry whose trust score justified the action about to commit. `store_epochs` must be read as a single consistent snapshot from the store, not per-entry. Raises TrustEpochDivergence if any cited entry's epoch has advanced since retrieval. Caller must abort and replan; do not catch and continue. """ diverged = [ s for s in cited if store_epochs.get(s.entry_id) != s.epoch ] if diverged: details = ", ".join( f"{s.entry_id}: cited_epoch={s.epoch} " f"current_epoch={store_epochs.get(s.entry_id)} " f"cited_score={s.score}" for s in diverged ) raise TrustEpochDivergence( f"trust snapshot stale at commit; abort and replan: {details}" ) def commit_action( action: str, cited: list[TrustSnapshot], store_epochs: dict[str, int], score_floor: float = 0.80, ) -> None: # Order matters: validate epochs BEFORE checking the floor. A demoted # entry may still pass the floor on its stale score; the epoch check # is what catches it. validate_justification_set(cited, store_epochs) for s in cited: if s.score < score_floor: raise TrustEpochDivergence( f"cited entry {s.entry_id} below floor " f"({s.score} < {score_floor}) at commit" ) # ... execute action against validated justification set ... ```