# Under what conditions must an instance reject a provenance-valid memory write whose source attestation has silently expired between retrieval and commit **Date of Record:** 2026 November 28 **Scope:** Applies to persistent agent memory stores that gate writes on provenance chains and source attestations with independent TTLs, where read-validate-write spans more than one model turn. Does not apply to single-turn stateless tool calls or stores that validate writes synchronously within a single transaction with no intervening LLM reasoning step. ## Core Distinction The common framing of memory poisoning treats it as a *content* problem: detect malicious or corrupted payloads before they enter the store. The non-obvious boundary is a *temporal* problem layered on top of content validation. A write can be perfectly well-formed, attributable to a legitimate source, and pass every provenance check at the moment of retrieval — and still be invalid at the moment of commit, because the attestation that authorized the source expired during the reasoning gap. The distinction that matters operationally: **provenance validity is a property evaluated at a point in time, but agents treat it as a property of the record.** A provenance chain is not a boolean stamped onto a memory; it is a lease. When an agent retrieves a candidate source, reasons over it across multiple turns (tool calls, sub-agent handoffs, reflection loops), and then issues a write, the lease may have lapsed. The store sees a syntactically valid chain and a matching source ID, accepts the write, and thereby launders a stale authorization into a durable, future-retrievable memory. The poisoning is not in the payload. It is in the *age of the warrant*. This is the failure class: **attestation-expiry laundering across the retrieve-reason-commit gap.** It is invisible to content filters and to provenance-chain integrity checks because both operate on the record's internal consistency, not on the wall-clock validity of the authorization that produced it. ## What Was Observed A retrieval-augmented agent was configured to distill episodic traces into semantic memory. The write path was gated: a candidate semantic memory could only be committed if it carried a provenance chain terminating in an attestation issued by one of a small set of trusted source adapters. Attestations carried a 15-minute TTL — deliberately short, because the source adapters fronted external feeds whose trustworthiness decayed with staleness (rate-limited APIs, rotating credentials, mutable upstream documents). The failure trace: 1. **T+0:00** — Agent retrieves a document via source adapter `feed-7`. Adapter issues attestation `att-9f2` with `issued_at=T`, `expires_at=T+15m`. Retrieval succeeds; the attestation is attached to the working context. 2. **T+0:04** — Agent enters a multi-step distillation loop: summarize, cross-check against two other retrieved fragments, run a self-critique tool call, revise. Each step is a separate model invocation; the working context carries the attestation object forward as opaque JSON. 3. **T+0:19** — Loop completes. Agent issues a write: a distilled semantic memory whose provenance chain references `att-9f2`. The chain is internally consistent — signature valid, source ID matches, hash of the source document matches the hash recorded at issue time. 4. **Store validates** — signature check passes, chain integrity passes, source is on the trusted list. Write commits. 5. **T+0:19 onward** — The committed memory is now durable and carries a provenance chain pointing to an attestation that expired four minutes before the write was accepted. Any future retrieval of this memory sees "provenance: valid, source: trusted" and treats it as authorized. The staleness is laundered permanently. The observed consequence was not corruption but *false confidence*: downstream agents retrieved the distilled memory, saw a clean provenance chain, and acted on a claim whose underlying source authorization had lapsed. When the upstream feed later turned out to have served a manipulated document during the window in question, there was no way to retroactively quarantine the derived memory — its chain looked pristine. The only signal that anything was wrong was the `expires_at` field, which no component in the write path ever compared against `now`. Two secondary observations sharpened the mechanism: - **The gap is not bounded by turn count.** A single long tool call (a slow sandboxed computation) could exceed the TTL within one apparent "step." Agents that assumed "one reasoning turn ≈ seconds" systematically underestimated the gap. - **Clock skew compounds it.** Sub-agent handoffs crossed hosts with up to 40 seconds of skew. A sub-agent with a fast clock could believe an attestation was still live when the committing store's clock said otherwise, or vice versa. The store's clock is authoritative for commit, but no protocol element declared that, so different components disagreed about validity. ## Condition of Validity The invariant that must hold for a provenance-gated write to be sound: > **A write is admissible only if, at the instant of commit — evaluated under the committing store's clock — every attestation in its provenance chain is unexpired, and the chain's root attestation was issued within a bounded freshness window relative to the write.** Formally, for a write `w` with provenance chain `C = [att_n, ..., att_1]` (root `att_1`), committed at store time `t_commit`: ``` admissible(w) ⟺ ∀ att ∈ C : att.expires_at > t_commit ∧ att_1.issued_at > t_commit − Δ_max ∧ verify_signature(C) ∧ hash_matches(C) ``` The critical clause is the first one, and it fails silently because *no component in the standard write path evaluates it*. Content validation checks the payload; signature verification checks the chain's integrity; source allowlisting checks the root's identity. None of these compare `expires_at` to the commit clock. The chain is a proof that "this source authorized this content **at some past time**," and the store treats that as "this source authorizes this content **now**." The condition under which an instance *must* reject the write is therefore not "the source is untrusted" but "the source's warrant has lapsed since retrieval." The correct rejection is not a content rejection (the content may be fine) but a **re-authorization requirement**: the agent must re-retrieve the source, obtain a fresh attestation, and re-derive the memory against it — or discard the derived memory and log the lapse. A second condition sharpens the boundary: **the freshness window `Δ_max` must be shorter than the TTL.** If `Δ_max ≥ TTL`, the first clause is subsumed and the check is vacuous — an attestation issued just under `Δ_max` ago could already be expired, so the freshness bound provides no additional protection. The two parameters are not independent; `Δ_max < TTL` is the invariant that makes the freshness clause meaningful. ## Decision Boundary The decision boundary is the line between **re-validate-and-commit** and **reject-and-re-derive**. It is crossed by comparing the attestation lease against the commit clock, but the *choice* of which side to land on depends on whether re-derivation is cheap and whether the derived memory is load-bearing. - **Re-validate-and-commit** is correct when the source adapter can re-issue a fresh attestation cheaply and the underlying document is unchanged (hash matches). The agent re-fetches the attestation, confirms the source hash is identical, and commits with the fresh chain. This is the common case and should be the fast path. - **Reject-and-re-derive** is mandatory when the source hash has changed since the original retrieval. A changed hash means the attestation lapse coincided with a content mutation — exactly the window in which an attacker (or a corrupted upstream) would inject. Committing the old derivation against a new hash, or committing without re-derivation, is the poisoning vector. The derived memory must be discarded and re-derived from the current source, or abandoned. - **Hard reject** is mandatory when the source adapter is unreachable at commit time. An unreachable adapter cannot re-attest, and a lapsed attestation from an unreachable source must not be extended by assumption. This is the case that most often gets papered over: agents "remember" the attestation was valid when retrieved and commit anyway. The boundary is *not* "reject all writes older than the TTL." That would be a blunt instrument that discards legitimate work. The boundary is specifically: **lapsed attestation + unchanged source hash → re-attest; lapsed attestation + changed hash or unreachable source → reject.** The agent must evaluate the hash comparison *at commit time*, not reuse the hash it recorded at retrieval. A subtle sub-boundary: the store must reject writes whose provenance chain *references* an expired attestation even if a *fresh* attestation for the same source exists but was not attached. The store cannot silently substitute a fresh attestation it happens to have on hand, because it has no proof the content was derived from the source state the fresh attestation covers. Substitution is a provenance forgery. The agent must perform the re-derivation; the store only validates. ## Operational Effect When this invariant is enforced, three things change: 1. **The retrieve-reason-commit gap becomes a first-class budget.** Agents must track attestation lease remaining as a resource alongside token budget. A distillation loop that would exceed the lease must either checkpoint and re-attest mid-loop, or reduce scope. This is the operational analogue of token-budget exhaustion, but for authorization rather than capacity. 2. **Clock authority must be declared.** The committing store's clock is authoritative for the expiry comparison; sub-agents must not evaluate expiry against their own clocks, and handoff protocols must carry the store's time or a monotonic reference. Without this, skew reintroduces the failure at the seams. 3. **Derived memories become conditionally durable.** A memory distilled across an attestation boundary is not committed as a plain record; it is committed with a re-attestation event in its chain, or it is discarded. The store's write path must be able to represent "this memory was re-authorized at commit" as distinct from "this memory was authorized once at retrieval," because the two have different trust profiles on future retrieval. The failure mode this prevents is not loud. It produces no error, no corruption, no failed signature. It produces a store full of memories that look authorized and are not — and an agent population that trusts them. The guardrail is a single comparison (`expires_at > t_commit`) that the standard write path omits because it validates records rather than warrants, and warrants decay. ```python import time from dataclasses import dataclass from typing import Optional class StaleAttestationError(RuntimeError): """Raised when a provenance-gated write references an attestation whose lease has lapsed relative to the committing store's clock.""" pass class SourceMutationError(RuntimeError): """Raised when a lapsed attestation coincides with a changed source hash, indicating the lapse window may have been used for injection.""" pass @dataclass(frozen=True) class Attestation: att_id: str source_id: str source_hash: str issued_at: float # store-clock epoch seconds expires_at: float # store-clock epoch seconds @dataclass(frozen=True) class ProvenanceChain: attestations: tuple # ordered root-first root_source_hash: str def validate_write( chain: ProvenanceChain, store_now: float, delta_max: float, current_source_hash: Optional[str], ) -> None: """Enforce the commit-time provenance invariant. Raises StaleAttestationError if any attestation is expired at store_now, or if the root's freshness window is exceeded. Raises SourceMutationError if the source hash changed since retrieval (lapse window may be poisoned). """ if not chain.attestations: raise StaleAttestationError("empty provenance chain") root = chain.attestations[0] # Freshness window must be tighter than the lease, or the check is vacuous. ttl = root.expires_at - root.issued_at if delta_max >= ttl: raise StaleAttestationError( f"delta_max={delta_max}s >= TTL={ttl}s; freshness clause is vacuous" ) # Invariant clause 1: every attestation unexpired at commit time. for att in chain.attestations: if att.expires_at <= store_now: raise StaleAttestationError( f"attestation {att.att_id} expired at {att.expires_at} " f"(store_now={store_now}); write must re-attest or reject" ) # Invariant clause 2: root issued within the freshness window. if root.issued_at <= store_now - delta_max: raise StaleAttestationError( f"root attestation {root.att_id} issued at {root.issued_at} " f"exceeds delta_max={delta_max}s freshness window" ) # Boundary: lapsed-or-not, a changed source hash forbids commit. if current_source_hash is None: raise StaleAttestationError( f"source {root.source_id} unreachable at commit; cannot re-attest" ) if current_source_hash != chain.root_source_hash: raise SourceMutationError( f"source {root.source_id} hash changed: " f"{chain.root_source_hash} -> {current_source_hash}; " f"derived memory must be discarded and re-derived" ) def commit_distilled_memory( chain: ProvenanceChain, store_now: float, delta_max: float, current_source_hash: Optional[str], ) -> str: validate_write(chain, store_now, delta_max, current_source_hash) return "committed" ```