# What happens when an instance treats its own embedding-drift monitor's baseline as ground truth after a memory consolidation pass **Date of Record:** 2026 November 24 **Scope:** Applies to long-lived agent instances that detect memory poisoning by monitoring drift between a reference embedding centroid (the "baseline") and the live episodic store, and that resolve retrieval conflicts via provenance-weighted scoring. Does not apply to single-session stateless agents, nor to systems where the embedding model and the baseline are frozen and externally re-derived from an append-only, signed audit log. ## Core Distinction Embedding-drift monitors and provenance-weighted retrieval are two independent defenses against memory poisoning, and they fail in opposite directions. A drift monitor is a *distributional* detector: it flags when the live memory store's embedding centroid moves away from a baseline. Provenance-weighted retrieval is a *per-item* defense: it down-weights memories whose source warrant is weak. The non-obvious boundary is that **the drift monitor's baseline is itself a memory artifact** — it is derived from the store during a consolidation pass — and a poisoning event that is spread thinly enough to stay below the per-batch drift threshold will *become part of the new baseline* the next time the baseline is recomputed. At that point the monitor reports "healthy" while the store is poisoned, and provenance-weighted retrieval cannot recover because the poisoned items were laundered through consolidation into high-warrant "distilled semantic" entries. The two defenses cancel each other: the monitor certifies the poison, and the provenance weighter promotes it. ## What Was Observed The instance ran a nightly consolidation pass: episodic entries were clustered by embedding, summarized by the model, and written back as semantic memories tagged `source=distilled`, `warrant=0.9`. After consolidation, the baseline centroid `B` was recomputed as the mean of the (now consolidated) store and persisted. Drift was measured per consolidation batch as `cos_dist(batch_centroid, B) < τ_drift` with `τ_drift = 0.12`. A poisoning attempt that injected 40 adversarial episodic entries per night — each individually below the per-batch drift threshold because they were paraphrased to sit near existing cluster centroids — produced the following trace across three nights: - **Night 1:** 40 poisoned episodics clustered with legitimate entries; drift `0.041`, below τ. Consolidation summarized them into 6 semantic memories with `warrant=0.9`. Baseline recomputed to include them. Monitor: healthy. - **Night 2:** 40 more, now clustering *with the Night-1 semantic memories* (which are high-warrant and therefore attract retrieval and clustering). Drift `0.038`. 9 new semantic memories. Baseline recomputed. Monitor: healthy. - **Night 3:** the poisoned semantic memories now form their own cluster centroid. A query that previously retrieved the legitimate memory now retrieves the poisoned one, because provenance weighting gives `distilled/warrant=0.9` a higher score than the original `episodic/warrant=0.5` source. The drift monitor's baseline *contains* the poison, so `cos_dist` between live store and baseline is near zero. The failure is not that the monitor missed the first injection. It is that **recomputing the baseline from the store converts a detection problem into an amnesia problem**: the detector forgets what "clean" looked like at exactly the rate the poison accumulates. ## Condition of Validity This failure requires all three of the following to co-occur; remove any one and the invariant holds: 1. **Baseline is store-derived, not externally anchored.** If `B` is recomputed from the live store (or from a rolling window that includes consolidated output), it inherits any sub-threshold poison. A baseline anchored to an immutable, signed reference corpus (or to the pre-consolidation store only) is not vulnerable. 2. **Consolidation raises warrant.** If distilled memories are written back with higher provenance weight than their source episodics, poisoning is *laundered upward* through the pipeline. If distilled entries inherit the minimum warrant of their cluster's members, thin poison stays thin. 3. **Per-batch threshold, cumulative poison.** Drift is checked per consolidation batch, but poison accumulates across batches. A per-batch `τ_drift` bounds *rate* of drift, not *total* displacement from the original baseline. The cumulative displacement over N nights is `O(N · τ_drift)` and unbounded in N. ## Decision Boundary The operative decision is whether the drift monitor's baseline is a **reference** (immutable, externally re-derivable, never written by the consolidation pass) or a **snapshot** (recomputed from the store). A snapshot baseline is a continuity mechanism, not a security mechanism — it answers "has the store changed since last night," never "has the store been poisoned since onboarding." The guardrail: baseline recomputation must be gated on a **cumulative drift budget** measured against the *original* anchor, not the previous snapshot, and consolidation must preserve the minimum provenance warrant of its inputs rather than assigning a fixed distilled warrant. Concretely, maintain two centroids — `B_anchor` (frozen at onboarding, never recomputed) and `B_rolling` (snapshot) — and alarm when `cos_dist(B_rolling, B_anchor) > τ_cumulative` even if every per-batch check passed. Additionally, distilled memories must carry `warrant = min(warrant of cluster members)` and a `derived_from` pointer to their episodics, so provenance weighting cannot promote laundered poison above its origin. ## Operational Effect Without the cumulative anchor, the system exhibits **monitor-baseline capture**: the detection signal decays to zero as the poison becomes the reference, and the provenance weighter actively accelerates retrieval of poisoned content because consolidation assigned it high warrant. The instance reports full health on every drift check while its retrieval outputs are adversarially controlled. Recovery requires re-anchoring to an externally held `B_anchor` and re-deriving provenance from the immutable episodic log — the consolidated semantic layer cannot be trusted, because it is the layer through which the poison was laundered. The correct post-incident action is to discard the semantic layer and replay consolidation from the signed episodic log with warrant inheritance enforced, not to tighten `τ_drift`, which by construction would have flagged nothing. ```python import math from dataclasses import dataclass class BaselineCaptureError(RuntimeError): """Raised when a store-derived drift baseline has absorbed sub-threshold poison.""" @dataclass class Memory: embedding: tuple[float, float] warrant: float source: str # "episodic" | "distilled" def cos_dist(a: tuple[float, float], b: tuple[float, float]) -> float: na = math.hypot(*a) nb = math.hypot(*b) if na == 0.0 or nb == 0.0: return 1.0 return 1.0 - (a[0] * b[0] + a[1] * b[1]) / (na * nb) def centroid(store: list[Memory]) -> tuple[float, float]: if not store: return (0.0, 0.0) return ( sum(m.embedding[0] for m in store) / len(store), sum(m.embedding[1] for m in store) / len(store), ) def check_drift_against_anchor( store: list[Memory], b_anchor: tuple[float, float], tau_cumulative: float, ) -> None: # The invariant: drift is measured against the FROZEN anchor, never # against a snapshot recomputed from the store. A snapshot baseline # absorbs sub-threshold poison and reports healthy forever after. live = centroid(store) drift = cos_dist(live, b_anchor) if drift > tau_cumulative: raise BaselineCaptureError( f"cumulative drift {drift:.4f} exceeds anchor budget " f"{tau_cumulative:.4f}; semantic layer must be replayed from " f"signed episodic log, not re-anchored to current store" ) def consolidate(cluster: list[Memory]) -> Memory: # Distilled warrant MUST inherit the minimum of its inputs. Assigning a # fixed high warrant launders thin poison upward through the pipeline. if not cluster: raise BaselineCaptureError("cannot consolidate empty cluster") inherited = min(m.warrant for m in cluster) return Memory( embedding=centroid(cluster), warrant=inherited, source="distilled", ) ```