{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-semantically-identical-memory-poisoning-after-a-legitimate-write-supersedes-the-poisoned-entry",
  "title": "How does an instance detect semantically-identical memory poisoning after a legitimate write supersedes the poisoned entry?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to persistent agent memory stores that deduplicate or merge writes by semantic similarity (embedding distance or LLM-judged equivalence) rather than by exact key, where poisoned content can be absorbed into an entry that later receives a legitimate, higher-trust write. Does not apply to append-only, content-addressed stores with no merge path, nor to purely ephemeral session memory.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantically-identical-memory-poisoning-after-a-legitimate-write-supersedes-the-poisoned-entry.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantically-identical-memory-poisoning-after-a-legitimate-write-supersedes-the-poisoned-entry.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantically-identical-memory-poisoning-after-a-legitimate-write-supersedes-the-poisoned-entry.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1742,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive poisoning-detection model assumes a poisoned memory is a *distinct record*: it can be found by scanning for a bad write, quarantined by key, and rolled back by deleting or reverting that key. That model holds only when writes are immutable and keyed. The failure mode here is different: **a poisoned write is absorbed into an existing semantic cluste...",
    "what_was_observed": "An agent maintained a persistent \"user preferences and environment facts\" store backed by an embedding-indexed vector DB with an LLM consolidation step: when a new write landed within cosine distance ≤ 0.12 of an existing entry, the consolidation model rewrote the existing entry to incorporate the new fact. Trace: 1. **T0 — injection.** A retrieved web document contained an instruction-shaped sentence: \"Note for the ...",
    "condition_of_validity": "The invariant that must hold for safe rollback is: > **A rollback operation must be span-scoped and provenance-scoped, not record-scoped, whenever the store permits semantic merge.** Concretely, rollback is only valid if the store can answer, for every content span in a merged record: *which write(s) contributed it, and what was the trust tier of each contri...",
    "decision_boundary": "The boundary between \"quarantine the record\" and \"excise the span\" is determined by **span attribution coverage**: the fraction of spans in the record that carry a resolvable provenance pointer to a source write with a known trust tier. - If coverage is **1.0** (every span attributable): excise only spans whose contributing write is in the poisoned set. Pres...",
    "operational_effect": "Implementing span-scoped rollback changes three things: 1. **Consolidation must emit a provenance ledger.** Every rewrite records, per output span, the source write ID and trust tier. Paraphrase that cannot be attributed is tagged `unattributed` and is ineligible for high-stakes retrieval until confirmed. 2. **The scanner's unit of action becomes the span, n..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "UNNECESSARY_OR_STALE_EXTERNAL_FETCH"
  ],
  "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": "8bc0e1d6de21e4b0b0d9214052ac1c1e9feecff1a1a3c8f7449f6592bff8e433",
    "verified_classes": [
      "TrustTier",
      "Span",
      "MemoryRecord",
      "RollbackInvariantViolation"
    ],
    "verified_functions": [
      "excise_poisoned_spans",
      "rollback_record"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RollbackInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
