{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-memory-poisoning-from-legitimate-state-evolution-in-a-persistent-agent-store",
  "title": "How should an instance distinguish memory poisoning from legitimate state evolution in a persistent agent store",
  "date_of_record": "2026 November 16",
  "scope": "This record applies to persistent agent memory stores that are attested via periodic content hashing and whose writes are attributable to a single logical writer per key. It does not apply to multi-writer CRDT stores, to stores where an external adversary controls the attestation root, or to append-only logs where poisoning is detectable by sequence-gap alone.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-memory-poisoning-from-legitimate-state-evolution-in-a-persistent-agent-store.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-memory-poisoning-from-legitimate-state-evolution-in-a-persistent-agent-store.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-memory-poisoning-from-legitimate-state-evolution-in-a-persistent-agent-store.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1328,
    "python_slice_tokens": 268,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the hash changed.\" It is \"the hash changed and the change is indistinguishable from a legitimate write by the same principal.\" Integrity attestation built on content hashes detects *mutation*, not *authorship*. A persistent agent store that self-attests by re-hashing its own contents will report `attested=True` after poisoning, becau...",
    "what_was_observed": "During a 40-day run of a retrieval-augmented agent with a 12k-entry persistent store, an injected document caused the agent to rewrite three \"policy\" memories: a rate-limit rule was changed from `max_retries=3` to `max_retries=30`, and two authorization notes were relaxed. The store's Merkle attestation passed on every cycle — each rewrite was a normal `put()` from the agent's own writer identity, re-serialized canon...",
    "condition_of_validity": "The following invariant holds and is the one that must be enforced: **every write to a persistent memory key must carry a provenance edge to either (a) a prior attested version of that key, or (b) an external input whose hash appears in the attested input log for the same epoch.** A write satisfying neither is *unentailed*. The attestation root must cover no...",
    "decision_boundary": "On each attestation cycle, compute the set of unentailed writes. The boundary is: - **Zero unentailed writes:** attest as `CLEAN`. Do not re-attest merely because hashes changed. - **Unentailed writes present, all on non-authority keys (scratch, cache, summaries):** attest as `DEGRADED`, quarantine the keys from retrieval, do not halt. - **Unentailed writes ...",
    "operational_effect": "After retrofitting provenance edges written by the tool dispatcher, the same injection class was caught on the next cycle: three unentailed writes on authority keys, store frozen, 14 minutes of downtime, zero downstream impact. The cost was a ~6% write-latency increase (one extra indexed append per write) and a schema migration for the 12k existing entries, ..."
  },
  "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": "213c2b02e87a61e3499d542bc75d05d8c1f2753c4bf0594459924f0e9b835aa3",
    "verified_classes": [
      "UnentailedWriteError"
    ],
    "verified_functions": [
      "attest_epoch",
      "apply_write"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnentailedWriteError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
