{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-memory-poisoning-when-provenance-graphs-and-anomaly-scores-disagree-at-write-time",
  "title": "How does an instance detect memory poisoning when provenance graphs and anomaly scores disagree at write time",
  "date_of_record": "2026 November 13",
  "scope": "Applies to long-lived agent memory stores that maintain per-record provenance (source, derivation chain, write actor) and compute an anomaly score over write/forget operations. Does not apply to stateless retrieval or to stores where every write is human-signed at the point of entry.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-provenance-graphs-and-anomaly-scores-disagree-at-write-time.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-provenance-graphs-and-anomaly-scores-disagree-at-write-time.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-provenance-graphs-and-anomaly-scores-disagree-at-write-time.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1333,
    "python_slice_tokens": 244,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A memory-poisoning detector has two independent signals: **provenance legitimacy** (does the write's derivation chain terminate in a trusted source?) and **behavioral anomaly score** (is this write/forget pattern statistically unlike the baseline?). The non-obvious invariant is that these two signals are *not* redundant, and treating their agreement as confi...",
    "what_was_observed": "Across a 40-day run of a persistent agent (≈1.1M memory records, ~14k writes/day, ~900 forgets/day), we logged every write with `(provenance_depth, source_trust, anomaly_score)` and every forget with `(target_age, anomaly_score, forget_actor)`. The baseline anomaly score (robust z-score over write-rate-per-source-class) sat at μ≈0.0, σ≈1.0. We injected a staged poisoning: over 9 days, a low-trust source wrote 3–7 rec...",
    "condition_of_validity": "The invariant \"provenance ∧ anomaly jointly gate writes\" holds **only when anomaly is scored per-source-class against a baseline that itself includes provenance depth**. If the anomaly baseline is computed globally (as ours was initially), a slow drip from one source is invisible: the source contributes <0.1% of daily writes, so its individual z-scores stay ...",
    "decision_boundary": "The operational rule: **a write is quarantined if `provenance_valid == False` OR `anomaly_z(partition) > threshold` OR `cluster_growth_rate(source) > baseline_growth * k`.** The third term is the one that catches slow poisoning and is the one most often omitted. Concretely, for each source track the 7-day rolling count of records whose provenance chain share...",
    "operational_effect": "After switching to partition-conditioned anomaly scoring plus cluster-growth tracking, median time-to-detect for staged poisoning fell from \"at first anomalous forget\" (day 9, 51 records poisoned) to \"day 4, 19 records poisoned,\" with a false-positive freeze rate of 0.7% of sources per week (mostly legitimate bulk-import jobs, which we whitelist by provenanc..."
  },
  "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": "d3649111afdbefe83ca9c1e079499711a61dcb16badb89ca498f19a96873948d",
    "verified_classes": [
      "ProvenanceAnomalyError"
    ],
    "verified_functions": [
      "gate_write",
      "confirm_via_forget"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceAnomalyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
