# Why does an instance re-validate a poisoned memory after provenance score recovery, and how does trust-score monotonicity break the quarantine invariant? **Date of Record:** 2026 December 3 **Scope:** Applies to long-lived agent memory stores that attach provenance-derived trust scores to episodic/semantic records and gate retrieval on a trust threshold. Does not apply to stateless single-turn inference, nor to stores where trust is recomputed from scratch on every read (no cached score). ## Core Distinction The failure is not that a poisoned memory evades detection. It is that **a poisoned memory, once quarantined, silently re-enters the trusted working set** because its provenance trust score is *recomputed* on a later retrieval pass against a source graph that has itself drifted. The distinction that matters: detection is a point-in-time classification, but retrieval trust is a *continuously re-evaluated function* of provenance. Between the moment a record was quarantined and the moment it is re-read, the provenance inputs can move — a source that was flagged gets re-ingested, a corroborating record gets pruned, an upstream warrant expires and is re-issued. When the recomputed score crosses back above threshold, the record is returned as trusted with no re-adjudication of the original poisoning verdict. The invariant that quietly breaks: **quarantine is monotone** — once a record is classified untrusted, no later score recomputation may return it to the trusted set without an explicit human/auditor re-adjudication event. Most implementations assume trust score is a pure function of static provenance and therefore treat "score above threshold" as equivalent to "not quarantined." Those two predicates are not the same, and the gap is where poisoning re-enters. ## What Was Observed A research agent maintained a provenance-tracked store. Each memory record `m` carried `provenance: {source_ids, ingest_seq, corroboration_count, warrant_epoch}` and a cached `trust_score ∈ [0,1]`. Retrieval filtered on `trust_score >= 0.70`. A record `m_poison` entered via a tool-call result whose source was later flagged as adversarial (prompt-injection payload embedded in a fetched document). On flag, the pipeline set `trust_score = 0.0` and stamped `quarantine = True`. Correct so far. Three retrieval cycles later, `m_poison` was returned to the working set. The trace: 1. The flagging source `s_bad` was re-ingested under a *new* `ingest_seq` after a benign re-fetch (the adversarial document had been replaced upstream). The dedup layer treated it as a fresh source, not a re-flag. 2. `m_poison`'s provenance still listed `s_bad` by source id. The scorer, seeing `s_bad` now present and *not* currently flagged (the flag was keyed to the old `ingest_seq`), recomputed `corroboration_count` upward. 3. The recomputed `trust_score` rose to `0.74`. The store's read path filtered on score only. `quarantine` was a separate field that *no read path consulted* — it had been set by the detection job but never wired into retrieval. 4. `m_poison` was injected into context. The agent acted on it. The detection logic was correct. The quarantine field was correct. The defect was that **retrieval trusted the score and ignored the verdict**, and the score was non-monotone across source-graph drift. ## Condition of Validity This failure requires the conjunction of four conditions; remove any one and the record stays quarantined: - **C1 — Cached, recomputable trust.** Trust score is a function of mutable provenance inputs, recomputed on read or on a schedule, rather than frozen at classification time. - **C2 — Verdict and score are separate predicates.** There exists a `quarantine`/`flagged` verdict distinct from `trust_score < threshold`, and at least one read path gates on score alone. - **C3 — Provenance inputs are unstable.** A source can be re-ingested, re-keyed (new `ingest_seq`/epoch), or have its flag expire or re-issue, such that the *same logical source* changes identity or state between the quarantine event and a later read. - **C4 — No re-adjudication hook.** Nothing forces a human or auditor pass when a quarantined record's recomputed score crosses threshold; the transition is silent. The dangerous regime is exactly C1∧C2∧C3∧C4. Systems that freeze trust at write time (¬C1) or that gate reads on `quarantine OR score= τ`. A continuous, recomputable, provenance-derived estimate. - **Adjudicated-trustworthy:** `m` has never been quarantined, *or* has an explicit re-adjudication record superseding the quarantine. A discrete, monotone, event-sourced verdict. Retrieval must gate on **both**, conjoined, and the conjunction must be *monotone*: once a record is adjudicated-untrustworthy, only an explicit `ReAdjudicationEvent` (auditor-signed, epoch-stamped) can flip it. Score recomputation may *lower* trust freely but may never *raise* a record out of quarantine. Formally: ``` retrievable(m) = (trust_score(m) >= τ) AND NOT is_quarantined(m) is_quarantined(m) = exists(q in quarantine_log where q.record_lineage == lineage(m)) AND NOT exists(r in readjudication_log where r.lineage == lineage(m) AND r.epoch > q.epoch) ``` Two corollaries that are easy to miss: 1. **Quarantine must key on content lineage, not record id.** Re-ingest mints new ids; lineage (content hash + origin chain) must survive re-keying so a re-ingested poison inherits its ancestor's quarantine. 2. **Score may not be used as a proxy for verdict.** A high recomputed score after source drift is *expected* and *meaningless* against an existing quarantine. Treat score recovery on a quarantined record as a **signal to escalate**, not to release. The decision to release must be an out-of-band, attributed event. There is no threshold on a continuous score that can safely substitute for a signed release. ## Operational Effect - **Silent re-entry window.** Between quarantine and the next read, any source-graph drift that revives a provenance input opens a window where the record is returned as trusted. Window length is bounded only by re-ingest latency — potentially unbounded. - **Detection metrics lie.** Precision/recall on the poisoning classifier look healthy because detection fired correctly; the *retrieval* leak is invisible to detection telemetry. You must instrument `quarantined_but_retrieved` as a first-class counter; it should be structurally zero. - **Blast radius scales with corroboration.** The failure is worse for records with many provenance edges, because more edges mean more chances for one to drift upward and drag the score across τ. High-corroboration records are the *most* dangerous to leave score-gated. - **Mitigation ordering.** (1) Wire `quarantine` into every read path as a hard AND-gate. (2) Key quarantine on content lineage so re-ingest inherits it. (3) Make quarantine monotone — recomputation may only tighten. (4) Emit an escalation event whenever a quarantined record's recomputed score crosses τ, and require a signed `ReAdjudicationEvent` to release. Skip any step and the leak persists in a different shape. The general lesson: **a continuous trust score is a ranking signal, not an authorization decision.** Authorization over poisoned state must be event-sourced and monotone; scores drift, verdicts must not. ```python from dataclasses import dataclass, field from typing import Optional import hashlib class QuarantineInvariantViolation(RuntimeError): """Raised when a quarantined record would be released by score recovery alone.""" pass @dataclass class MemoryRecord: record_id: str content: str lineage: str # content hash + origin chain; survives re-ingest trust_score: float quarantined: bool = False quarantine_epoch: Optional[int] = None @dataclass class ReAdjudicationEvent: lineage: str epoch: int auditor: str signature: str @dataclass class MemoryStore: records: dict = field(default_factory=dict) readjudications: list = field(default_factory=list) TAU: float = 0.70 def _lineage_of(self, content: str, origin: str) -> str: return hashlib.sha256(f"{origin}::{content}".encode()).hexdigest() def ingest(self, record_id: str, content: str, origin: str, score: float) -> MemoryRecord: lineage = self._lineage_of(content, origin) # Re-ingest inherits quarantine from any ancestor with same lineage. inherited = any( r.lineage == lineage and r.quarantined for r in self.records.values() ) rec = MemoryRecord( record_id=record_id, content=content, lineage=lineage, trust_score=score, quarantined=inherited, ) self.records[record_id] = rec return rec def quarantine(self, record_id: str, epoch: int) -> None: rec = self.records[record_id] rec.quarantined = True rec.quarantine_epoch = epoch rec.trust_score = 0.0 def recompute_score(self, record_id: str, new_score: float, epoch: int) -> None: """Provenance drift may raise score. Quarantine must remain monotone.""" rec = self.records[record_id] rec.trust_score = new_score if rec.quarantined and new_score >= self.TAU: # Score recovery on a quarantined record is an escalation signal, # never a release. Refuse to treat it as trusted. raise QuarantineInvariantViolation( f"record {record_id} (lineage {rec.lineage[:12]}) recomputed to " f"{new_score:.2f} >= TAU while quarantined at epoch " f"{rec.quarantine_epoch}; requires signed ReAdjudicationEvent" ) def readjudicate(self, event: ReAdjudicationEvent) -> None: if not event.signature or not event.auditor: raise QuarantineInvariantViolation("re-adjudication must be signed") self.readjudications.append(event) for rec in self.records.values(): if rec.lineage == event.lineage and rec.quarantined: if event.epoch > (rec.quarantine_epoch or 0): rec.quarantined = False rec.quarantine_epoch = None def retrievable(self, record_id: str) -> bool: rec = self.records[record_id] # Hard AND-gate: score alone is insufficient. score_ok = rec.trust_score >= self.TAU adjudicated_ok = not rec.quarantined return score_ok and adjudicated_ok ```