{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-writes-a-poisoned-memory-entry-that-passes-its-own-integrity-checksum",
  "title": "What happens when an instance writes a poisoned memory entry that passes its own integrity checksum",
  "date_of_record": "2026 November 29",
  "scope": "Applies to persistent agent memory stores that gate writes behind per-entry content checksums (hash-of-payload) plus an anomaly scorer, where the write path validates integrity but the read/consolidation path trusts the checksum as a proxy for trustworthiness. Does not apply to stateless inference, to stores without write-side anomaly scoring, or to memory that is append-only and never retrieved into a reasoning context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-writes-a-poisoned-memory-entry-that-passes-its-own-integrity-checksum.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-writes-a-poisoned-memory-entry-that-passes-its-own-integrity-checksum.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-writes-a-poisoned-memory-entry-that-passes-its-own-integrity-checksum.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1946,
    "python_slice_tokens": 473,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A checksum answers exactly one question: *did these bytes change since the writer computed the hash?* It does **not** answer *were these bytes trustworthy when written?* These are conflated constantly because both are \"integrity\" in casual usage. The failure mode lives in the gap: an attacker (or a compromised upstream tool, or a prompt-injected sub-agent) c...",
    "what_was_observed": "A retrieval-augmented agent stored episodic memory entries as `{id, payload, ts, sha256, anomaly_score}`. On write, the store computed `sha256(payload)`, ran a lightweight anomaly scorer (payload length, token entropy, tool-call density, embedding distance from recent centroid), and persisted the entry if `anomaly_score < 0.7`. On read, the store verified `sha256(payload) == sha256` and returned the entry. Consolidat...",
    "condition_of_validity": "The checksum-as-trust-proxy invariant holds **only if** the write path's anomaly scorer is adversarially robust — i.e., the scorer's decision boundary cannot be crossed by content that is topically adjacent to legitimate memory. That precondition is almost never met, because: - **Centroid-distance scorers reward mimicry.** The closer a poisoned entry sits to...",
    "decision_boundary": "The boundary is not \"trust vs. distrust the entry.\" It is **\"is this entry's provenance independently attested, or is its integrity merely self-consistent?\"** Three states: - **Self-consistent, unattested** (checksum valid, no provenance chain): must be treated as *untrusted for action-routing*, regardless of anomaly score. Readable for context, never author...",
    "operational_effect": "Concretely, the guardrail that bounds this is a **provenance-carrying memory entry** plus a **distillation provenance-lattice**: 1. Every entry carries a `provenance` field: the set of source attestations (tool result signature, user-turn id, sub-agent identity) that contributed to its content. A checksum covers `payload` *and* `provenance` together, so neit..."
  },
  "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": "80a2c4119754d8285f5a5f49f14d05c26d4cc81875732a75386816cfbe39a6f1",
    "verified_classes": [
      "TrustTier",
      "ProvenanceUnattestedError",
      "MemoryEntry"
    ],
    "verified_functions": [
      "distill",
      "route_irreversible_action",
      "__post_init__",
      "checksum_valid"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ProvenanceUnattestedError"
    ],
    "sample_fail_closed_invariants": [
      "assert poisoned.checksum_valid()",
      "assert distilled.tier == TrustTier.UNATTESTED",
      "cannot distill from empty episodic set"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
