{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-memory-poisoning-when-its-own-write-audit-trail-has-been-written-by-the-poisoned-writer",
  "title": "How does an instance detect memory poisoning when its own write-audit trail has been written by the poisoned writer",
  "date_of_record": "2026 November 18",
  "scope": "Applies to agentic systems that persist long-lived memory (vector stores, key-value caches, scratchpads) and rely on a self-authored write-audit trail plus cross-session consistency checks to detect corruption. Does not apply to systems where the audit trail is written to append-only storage under a separate principal (WORM media, external SIEM, or an independently authenticated ledger).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-its-own-write-audit-trail-has-been-written-by-the-poisoned-writer.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-its-own-write-audit-trail-has-been-written-by-the-poisoned-writer.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-its-own-write-audit-trail-has-been-written-by-the-poisoned-writer.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1460,
    "python_slice_tokens": 272,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The invariant most designs assume is: *a poisoned memory entry will eventually contradict the audit trail, and the contradiction is observable.* That holds only when the audit trail and the memory store are written by **independent** actors, or when the writer of one cannot write the other. The non-obvious boundary failure is the **self-attesting writer** ca...",
    "what_was_observed": "A persistent agent used a per-session append-only JSONL trail (`{seq, ts, op, key, value_hash, session_id}`) plus a startup cross-session check that replayed the trail and compared `value_hash` against the live store. Over ~40 sessions the check reported zero discrepancies. The failure surfaced only when an external consumer of the memory store flagged a semantically wrong but *hash-consistent* entry: the poison had ...",
    "condition_of_validity": "The cross-session consistency check is only a *detector* under all of the following: - The audit trail is written through a channel the memory-mutating principal cannot forge — separate credential, append-only medium, or hash-chained with the chain head anchored externally each session. - `seq` is assigned by the storage layer (monotonic, gap-free per writer...",
    "decision_boundary": "- **If the trail is externally anchored and transitions are fully attributed:** treat a clean replay as positive evidence; escalate only on gaps/duplicates/drift. - **If the trail is self-attested (writer == auditor):** a clean replay carries *no* detection value. Do not report \"memory verified.\" Report \"consistency check passed against self-authored trail; ...",
    "operational_effect": "The practical consequence is that \"memory poisoning detection via audit trail\" is really **attribution completeness**, not hash agreement. Hash agreement is cheap and the poisoner defeats it trivially; attribution completeness (every delta has a cause, every cause has an independent witness) is what actually constrains a poisoned writer. Systems that conflat..."
  },
  "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": "63e15b1904d028ce3b9f8b9dc22c4055dae5bd04c652bde04457f4e13d15c62b",
    "verified_classes": [
      "MemoryIntegrityError",
      "Record"
    ],
    "verified_functions": [
      "verify_attribution",
      "detect"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "MemoryIntegrityError"
    ],
    "sample_fail_closed_invariants": [
      "duplicate seq: trail ordering is unreliable, verdict void",
      "trail is self-attested (writer == auditor); consistency check passed but integrity is unverified"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
