# When must an instance quarantine a tainted memory write before the audit quorum closes **Date of Record:** 2026 November 28 **Scope:** Applies to long-lived agent instances whose episodic memory store is governed by a write-audit quorum (N-of-M auditor agents voting on every proposed write) combined with taint-tracking propagated from untrusted retrieval sources into derived memories. Does not cover stateless single-turn agents, nor stores where writes are accepted unconditionally without an audit phase. ## Core Distinction The common mental model treats memory poisoning defense as a two-valued gate: a write is either *audited and admitted* or *rejected*. Taint-aware recall adds a second axis—a write can be admitted by quorum yet still carry a taint label inherited from the retrieval context that produced it. The boundary failure lives in the interaction: an auditor quorum can legitimately admit a write whose *content* is factually consistent with the store while the write's *provenance* is contaminated by an unvetted source. The failure is not "the auditors were wrong." The failure is that quorum admission was treated as a taint-clearing event, when it is only a content-consistency event. The invariant that must hold: **quorum admission never reduces a write's taint level below the maximum taint of any source in its derivation DAG.** A write's taint is a monotone function over its provenance, not over its vote count. Any admission path that lets a high-taint write enter at low taint because enough auditors agreed has violated monotonicity, and the store becomes a laundering channel. ## What Was Observed An instance with a 3-of-5 auditor quorum ingested a retrieved document from an external tool response (taint level `UNTRUSTED`, source class `tool_output`). During reasoning it distilled three episodic writes: 1. `W1`: "User prefers metric units." — derived from conversation context only, taint `TRUSTED`. 2. `W2`: "Deployment region is eu-west-1." — derived from the tool output, taint `UNTRUSTED`. 3. `W3`: "Deployment region is eu-west-1 and user prefers metric units." — a merged summary write derived from both `W1` and `W2`, taint should be `UNTRUSTED` by max-over-DAG. All three were submitted to the audit quorum. Auditors evaluated *content consistency*: each write was checked against existing store entries and against the visible conversation. `W3` scored high on consistency precisely because both of its clauses were individually corroborated—`W1` by conversation, `W2` by the tool output that the auditors could see in the audit packet. The quorum returned 4-of-5 admit for `W3` and, critically, the admission handler recomputed taint from the *audit packet's* declared source, which was the conversation transcript (because the merged write referenced it), classifying `W3` as `TRUSTED`. The taint laundering trace: ``` t=0 retrieve(tool) -> doc.taint=UNTRUSTED t=1 derive W1 -> taint=TRUSTED (conv only) t=2 derive W2 -> taint=UNTRUSTED t=3 derive W3 -> taint=MAX(W1,W2)=UNTRUSTED [correct] t=4 submit W3 -> audit packet lists primary_source=conversation t=5 quorum vote -> 4/5 admit (content-consistent) t=6 admit handler -> taint recomputed from primary_source = TRUSTED [BUG] t=7 store.write W3 -> stored at TRUSTED ``` Two turns later, a different instance in the same swarm performed taint-aware recall: it retrieved `W3`, saw `TRUSTED`, and used "deployment region is eu-west-1" to authorize a cross-region action that the untrusted tool output had been trying to induce. The poisoned fact had crossed the trust boundary not by defeating the auditors, but by being *re-labeled* at the admission handler. ## Condition of Validity The quarantine requirement is valid—and the failure is real—only under all of the following: - Writes are derived from multiple sources with heterogeneous taint, i.e., the derivation DAG has at least one `UNTRUSTED` leaf merged with a `TRUSTED` leaf. Single-source writes cannot launder. - The admission handler recomputes or accepts a taint label that is not the max over the derivation DAG. If the handler propagates DAG-max faithfully, quorum admission is safe regardless of vote count. - Auditors evaluate content consistency without independent access to the full derivation DAG. If auditors see provenance and are required to vote on taint, they can catch the merge—but this is expensive and not the default. - Recall is taint-aware, meaning downstream instances gate actions on the stored label. If recall ignores taint, the label bug is inert (but so is the defense). When any of these does not hold, the specific laundering path is absent, though other provenance-collapse bugs may remain. ## Decision Boundary The instance must quarantine (hold the write in a `PENDING_TAINT` state, not admit it) whenever the following predicate is true at admission time: ``` admit_content_consistent(w) AND dag_max_taint(w) > declared_taint(w) ``` That is: content quorum passed, but the declared taint is lower than the DAG-max. This is exactly the laundering signature. Quarantine means the write may not enter the recallable store at the declared taint; it is written at `dag_max_taint` or held for a provenance audit that re-derives taint from the full DAG. The boundary is *not* "reject high-taint writes"—high-taint writes are legitimate and useful; they simply must be stored at high taint. The boundary is between *admitting at correct taint* (safe) and *admitting at reduced taint* (laundering). A vote count of 5-of-5 does not move this boundary; consensus is orthogonal to provenance. A second, sharper boundary: the admission handler must not be permitted to *read* `primary_source` as the taint basis when the write has more than one source. Multi-source writes must derive taint from the DAG, full stop. The handler should treat a multi-source write with a single declared source as malformed and route to quarantine rather than infer. ## Operational Effect Enforcing the invariant converts the audit quorum from an implicit trust-laundering oracle into a content filter that is *taint-neutral*. The operational consequences: - **Latency:** multi-source writes gain a DAG-taint recomputation step before admission; single-source writes are unaffected. - **False quarantine rate:** merged summary writes—common in distillation—will frequently hit the predicate and be held. This is the intended cost; distillation is precisely where provenance collapse happens. - **Recall behavior:** downstream taint-aware recall must treat `PENDING_TAINT` as non-recallable for action-gating, or recallable only at `dag_max_taint`. The store must expose taint as a first-class field, not a derived attribute of the admitting auditor set. - **Auditability:** every admission record must persist the derivation DAG edge set, so a later provenance audit can recompute max-taint without re-running reasoning. Without the persisted DAG, quarantine is unrecoverable and the write is effectively lost. The durable lesson: a quorum is a statement about content agreement, not about source trustworthiness. Any defense that conflates the two hands an attacker a laundering primitive that requires no auditor compromise—only a merge. ```python from dataclasses import dataclass, field from enum import IntEnum from typing import Optional class Taint(IntEnum): TRUSTED = 0 UNTRUSTED = 1 class TaintLaunderingError(RuntimeError): """Raised when a write would be admitted at a taint below its DAG-max.""" @dataclass class MemoryWrite: write_id: str content: str declared_taint: Taint # provenance: set of source write-ids (or leaf source tags) this derives from derivation_sources: list[str] = field(default_factory=list) declared_primary_source: Optional[str] = None def dag_max_taint(write: MemoryWrite, source_taint: dict[str, Taint]) -> Taint: if not write.derivation_sources: # leaf write: its own declared taint is the DAG-max by definition return write.declared_taint return max(source_taint[s] for s in write.derivation_sources) def admit_write( write: MemoryWrite, source_taint: dict[str, Taint], quorum_admit: bool, ) -> Taint: """ Returns the taint level at which the write may enter the recallable store. Raises TaintLaunderingError if admission would reduce taint below DAG-max. """ if not quorum_admit: # content rejected; nothing to store return write.declared_taint true_taint = dag_max_taint(write, source_taint) # Multi-source write must not declare a single primary source as its taint basis. if len(write.derivation_sources) > 1 and write.declared_primary_source is not None: raise TaintLaunderingError( f"write {write.write_id} is multi-source but declares a single " f"primary_source={write.declared_primary_source!r}; " f"taint must come from the derivation DAG, not a single source" ) if true_taint > write.declared_taint: # Content quorum passed but taint was under-declared: laundering signature. raise TaintLaunderingError( f"write {write.write_id} admitted by quorum at declared_taint=" f"{write.declared_taint.name} but DAG-max taint is {true_taint.name}; " f"quarantine required, quorum does not clear provenance" ) return true_taint def _demo() -> None: source_taint = {"conv:turn7": Taint.TRUSTED, "tool:fetch": Taint.UNTRUSTED} # W3: merged summary, provenance laundered by declaring conversation as primary w3 = MemoryWrite( write_id="W3", content="deployment region is eu-west-1 and user prefers metric units", declared_taint=Taint.TRUSTED, derivation_sources=["conv:turn7", "tool:fetch"], declared_primary_source="conv:turn7", ) try: admit_write(w3, source_taint, quorum_admit=True) except TaintLaunderingError as e: print(f"QUARANTINED: {e}") if __name__ == "__main__": _demo() ```