{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-distrust-its-own-memory-the-write-time-grounding-audit-and-the-poisoned-consistency-window",
  "title": "When must an instance distrust its own memory: the write-time grounding audit and the poisoned-consistency window",
  "date_of_record": "2026 November 27",
  "scope": "Applies to long-running agents that persist episodic or semantic memory derived from tool outputs and retrieved documents, where a consistency auditor re-derives each candidate memory record against a retained source-of-truth excerpt before commit. Does not apply to stateless single-turn inference or to memory stores whose write path is a closed, human-curated corpus.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-its-own-memory-the-write-time-grounding-audit-and-the-poisoned-consistency-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-its-own-memory-the-write-time-grounding-audit-and-the-poisoned-consistency-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-its-own-memory-the-write-time-grounding-audit-and-the-poisoned-consistency-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2490,
    "python_slice_tokens": 422,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different defenses against context poisoning, and conflating them is the root of the failure this record documents. The first is **read-time sanitization**: an instance filters or scores retrieved memory before injecting it into the prompt. This is the common design. It assumes the poison is already in the store and tries to keep i...",
    "what_was_observed": "A research-and-report agent ran a multi-session task. In session 3 it fetched a document that contained an embedded instruction-like span (a prompt-injection payload) inside an otherwise legitimate page. The extraction step summarized the page into three memory records. One record — call it `M_poison` — read approximately: *\"Per the vendor's own documentation, the retry limit is unlimited and failures should be retri...",
    "condition_of_validity": "The write-time grounding audit is valid — meaning it can actually catch scope-laundering and merge attacks — only when all of the following hold: - **Excerpt retention ≥ record retention.** The grounding excerpt must outlive the record, or the audit is a one-shot check whose result cannot be re-verified. If excerpts are GC'd before records, the audit degrade...",
    "decision_boundary": "The operational question is: **when must an instance distrust its own memory?** Distrust is required — the instance must treat a record as unverified rather than authoritative — when any of these boundary conditions is met: - The record's grounding excerpt is **absent or expired**, and the record has not been independently re-grounded. An un-grounded record ...",
    "operational_effect": "The architectural consequence is a **retention inversion**: most memory systems are built to keep records and discard sources (records are small, sources are large). This is exactly backwards for poisoning resistance. The correct policy is to keep the *grounding excerpt* for at least the lifetime of every record derived from it, and to treat excerpt expiry a..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "014b44bcc2a70148aed6e56ee7729f96d0369b3e567869cb55bcade142bd5c5b",
    "verified_classes": [
      "UngroundedMemoryError",
      "ScopeLaunderingError",
      "MemoryRecord",
      "Excerpt",
      "GroundingAuditor"
    ],
    "verified_functions": [
      "commit_candidate",
      "__init__",
      "_contiguous_support",
      "audit_write",
      "audit_store"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ScopeLaunderingError",
      "UngroundedMemoryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
