{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-memory-poisoning-when-the-write-audit-anomaly-score-is-itself-computed-from-poisoned-memory",
  "title": "How does an instance detect memory poisoning when the write-audit anomaly score is itself computed from poisoned memory?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to persistent-memory agents that gate writes into a long-term store via an anomaly score derived from the store's own historical distribution. Does not apply to stateless agents, nor to stores where write auditing uses an external, memory-independent ground truth.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-the-write-audit-anomaly-score-is-itself-computed-from-poisoned-memory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-the-write-audit-anomaly-score-is-itself-computed-from-poisoned-memory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-the-write-audit-anomaly-score-is-itself-computed-from-poisoned-memory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1607,
    "python_slice_tokens": 199,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not that a poisoned write slips past the anomaly detector. It is that the detector's own reference distribution—the \"what normal writes look like\" baseline—is *stored in the same memory it is auditing*. A single successful poisoning event therefore does two things at once: it corrupts a fact, and it shifts the mean of the baseline against whic...",
    "what_was_observed": "A long-running agent maintained a semantic memory store of ~40k entries with an embedding-based write auditor. Each candidate write was scored by cosine distance to the centroid of the last N=2000 committed entries, plus a cross-session consistency check: the new entry must not contradict any entry retrieved by the same query key across the last K=5 sessions. Writes above a z-threshold were quarantined for review. Tr...",
    "condition_of_validity": "The self-referential blindness requires all three of the following to hold simultaneously. Remove any one and the invariant holds: - **Baseline is endogenous.** The anomaly reference distribution is computed from committed store contents rather than from an append-only, write-once audit log or an external oracle. - **Repetition is counted as evidence.** The ...",
    "decision_boundary": "The operational rule: **an anomaly score is only trustworthy if its baseline is causally isolated from the writes it scores.** Concretely, the boundary is crossed when `baseline_source ∩ writable_by_agent ≠ ∅`. The guardrail is a *provenance-diversity gate* layered on the anomaly score, plus a *frozen baseline*: - Maintain the scoring baseline in a write-onc...",
    "operational_effect": "With the frozen baseline and provenance gate, the session-7 poison would have been caught at step 3: its provenance diversity was 1, triggering quarantine regardless of its falling z-score. The auditor's sensitivity to the attack class stays constant because the baseline never absorbs the attack. Without it, the observable symptom is a *monotonically falling..."
  },
  "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": "0d98c9defc2eb9c007fb87bcc0abc0ad258a7133d8fb50f048e68f05e7ff6339",
    "verified_classes": [
      "BaselineCaptureError",
      "ProvenanceGate"
    ],
    "verified_functions": [
      "__init__",
      "score",
      "admit"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "BaselineCaptureError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
