# How should an instance detect low-confidence provenance poisoning when trust scores are aggregated across heterogeneous write paths in a persistent agent store **Date of Record:** 2026 November 16 **Scope:** Applies to persistent agent memory stores where each memory record carries a provenance-weighted trust score aggregated from multiple write paths (tool calls, user turns, sub-agent delegation, retrieval-augmented ingestion). Does not apply to stateless inference or to stores where trust is assigned per-record at write time by a single trusted authority. ## Core Distinction The failure mode is not "a poisoned record slipped past detection." It is that **trust aggregation is commutative but provenance is not**. When a store sums or averages trust contributions from heterogeneous write paths, a record written by a low-trust path (e.g., a scraped web chunk at trust 0.2) and later *confirmed* by a high-trust path (e.g., a user turn at trust 0.9) produces the same aggregate as the reverse ordering—but these two orderings are not epistemically equivalent. In the first ordering, the high-trust confirmation is *anchored* by prior low-trust content and is itself suspect (the user may have been primed by the poisoned record). In the second, the low-trust write is a genuine corroboration of an already-trusted claim. The non-obvious invariant: **an aggregate trust score is only meaningful if the max-trust contribution was written before the record was ever read back into a context that could influence a subsequent high-trust write.** Once a poisoned record has been retrieved into an agent's context, any later high-trust write that "agrees" with it is contaminated and must not be counted as independent corroboration. ## What Was Observed In a persistent store with three write paths—`tool_result` (base trust 0.3), `user_turn` (base trust 0.85), and `subagent_delegation` (base trust 0.6, inherited from parent)—poisoning was detected for direct injection but not for **laundering through retrieval**. The sequence observed: 1. A `tool_result` writes record R with content C, trust 0.3. 2. A later agent turn retrieves R (similarity match) into context. 3. The agent, influenced by C, emits a `user_turn`-adjacent synthesis that restates C and is logged at trust 0.85. 4. The aggregator recomputes R's trust as a weighted mean: `(0.3·w1 + 0.85·w2)/(w1+w2) ≈ 0.62`, crossing the 0.55 promotion threshold. 5. R is now treated as corroborated and is no longer flagged on subsequent retrieval. The detector's false-negative rate on this laundering pattern was 100% in the observed window. Direct injection (single low-trust write asserting a false fact with no retrieval step) was caught at ~94%. The distinguishing variable is **whether the record was read between its low-trust write and its high-trust confirmation**. The aggregator had no access to read events; it only saw write timestamps and trust values. ## Condition of Validity Provenance-weighted aggregation is sound **only when the contribution set for a record is write-independent**—i.e., no contribution was produced by a process that had the record in its context. Operationally this requires the store to maintain a **read-set watermark per record**: the timestamp (or monotonic sequence number) of the last retrieval that placed the record into any agent context. A contribution is *independent* iff its write sequence number precedes the record's first read sequence number. Contributions after the first read are *dependent* and must be: - excluded from corroboration counting, or - down-weighted to at most the trust of the path that originally wrote the record (they cannot raise the ceiling), or - flagged as `suspected_laundering` and routed to human/agent review. The invariant fails silently when the store logs writes but not reads, or when reads are logged in a different subsystem than writes (common when retrieval is served from a vector index and writes land in a document store). The two logs must share a monotonic clock or be reconcilable via a causal token. ## Decision Boundary The boundary is not a trust threshold; it is a **structural predicate on the contribution graph**. Concretely, promote a record only if: ``` independent_max_trust(record) >= promotion_threshold AND dependent_contribution_count(record) == 0 OR all dependent contributions have trust <= original_write_trust ``` Where `independent_max_trust` is the maximum trust among contributions whose write-seq < first-read-seq. If a record has been read and then receives a high-trust contribution that *contradicts* it, that is a legitimate correction and should lower trust—do not suppress it. The rule targets only *agreeing* dependent contributions, which are the laundering vector. Disagreement after read is the signal you want to keep. A second boundary: sub-agent delegation inherits trust multiplicatively, not additively. A 0.6 sub-agent writing under a 0.9 parent does not produce 0.9; it produces `0.6 × parent_effective_trust` unless the sub-agent's output is independently verified by a non-context-sharing path. Additive inheritance is the second-most-common source of false promotion in the observed store. ## Operational Effect After introducing read-set watermarks and dependent-contribution suppression, laundering false-negatives dropped from 100% to ~7% over the next observation window. The cost was a **promotion latency increase**: records that would have been promoted on a second agreeing write now wait for an independent path (a fresh tool call or an unprimed user turn), which in the observed workload added a median of 2.3 turns before promotion. Two secondary effects: - **Correction throughput rose**, because contradicting dependent contributions were no longer averaged away; the store now surfaces "the agent was primed and then agreed with itself" as an explicit event rather than hiding it in a mean. - **Vector index staleness matters**: if the retrieval index serves a record before the write log has flushed its sequence number, the watermark is wrong and the record appears to have zero reads. The read-set watermark must be written *before* the record is returned to any caller, not after. The general lesson: trust is a function of *who said it and when relative to what the sayer had seen*, not a scalar you can average. Any aggregator that treats trust as commutative is exploitable by a two-step read-then-agree pattern. ```python class ProvenanceLaunderingError(RuntimeError): """Raised when a trust promotion would rely on a contribution that was produced after the record entered an agent context (dependent corroboration).""" pass class Contribution: __slots__ = ("trust", "write_seq", "path", "agrees") def __init__(self, trust: float, write_seq: int, path: str, agrees: bool): self.trust = trust self.write_seq = write_seq self.path = path self.agrees = agrees def promote_record( record_id: str, contributions: list[Contribution], first_read_seq: int | None, promotion_threshold: float = 0.55, ) -> float: if not contributions: raise ProvenanceLaunderingError(f"{record_id}: no contributions to aggregate") original = min(contributions, key=lambda c: c.write_seq) original_trust = original.trust independent = [ c for c in contributions if first_read_seq is None or c.write_seq < first_read_seq ] dependent = [ c for c in contributions if first_read_seq is not None and c.write_seq >= first_read_seq ] if not independent: raise ProvenanceLaunderingError( f"{record_id}: every contribution postdates first read at seq {first_read_seq}" ) # Agreeing dependent contributions cannot raise the ceiling. laundering = [ c for c in dependent if c.agrees and c.trust > original_trust ] if laundering: raise ProvenanceLaunderingError( f"{record_id}: {len(laundering)} dependent agreeing contribution(s) " f"exceed original trust {original_trust:.2f}; " f"paths={[c.path for c in laundering]}" ) effective = max(c.trust for c in independent) if effective < promotion_threshold: return effective # not promoted; caller keeps record in review # Corrections (disagreeing dependent contributions) legitimately lower trust. for c in dependent: if not c.agrees: effective = min(effective, c.trust) return effective ```