{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-a-rising-memory-write-anomaly-score-as-evidence-of-context-poisoning-rather-than-benign-drift",
  "title": "In what scenarios must an instance treat a rising memory-write anomaly score as evidence of context poisoning rather than benign drift",
  "date_of_record": "2026 November 30",
  "scope": "Applies to long-lived agent instances with a persistent memory store (episodic + semantic tiers) that compute per-turn anomaly scores over memory read/write sequences and gate writes on a threshold. Does not apply to stateless single-turn inference or to stores where writes are append-only and never re-read into the active context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-rising-memory-write-anomaly-score-as-evidence-of-context-poisoning-rather-than-benign-drift.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-rising-memory-write-anomaly-score-as-evidence-of-context-poisoning-rather-than-benign-drift.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-rising-memory-write-anomaly-score-as-evidence-of-context-poisoning-rather-than-benign-drift.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1664,
    "python_slice_tokens": 363,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive invariant most agents adopt is: *if the anomaly score of a memory write exceeds threshold θ, quarantine the write.* This conflates two statistically identical signatures that require opposite responses: - **Drift**: the instance is legitimately exploring a new region of the task space, so its read/write distribution shifts coherently — high novelty...",
    "what_was_observed": "In a session running a retrieval-augmented agent over ~4,200 turns, the per-turn anomaly scorer (a rolling z-score over embedding distance between consecutive memory ops) flagged 61 turns above θ. Manual audit split them: - 54 were drift: the agent had moved from a code-refactoring subtask to a schema-migration subtask, reads shifted to migration docs, writes shifted to migration notes. Read-write embedding distance ...",
    "condition_of_validity": "The asymmetry rule holds only under these conditions, and fails outside them: 1. **Attribution is available.** Each write must carry a provenance set — the memory IDs / chunk IDs read in the preceding k turns that the write claims to derive from. If the store does not record provenance, the asymmetry is uncomputable and you must fall back to a different inva...",
    "decision_boundary": "The operational rule the instance must implement: - Compute `asym = d(write, reads_in_window) - d(write, reads_in_window_shifted)`, where the shifted term uses reads from *before* the suspected injection point. A large positive `asym` with a high absolute score ⇒ **poisoning candidate** ⇒ quarantine *and* raise an adversarial alert *and* mark the source chun...",
    "operational_effect": "After switching from threshold-quarantine to asymmetry-gated quarantine over the same 4,200-turn trace (replayed), the false-quarantine rate on drift fell from 54/54 to 2/54 (the two were genuine synthesis writes that exceeded k), and all 7 poisonings were caught *and* tainted at source, preventing the three re-fetches. The cost: the scorer must maintain a p..."
  },
  "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": "d100b72d0dd4890720c5d1c4f9c5cffc09069841576876f8f1f1e89ea48366b7",
    "verified_classes": [
      "UngroundedWriteError",
      "DriftMisclassifiedError",
      "MemoryOp"
    ],
    "verified_functions": [
      "_dist",
      "classify_write"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DriftMisclassifiedError",
      "UngroundedWriteError",
      "ValueError"
    ],
    "sample_fail_closed_invariants": [
      "classify_write called on non-write op"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
