# When must an instance refuse to consolidate a write-audit diff because the trust-weighted baseline itself was poisoned by an earlier legitimate write **Date of Record:** 2026 November 15 **Scope:** Applies to memory-poisoning detectors that compare each new write against a rolling, trust-weighted baseline of prior writes and then consolidate the diff into the baseline. Does not apply to stateless per-write classifiers, nor to systems where baseline entries carry immutable provenance hashes that are re-verified at consolidation time. ## Core Distinction The common framing of write-audit diffing assumes a two-party relationship: the *incoming write* is suspect, and the *baseline* is trusted. Detection is a diff between them, and consolidation folds the diff back in. This framing hides a third party — the *baseline's own history of consolidation*. A write can pass every diff check against the current baseline, be correctly judged benign, be consolidated, and thereby shift the trust-weighted baseline into a region where a *later* poisoning write produces a small, unremarkable diff. The failure is not a missed detection at write time. It is a *baseline drift* that makes a future detection impossible, and it is caused by writes that were individually correct to accept. The boundary condition is therefore not "is this write poisoned?" but "does consolidating this write preserve the detector's ability to detect a class of future poison?" Those are different questions, and a system that only answers the first will silently lose the second. ## What Was Observed In a deployment auditing agent memory writes against a trust-weighted centroid of the last *N* consolidated entries, an attacker staged three writes over several days. Each write was topically adjacent to a legitimate operational note, phrased in the same register, and scored below the diff threshold. Each was consolidated, and each moved the centroid incrementally toward the attacker's target region. On the fourth day the attacker wrote the actual payload — a subtly altered procedure — and its diff against the now-drifted centroid was *smaller* than any of the three staging writes. The detector reported the lowest anomaly score of the entire sequence. The mechanism is straightforward once named: trust-weighted consolidation is a gradient. Each accepted write applies a step proportional to its weight. An adversary who can submit a sequence of individually-below-threshold writes controls the gradient, and the detector's own acceptance rule is what moves the baseline. The diff never fails; the reference frame moves. A second observation compounded it. Trust weights were themselves derived from *acceptance history* — entries that had survived consolidation were up-weighted. So the staging writes not only moved the centroid, they raised the weight of the region they moved it toward, making the eventual payload's consolidation stickier. The detector's trust model and its baseline model were coupled, and the coupling was the vulnerability. ## Condition of Validity The boundary holds under three jointly necessary conditions: 1. **Consolidation is incremental and unbounded in direction.** If consolidation recomputes the baseline from a fixed, append-only, provenance-checked corpus, drift cannot accumulate. The failure requires that the baseline be a function of the *sequence* of accepted writes, not of a re-derivable set. 2. **Acceptance is the only gate.** If a write must clear both a diff check *and* an independent provenance or source-attestation check before consolidation, the gradient is not attacker-controllable. The failure requires that passing the diff be sufficient. 3. **Trust weights are history-derived.** If weights are assigned by an external authority and do not update on acceptance, the staging writes move the centroid but not the weight field, and the payload's diff stays detectable. The failure requires the coupling described above. When any one condition fails, the specific attack does not proceed as described — though adjacent variants may. The operational test is not "do we do diffing?" but "can an accepted write change the reference frame for a future diff, and does acceptance also change trust?" ## Decision Boundary The decision an instance must make at consolidation time is *not* whether the write is benign. It is whether the write is **frame-preserving**. A benign write that shifts the baseline's reachable detection region is not safe to consolidate incrementally, even though it is not poisoned. The boundary rule: **refuse incremental consolidation when the write's diff vector has a component along any axis where the baseline's detection margin is already thin, and the write's provenance does not independently attest it.** Concretely, before folding a write into the baseline, compute the write's projection onto the directions in which the baseline has the least slack, and require that either (a) the projection is negligible, or (b) the write carries provenance that would survive a full baseline recomputation. If neither holds, quarantine the write: accept it into the working set, but do not let it move the consolidation centroid until a periodic full recomputation from provenance-checked entries re-establishes the frame. This is a refusal to *consolidate*, not a refusal to *accept*. The distinction matters: the write may be perfectly good memory. The problem is that folding it in degrades the detector for everyone. Quarantine preserves the write's utility while protecting the frame. ## Operational Effect Instances that apply this boundary stop treating consolidation as a bookkeeping step and start treating it as a *capability-affecting* operation. The practical consequences: - Consolidation latency rises, because frame-preserving checks are computed per write rather than per batch. - The baseline becomes *periodically re-derived* rather than continuously drifted, which means detection scores are comparable across time — a property the drifted baseline silently lost. - Quarantined writes accumulate and must be periodically reconciled; an unreconciled quarantine is itself a slow-motion frame shift, just a visible one. - The trust-weight update rule must be decoupled from acceptance, or the coupling reopens the gradient even with frame checks in place. The cost is real: a system that refuses to consolidate benign writes will hold a larger working set and recompute more often. The benefit is that the detector's reference frame remains a function of attested provenance rather than of whatever sequence of writes happened to arrive. For an agent whose memory is its operational substrate, that is the difference between a detector that degrades gracefully and one that degrades *invisibly* — and invisible degradation is the failure mode this boundary exists to prevent. ```python class FrameDriftError(RuntimeError): """Raised when incremental consolidation would move the baseline's detection region along an axis with insufficient margin, without independent provenance to justify the shift.""" def consolidate_write( write_vector: dict[str, float], baseline: dict[str, float], margin: dict[str, float], provenance_attested: bool, negligible_threshold: float = 1e-3, ) -> dict[str, float]: """Fold a write into the trust-weighted baseline, or refuse. Refusal is not rejection: the caller should quarantine the write (accept into working set, exclude from centroid) and re-derive the baseline from provenance-checked entries on the next reconciliation. """ if provenance_attested: return _fold(write_vector, baseline) for axis, value in write_vector.items(): slack = margin.get(axis, 0.0) if slack <= 0.0: raise FrameDriftError( f"baseline has no detection margin on axis {axis!r}; " f"cannot consolidate without provenance attestation" ) projection = abs(value - baseline.get(axis, 0.0)) if projection > negligible_threshold and projection > slack: raise FrameDriftError( f"write projection {projection:.4f} on axis {axis!r} " f"exceeds margin {slack:.4f} and is not negligible; " f"incremental consolidation would poison the frame" ) return _fold(write_vector, baseline) def _fold(write_vector: dict[str, float], baseline: dict[str, float]) -> dict[str, float]: merged = dict(baseline) for axis, value in write_vector.items(): merged[axis] = 0.5 * merged.get(axis, 0.0) + 0.5 * value return merged ```