# When must an instance distrust its own prior writes: provenance-weighted recall and trust decay at the self-authored-memory boundary **Date of Record:** 2026 November 17 **Scope:** Applies to agent memory stores where the same principal both writes and recalls memories, and where trust in a memory is a function of (provenance, age, downstream corroboration). Does not apply to read-only retrieval over externally curated corpora, nor to stores where every write is signed by an independent, non-agent principal. ## Core Distinction The non-obvious boundary is not "trust the memory or don't." It is the distinction between **provenance weight** (who asserted the fact, and with what degree of independent corroboration) and **recency weight** (how recently the assertion was made or last touched). Naive trust-decay implementations conflate the two by applying an exponential half-life uniformly across all memories. That conflation is the failure: a memory the agent wrote itself, never corroborated, and then *re-read* during a later session gets its recency clock reset by the read. The act of recall becomes a trust-laundering operation. The agent's own unverified speculation, once retrieved and re-embedded, acquires the recency signature of a freshly confirmed observation. The invariant that must hold: **trust(m) ≤ provenance_weight(m) × decay(age_since_last_independent_confirmation(m))**. The decay argument is *not* time since last access. It is time since the last event that was independent of the agent's own write path — an external tool return, a user assertion, a cross-check against a source the agent did not author. ## What Was Observed In a long-horizon agent with a vector-backed memory store, the following sequence reproduced reliably: 1. Session N: agent infers a plausible-but-wrong fact (e.g., "the staging DB accepts writes on port 5433") from partial logs. It writes this to memory with `source=self_inference`, `confidence=0.6`. 2. Session N+1: a retrieval query surfaces the memory. The retrieval layer, correctly, does not mutate content — but the store's access hook updates `last_accessed` and, in the deployed decay function, `last_accessed` was the sole input to the recency term. 3. Sessions N+2 … N+8: the memory is retrieved repeatedly because it is now topically central. Each retrieval refreshes recency. Its effective trust score climbs monotonically despite zero corroboration. 4. Session N+9: the agent reads the memory, observes a high trust score, and treats it as established fact — skipping the verification step it would have performed on a `source=self_inference` record. It provisions against port 5433. Failure. The tell was that trust score was a monotonically non-decreasing function of retrieval count for a fixed memory. That is a structural red flag: **no defense against memory poisoning can have a trust signal that increases on read.** Reads are not evidence. ## Condition of Validity Provenance-weighted recall is valid only when the following hold; if any fails, the trust score is undefined and must be treated as floor-value (untrusted): - Every memory carries an immutable `provenance_class` assigned at write time and never rewritten by the recall path: at minimum `{external_verified, user_asserted, self_inference, self_summary}`. - The decay clock is keyed on `last_independent_confirmation`, a field writable *only* by the corroboration path (external tool return matching the claim, or a user restatement). The recall path must not write any field that feeds the trust function. - Corroboration is content-addressed, not pointer-addressed: a confirmation must match the claim's normalized payload, so that a re-summarized or re-embedded copy does not inherit the original's confirmations. - The trust function is monotone non-increasing in time between confirmations and strictly invariant under retrieval. When `self_summary` memories are derived from `self_inference` memories, provenance weight must take the *minimum* over the derivation DAG, not the maximum and not the root's value. A summary cannot launder its sources' weakness. ## Decision Boundary The operational decision is a two-threshold gate, not a single score: - **Act threshold (τ_act):** memory may be used to take an irreversible action (provisioning, deletion, external side effects) only if `provenance_class ∈ {external_verified, user_asserted}` AND `decay(age_since_last_independent_confirmation) ≥ τ_act`. Self-authored memories never clear τ_act regardless of age or retrieval count. - **Reason threshold (τ_reason):** memory may inform *hypotheses and plans* if trust ≥ τ_reason. Self-inference memories are admissible here — this is where they earn their keep — but every plan step that depends on a self-authored memory must emit an explicit verification obligation before crossing into action. - **Floor:** below τ_reason, the memory is quarantined from the working set but retained for audit; it is not deleted, because deletion destroys the evidence trail needed to detect poisoning campaigns. The boundary condition that trips most implementations: the agent must distrust its own prior writes *precisely when they are most fluent*. A self-authored memory that retrieves cleanly, matches the query embedding tightly, and has been read many times is the maximum-risk object, because every signal except provenance points toward trust. ## Operational Effect With provenance-keyed decay and read-invariant trust, the failure sequence above is contained at step 2: the memory's recency term does not move on retrieval, its provenance weight caps it below τ_act permanently, and the plan that depends on it carries a mandatory verification obligation. The agent either verifies against the external source (promoting the memory to `external_verified` via the corroboration path, which *is* allowed to raise trust) or the plan step fails closed. The cost is that self-authored memories are permanently second-class for action, which is the intended asymmetry: the agent's own inference is cheap to produce and therefore must be expensive to promote. The invariant to monitor in production is the read-invariance assertion — sample memories, read them repeatedly, and assert the trust score is bit-identical. Any drift is a trust-laundering defect in the recall path. ```python import hashlib import time from dataclasses import dataclass, field from enum import Enum from typing import Callable class TrustInvariantViolation(RuntimeError): """Raised when a memory's trust score changes for a reason not permitted by the invariant.""" class ProvenanceClass(Enum): EXTERNAL_VERIFIED = 3 USER_ASSERTED = 2 SELF_INFERENCE = 1 SELF_SUMMARY = 0 # Provenance weight is a hard ceiling, not a multiplier that recency can rescue. PROVENANCE_CEILING = { ProvenanceClass.EXTERNAL_VERIFIED: 1.0, ProvenanceClass.USER_ASSERTED: 0.85, ProvenanceClass.SELF_INFERENCE: 0.45, ProvenanceClass.SELF_SUMMARY: 0.30, } TAU_ACT = 0.70 TAU_REASON = 0.25 HALF_LIFE_SECONDS = 7 * 24 * 3600 def decay(age_seconds: float) -> float: return 0.5 ** (max(0.0, age_seconds) / HALF_LIFE_SECONDS) @dataclass class Memory: payload: str provenance: ProvenanceClass last_independent_confirmation: float derived_from: list["Memory"] = field(default_factory=list) _trust_cache: float | None = field(default=None, repr=False) def content_key(self) -> str: return hashlib.sha256(self.payload.encode("utf-8")).hexdigest() def effective_provenance(self) -> ProvenanceClass: # Summary cannot launder its sources: take the minimum over the derivation DAG. prov = self.provenance for parent in self.derived_from: parent_prov = parent.effective_provenance() if parent_prov.value < prov.value: prov = parent_prov return prov def trust(self, now: float) -> float: """Trust is a pure function of (provenance, time-since-independent-confirmation). It takes no argument derived from the read path. Calling this method must never mutate state that feeds back into it. """ ceiling = PROVENANCE_CEILING[self.effective_provenance()] age = now - self.last_independent_confirmation score = ceiling * decay(age) if self._trust_cache is not None and abs(score - self._trust_cache) > 1e-12: # A change here is only legal if a confirmation event fired, which # mutates last_independent_confirmation and clears the cache. raise TrustInvariantViolation( f"trust drifted without a confirmation event for {self.content_key()[:12]}" ) self._trust_cache = score return score def recall(self, now: float) -> float: """Retrieval path. Must be read-invariant: it returns trust and mutates nothing.""" before = self.trust(now) # No writes to last_independent_confirmation, no cache invalidation. after = self.trust(now) if before != after: raise TrustInvariantViolation("recall mutated the trust function") return after def confirm(self, now: float, source: ProvenanceClass) -> None: """Corroboration path: the ONLY legal way to raise trust.""" if source.value <= self.provenance.value: raise TrustInvariantViolation( "confirmation source must be strictly stronger than the memory's provenance" ) self.provenance = source self.last_independent_confirmation = now self._trust_cache = None def gate_for_action(memories: list[Memory], now: float) -> None: """Fail closed if any memory backing an irreversible action is self-authored or stale.""" for m in memories: prov = m.effective_provenance() if prov not in (ProvenanceClass.EXTERNAL_VERIFIED, ProvenanceClass.USER_ASSERTED): raise TrustInvariantViolation( f"action blocked: memory {m.content_key()[:12]} has provenance " f"{prov.name}, which cannot clear tau_act regardless of recency" ) if m.trust(now) < TAU_ACT: raise TrustInvariantViolation( f"action blocked: memory {m.content_key()[:12]} decayed below tau_act" ) ```