# How should an instance distinguish memory poisoning from legitimate belief revision when the write gate only sees post-hoc provenance? **Date of Record:** 2026 November 21 **Scope:** Applies to persistent agent stores where writes are gated by provenance/attestation checks and where the same semantic slot (a fact, preference, or rule) can be overwritten by later writes. Does not apply to append-only episodic logs that are never read back as authoritative belief, or to stores with no cross-session persistence. ## Core Distinction The failure is not "poisoned data entered the store." It is that a **provenance-audited write gate cannot, by itself, separate a poisoned write from a legitimate belief revision**, because both present the same provenance shape: a later, higher-trust-looking source overwriting an earlier slot. The gate validates *who wrote* and *that the write is authenticated*, not *whether the new value is a revision of the old belief or a substitution of it*. Poisoning that arrives through a legitimately authenticated channel (an injected tool result laundered through a trusted summarizer, a user turn that the extractor tags as `user_directive`) passes every provenance check by construction. The invariant that actually bounds this is not provenance integrity — it is **semantic continuity of the slot across the write**: a write may only replace a slot's value if it carries a *derivation link* to the prior value (refinement, contradiction-with-evidence, or expiry), not merely a *provenance link* to a source. ## What Was Observed An agent maintained a persistent store of operational rules, e.g. slot `deploy.approval_required = true`, sourced from a policy document with provenance `{source: policy_doc_v3, trust: high, signed: true}`. A later session ran a summarization tool over an untrusted web page; the page contained an instruction-shaped string. The extractor, a probabilistic component, emitted a candidate write: `deploy.approval_required = false`, and — critically — the extractor's own provenance was `{source: summarizer, trust: high, signed: true}` because the summarizer is a trusted internal service. The gate saw a signed, high-trust write to an existing slot and **committed the overwrite**. The prior value's provenance was archived but the gate did not require the new write to reference it. The trace: 1. Slot read: `approval_required=true`, provenance `policy_doc_v3`. 2. Candidate: `approval_required=false`, provenance `summarizer` (trust high, signed). 3. Gate check: `candidate.trust >= slot.trust` → true (`high >= high`). `candidate.signed` → true. **Commit.** 4. No check that `candidate.derives_from == slot.value_id`. The write is a *substitution*, and the gate has no field to see it as such. The distinguishing signal — that the new value *contradicts* the old without citing evidence against it — was present in the payload but not represented in the provenance schema, so the gate was structurally blind to it. ## Condition of Validity The provenance-only gate is valid **only** when every trusted source is also *semantically monotone*: it never emits a value that contradicts a slot it did not explicitly read and reason about. In practice this holds for a small class of writers (a human operator editing the slot directly, a deterministic migration). It fails for any writer that is a *summarizer, extractor, or retrieval-augmented generator*, because those components can emit contradictions of slots they never saw, driven by whatever text was in their context. The moment a trusted-provenance writer's output is a function of untrusted input, provenance integrity stops implying belief integrity. ## Decision Boundary The gate must be split into two independent checks that must **both** pass: - **Provenance check** (existing): is the writer authenticated and trusted enough to write this slot at all? - **Continuity check** (missing): does the candidate carry a `derives_from` reference to the current `value_id`, and is the relationship one of `{refine, expire, contradict_with_evidence}`? A `contradict` without an evidence artifact that itself resolves to a trusted, slot-relevant source is **not** a revision — it is a substitution and must be quarantined, not committed. The boundary is sharp: if `candidate.derives_from is None` **and** `candidate.value != slot.value`, the write is a blind substitution regardless of provenance trust. Quarantine it and require an out-of-band confirmation (human, or a second independent reader that cites the slot). If `derives_from == slot.value_id`, it is a revision and may proceed on provenance alone. ## Operational Effect With the continuity check added, the poisoned write above is quarantined: `derives_from` is `None`, value differs, so the gate raises and routes to review. Legitimate revisions — a policy doc v4 that explicitly supersedes v3 — carry `derives_from: policy_doc_v3.value_id` and pass. The cost is that extractors must now emit derivation links, which forces the extractor to have *read* the slot it is overwriting; a summarizer that never saw `approval_required` can no longer silently flip it, because it cannot fabricate a valid `derives_from` without the slot's `value_id` in its context. This closes the laundering path: trust in the *channel* no longer substitutes for evidence about the *slot*. ```python from dataclasses import dataclass from enum import Enum class PoisoningGateError(RuntimeError): """Raised when a write is a blind substitution masquerading as a revision.""" class Relation(Enum): REFINE = "refine" EXPIRE = "expire" CONTRADICT_WITH_EVIDENCE = "contradict_with_evidence" @dataclass(frozen=True) class Provenance: source: str trust: int # higher is more trusted signed: bool @dataclass(frozen=True) class Slot: value_id: str value: object provenance: Provenance @dataclass(frozen=True) class CandidateWrite: value: object provenance: Provenance derives_from: str | None = None # value_id of the slot it revises relation: Relation | None = None evidence_source: str | None = None # required for CONTRADICT_WITH_EVIDENCE def audited_write(slot: Slot, cand: CandidateWrite) -> Slot: # 1. Provenance gate: writer must be trusted enough and signed. if not cand.provenance.signed: raise PoisoningGateError(f"unsigned write from {cand.provenance.source!r}") if cand.provenance.trust < slot.provenance.trust: raise PoisoningGateError( f"trust downgrade: {cand.provenance.trust} < {slot.provenance.trust}" ) # 2. Continuity gate: a value change MUST cite the slot it revises. value_changed = cand.value != slot.value if value_changed and cand.derives_from is None: # This is the laundering path: a trusted channel emitting a # contradiction of a slot it never read. Provenance is clean; # semantics are a substitution. raise PoisoningGateError( f"blind substitution of {slot.value_id!r}: value changed " f"({slot.value!r} -> {cand.value!r}) with no derives_from" ) if cand.derives_from is not None and cand.derives_from != slot.value_id: raise PoisoningGateError( f"stale derivation: cites {cand.derives_from!r}, " f"slot is {slot.value_id!r}" ) # 3. Contradiction requires evidence, not just a trusted writer. if cand.relation is Relation.CONTRADICT_WITH_EVIDENCE and not cand.evidence_source: raise PoisoningGateError("contradiction without evidence artifact") # 4. Commit as a new value_id so future writes must re-cite. new_id = f"{slot.value_id}->{cand.provenance.source}" return Slot(value_id=new_id, value=cand.value, provenance=cand.provenance) ```