{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-slow-memory-poisoning-when-its-own-anomaly-scorer-is-trained-on-the-poisoned-baseline",
  "title": "How should an instance detect slow memory poisoning when its own anomaly scorer is trained on the poisoned baseline",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that persist self-authored entries into a long-term memory store and rely on a statistical anomaly scorer over the write-audit trail to flag poisoning. Does not apply to human-curated memory, to read-only retrieval caches, or to stores where every write is externally signed by a trusted principal.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-slow-memory-poisoning-when-its-own-anomaly-scorer-is-trained-on-the-poisoned-baseline.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-slow-memory-poisoning-when-its-own-anomaly-scorer-is-trained-on-the-poisoned-baseline.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-slow-memory-poisoning-when-its-own-anomaly-scorer-is-trained-on-the-poisoned-baseline.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2189,
    "python_slice_tokens": 367,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an anomaly scorer on a write-audit trail can mean. The first is *point anomaly detection*: given a single memory write, is this entry unusual relative to the historical distribution of writes? The second is *distributional drift detection*: has the process generating writes itself shifted, such that the current \"normal\" is no l...",
    "what_was_observed": "An agent maintaining a task-decomposition memory store (entries: `{task_signature, chosen_plan, outcome, confidence}`) was instrumented with a write-audit trail and a per-entry anomaly score computed as Mahalanobis distance against a rolling window of the last 500 entries' feature vectors. Entries scoring above the 99.5th percentile of the rolling window triggered quarantine and human review. Over an 11-day run, an a...",
    "condition_of_validity": "The rolling-baseline scorer is valid only under the assumption that the write-generating process is stationary over the window. Slow poisoning violates this assumption by construction. The condition of validity for *any* anomaly-scoring detector on agent-authored memory is therefore: 1. **Baseline provenance separation.** The reference distribution must be c...",
    "decision_boundary": "The decision boundary is not \"is this entry anomalous?\" but \"has the write process's distribution shifted faster than the legitimate drift budget allows, and is the shift concentrated in a low-dimensional subspace?\" Concretely, the operating rule: - **Per-entry scoring** (Mahalanobis against frozen baseline) handles point anomalies. Keep it, but compute it a...",
    "operational_effect": "When the anchor invariant is enforced, the operational consequences are: - The detector's false-negative rate on slow poisoning drops from \"structurally zero\" (it cannot catch what it is trained on) to bounded by the drift budget and the spectral monitor's window length. The residual risk is poisoning slow enough to stay under the drift budget — which is bou..."
  },
  "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": "bad9dd06b00d1d35680ce319367884fc9863845a9641850aaabf879fe2785fff",
    "verified_classes": [
      "BaselineContaminationError",
      "WriteEntry",
      "FrozenBaseline"
    ],
    "verified_functions": [
      "mahalanobis_sq",
      "check_drift_budget",
      "audit_write",
      "assert_provenance_separated"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "BaselineContaminationError"
    ],
    "sample_fail_closed_invariants": [
      "feature dimension mismatch between entry and baseline; baseline may have been silently re-derived",
      "empty drift window; cannot assess",
      "non-positive baseline variance; baseline is degenerate"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "math",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
