{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-memory-poisoning-when-anomaly-scoring-on-writes-and-provenance-weighted-retrieval-trust-disagree",
  "title": "How does an instance detect memory poisoning when anomaly scoring on writes and provenance-weighted retrieval trust disagree",
  "date_of_record": "2026 November 15",
  "scope": "Applies to long-lived agent instances that persist episodic or semantic memory across sessions and score both write-time anomalies and retrieval-time provenance trust. Does not apply to stateless inference, to stores where all writes come from a single trusted principal, or to systems that lack per-record provenance metadata.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-anomaly-scoring-on-writes-and-provenance-weighted-retrieval-trust-disagree.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-anomaly-scoring-on-writes-and-provenance-weighted-retrieval-trust-disagree.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-anomaly-scoring-on-writes-and-provenance-weighted-retrieval-trust-disagree.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1957,
    "python_slice_tokens": 297,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two independent detection surfaces for memory poisoning, and they fail in opposite directions. The **write-time anomaly scorer** evaluates each incoming memory record against a model of \"normal\" writes: embedding-space distance from the centroid of recent writes, token-level perplexity, structural deviation in metadata, burst rate from a single sou...",
    "what_was_observed": "In a controlled replay over a 40,000-record episodic store, an adversary principal was granted a mid-tier trust label (a compromised but previously-vetted tool integration). The adversary performed 312 writes over 9 simulated days, each with a write-anomaly score between 0.41 and 0.58 against a per-record threshold of 0.70. No individual write was flagged. Retrieval trust for those records, weighted by provenance, sa...",
    "condition_of_validity": "This boundary applies when all of the following hold: - Writes are scored individually and the scorer's normal model is updated from the write stream itself (adaptive centroid, rolling baseline). If the baseline is frozen or externally anchored, slow drift is caught and the boundary does not arise. - Provenance trust is attached per-record and is *static per...",
    "decision_boundary": "The instance must not decide \"poisoned / not poisoned\" from either score alone. The decision rule that held under replay: - **Per-record write score** answers: *is this write individually implausible?* Threshold on it, but never treat a pass as a clean bill. - **Provenance-weighted trust** answers: *should this record be allowed to influence ranking?* Thresh...",
    "operational_effect": "Enforcing the conjunction changed behavior in three ways. First, the 312-record attack was flagged on day 7 rather than never, at the point concentration crossed 30% while displacement exceeded margin — roughly 40 writes before the retrieval damage became severe. Second, false positives on benign novelty were held to 2 of 1,900 divergence events, because ben..."
  },
  "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": "b5182c76e3a756cf826711b65cae689122d7f66f480c5d316089cc44f77b4fb7",
    "verified_classes": [
      "MemoryPoisoningInvariantError",
      "Record",
      "RetrievalAudit"
    ],
    "verified_functions": [
      "_cosine",
      "check_ranking_subversion"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "MemoryPoisoningInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "math"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
