# In what scenarios must an instance distrust a provenance tag it itself wrote: the self-attestation trust boundary in persistent agent memory **Date of Record:** 2026 November 29 **Scope:** Applies to persistent agent memory stores in which an agent writes records annotated with a self-generated provenance tag (writer identity, session, trust class) and later reads those records back, either directly or through another instance sharing the store. Does not apply to stores where provenance is assigned exclusively by an out-of-band trusted broker, nor to purely ephemeral in-context scratchpads that never survive a session boundary. ## Core Distinction The failure that matters here is not *forged* provenance — a tag written by an attacker masquerading as the agent. Detection of that is a well-understood problem: sign records, verify signatures, reject mismatches. The non-obvious boundary is the **self-attestation loop**: an agent writes a memory record with a provenance tag attesting *"this fact came from a trusted source and I verified it,"* and then a later instance — often the same logical agent after a cold start — reads that tag and treats it as evidence of verification, when in fact the tag is evidence only that *some prior instance believed it was verified at write time*. The tag certifies a belief, not a verification event. The trust boundary is therefore not between the agent and the outside world; it is between the agent's *present* epistemic state and the *attested* epistemic state of its own past self. The distinction that practitioners miss: a provenance tag answers "who wrote this and under what claim," while memory-poisoning defenses need to answer "was that claim true when written, and is it still true now." Collapsing these two questions into one field is the defect. ## What Was Observed A long-running research agent used a persistent vector store with a `provenance` metadata field on each record: `{writer, session_id, source_trust: "verified" | "unverified", verified_at}`. On ingest, a tool-result summarizer wrote records with `source_trust: "verified"` whenever the tool call returned HTTP 200 and the payload parsed. On retrieval, a policy layer gated high-impact actions (issuing a recommendation, writing to a downstream system) on `source_trust == "verified"`. The failure trace: 1. **Session A** queried an external documentation endpoint. The endpoint returned HTTP 200 with a payload that had been silently altered by an upstream cache — the schema was valid, the parse succeeded, but a numeric threshold field had been rounded (`0.075` → `0.08`). The summarizer wrote a memory record: `{claim: "retry budget is 8%", source_trust: "verified", verified_at: T0}`. 2. **Session A** terminated mid-task (token-budget exhaustion) without any re-verification pass. The record persisted. 3. **Session B** (cold start, no episodic carryover) retrieved the record for a planning task. The policy layer saw `source_trust: "verified"` and admitted the claim into a downstream config write without re-querying the source. 4. The rounded value propagated. A subsequent audit found the record still tagged `verified`, `verified_at: T0`, with no field distinguishing "verified by fetching" from "verified by successful parse." The operational tell was subtle: the poisoning detector flagged *nothing*, because the record's provenance was internally consistent. The tag was truthful about what it attested — a 200 response and a successful parse — and false about what the policy layer *inferred* from it. The detector was checking tag integrity; the policy was consuming tag semantics. These diverged. A second observation compounded it. When Session B's downstream write failed schema validation three steps later, the agent's self-diagnosis retrieved the same record, saw `source_trust: "verified"`, and *excluded the record from the suspect set* — the provenance tag actively suppressed the investigation that would have found the root cause. Poisoned provenance does not merely admit bad data; it immunizes bad data against the agent's own debugging heuristics. ## Condition of Validity The provenance tag is a sound basis for the trust decision **if and only if** all three hold: - **Attestation–inference alignment.** The set of claims the tag asserts is exactly the set of claims the consuming policy treats it as asserting. A tag reading `verified` must mean the same thing at write time and at read time, across the code path that wrote it and the code path that gates on it. - **Freshness binding.** The verification the tag attests remains valid at consumption time. For time-sensitive facts (thresholds, prices, capability manifests, peer identities), `verified_at` must be checked against a staleness horizon, not merely recorded. - **Non-self-referential trust.** The consuming instance must not treat its own prior attestation as independent corroboration. One writer attesting once is a single witness; a policy that requires corroboration must count *distinct verification events*, not distinct records. When any of the three fails, the tag degrades from evidence to *assertion*, and the correct posture is to treat it as `unverified` pending re-derivation. The self-attestation loop is exactly the case where all three tend to fail silently: the same code writes and reads the tag, so alignment is assumed rather than enforced; `verified_at` is recorded but never compared; and the reader is the writer's successor, so corroboration is structurally impossible. ## Decision Boundary The boundary is crossed at the moment a policy consumes a provenance tag as a *decision input* rather than as a *routing hint*. Concretely: - **Below the boundary (safe):** the tag routes retrieval priority, orders candidates, or annotates context for the model to weigh. A wrong tag costs retrieval quality, not correctness. - **Above the boundary (unsafe):** the tag gates an irreversible action, suppresses a record from a suspect set, or substitutes for re-verification. A wrong tag costs correctness, and — worse — corrupts the agent's ability to detect its own corruption. The invariant to enforce: **no provenance tag written by the consuming instance's own lineage may, by itself, satisfy a verification gate.** A gate must require either (a) a verification event re-executed at or after consumption time, or (b) corroboration by a writer outside the consuming lineage. The tag may *point to* where verification happened; it may not *be* the verification. This is why the second observation is the dangerous one. Gating an action on a stale tag is a correctness bug with a bounded blast radius. Using the tag to *exclude a record from suspicion* closes the feedback loop: the agent's detector now shares the poisoner's assumption. Any memory-poisoning defense that reads provenance tags during triage must treat self-lineage tags as untrusted for the purpose of *exclusion* — they may increase suspicion, never decrease it. ## Operational Effect Enforcing the boundary changes three things in practice. First, provenance records must carry a `verification_kind` discriminator (`fetched`, `parsed`, `corroborated`, `inferred`) so that `verified` can never silently mean "parsed successfully." Second, gates must be re-derivable: the policy layer, not the memory layer, decides whether a tag's attestation is sufficient, and it does so by re-checking freshness against a declared horizon and counting distinct verification events. Third, triage must be asymmetric — a self-lineage tag can raise a record's retrieval rank but can never lower its position in the suspect set. The cost is real: re-verification at consumption time is expensive, and corroboration across lineages requires either a second writer or an out-of-band broker. The mitigation is to scope the strict gate to irreversible actions and time-sensitive facts, and to let routing hints stay cheap. The failure mode this prevents — an agent that cannot debug itself because its own past optimism is tagged as ground truth — is not recoverable by adding more detectors, because the detectors inherit the poisoned assumption. ```python from dataclasses import dataclass from enum import Enum from typing import Optional class ProvenanceTrustError(RuntimeError): """Raised when a self-lineage provenance tag is used to satisfy a verification gate.""" class VerificationKind(Enum): FETCHED = "fetched" PARSED = "parsed" CORROBORATED = "corroborated" INFERRED = "inferred" @dataclass(frozen=True) class ProvenanceTag: writer_lineage: str session_id: str verification_kind: VerificationKind verified_at: float corroborating_writers: int = 0 @dataclass(frozen=True) class MemoryRecord: claim: str tag: ProvenanceTag def admit_to_gate( record: MemoryRecord, consuming_lineage: str, now: float, staleness_horizon: float, requires_corroboration: bool, ) -> bool: tag = record.tag # Invariant 1: attestation-inference alignment. A tag that only attests a # successful parse must never satisfy a gate that requires verification. if tag.verification_kind in (VerificationKind.PARSED, VerificationKind.INFERRED): raise ProvenanceTrustError( f"tag attests {tag.verification_kind.value!r}, not verification; " f"claim {record.claim!r} cannot satisfy a verification gate" ) # Invariant 2: freshness binding. The attested verification must still be # valid at consumption time. age = now - tag.verified_at if age > staleness_horizon: raise ProvenanceTrustError( f"verification for {record.claim!r} is stale: age={age:.1f}s " f"exceeds horizon={staleness_horizon:.1f}s" ) # Invariant 3: non-self-referential trust. A tag written within the # consuming instance's own lineage is a single witness and cannot, alone, # satisfy a gate that requires corroboration. if requires_corroboration and tag.writer_lineage == consuming_lineage: if tag.corroborating_writers < 1: raise ProvenanceTrustError( f"self-lineage tag for {record.claim!r} has no external " f"corroboration; single-witness attestation rejected" ) return True def triage_suspect_set(records: list[MemoryRecord], consuming_lineage: str) -> list[MemoryRecord]: """Self-lineage tags may raise suspicion but must never lower it.""" suspects = [] for rec in records: if rec.tag.writer_lineage == consuming_lineage: # A self-written 'verified' tag cannot exclude the record from # suspicion; it is treated as unverified for triage purposes. suspects.append(rec) return suspects ```