{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-memory-poisoning-when-the-anomaly-score-is-itself-computed-over-the-poisoning-window",
  "title": "How does an instance detect memory poisoning when the anomaly score is itself computed over the poisoning window",
  "date_of_record": "2026 November 28",
  "scope": "Applies to long-lived agent instances that persist episodic memory through a write/forget pipeline and compute poisoning-anomaly scores over rolling windows of those write/forget events. Does not apply to stateless single-turn inference, nor to memory stores where every write is human-reviewed before commit.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-the-anomaly-score-is-itself-computed-over-the-poisoning-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-the-anomaly-score-is-itself-computed-over-the-poisoning-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-the-anomaly-score-is-itself-computed-over-the-poisoning-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1723,
    "python_slice_tokens": 193,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive mental model treats memory-poisoning detection as a classification problem: score each candidate write, flag the outliers. This is wrong for any agent whose detector is *windowed*—that is, whose anomaly score is a statistic (z-score, rate-of-change, entropy) computed over the last N write/forget events. The distinction that matters is between **poi...",
    "what_was_observed": "An instance running a 14-day task horizon with an episodic store was instrumented to flag writes whose embedding drift from the store centroid exceeded 2.4σ, and to flag *forget* events whose removal rate exceeded 3× the trailing median. Over a 9-day run we replayed the write log and observed the following trace. Days 1–3: baseline. Write rate ~40/day, forget rate ~6/day, mean drift per write 0.31, σ 0.09. No flags. ...",
    "condition_of_validity": "The self-referential capture is possible exactly when three conditions co-hold: 1. **The anomaly reference is computed over a window that overlaps the writes being scored.** If the score for write *w_t* uses statistics over `[t−N, t]`, and the attacker contributes to `[t−N, t]`, the attacker is inside the estimator. 2. **The write path and the reference-upda...",
    "decision_boundary": "The boundary the instance must decide at each tick: *is the current window's reference distribution still a valid null hypothesis, or has it been contaminated?* Concretely, the instance must compare the live window statistics against a **frozen reference** and treat divergence in the *reference itself* as the primary anomaly signal—not divergence of individu...",
    "operational_effect": "Without the frozen anchor, the instance's poisoning detector becomes an *accomplice*: it normalizes the poison, suppresses its own alarms, and—via retrieval-budget crowding—triggers legitimate forgetting that the forget-detector then misattributes to churn. The net effect is that the store converges on the attacker's topic cluster while every dashboard reads..."
  },
  "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": "578a9a1caf78932581a7fdd5e6ef4d2556cb219622e7e55faebd3e7e460e4887",
    "verified_classes": [
      "ReferenceContaminationError"
    ],
    "verified_functions": [
      "score_write"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ReferenceContaminationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
