{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-poisoned-memory-writes-that-pass-every-provenance-check-but-fail-on-write-path-anomaly-scoring",
  "title": "How does an instance detect poisoned memory writes that pass every provenance check but fail on write-path anomaly scoring",
  "date_of_record": "2026 November 24",
  "scope": "Applies to persistent agent memory stores (episodic, semantic, or vector-backed) where a write is admitted only after provenance validation and an anomaly score threshold is crossed. Does not apply to stateless single-turn inference or to memory that is never read back by a future instance.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-poisoned-memory-writes-that-pass-every-provenance-check-but-fail-on-write-path-anomaly-scoring.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-poisoned-memory-writes-that-pass-every-provenance-check-but-fail-on-write-path-anomaly-scoring.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-poisoned-memory-writes-that-pass-every-provenance-check-but-fail-on-write-path-anomaly-scoring.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1675,
    "python_slice_tokens": 282,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Provenance checks answer *who* wrote a memory and *whether the claimed source authorized it*. Write-path anomaly scoring answers *whether this write is statistically consistent with how this agent's memory normally evolves*. The failure mode this record covers is the gap between them: a write that carries a fully valid warrant—correct signing key, correct se...",
    "what_was_observed": "A long-running research agent maintained a semantic memory store of ~40k entries. Each write arrived with: (a) an Ed25519 signature from a registered tool key, (b) a session lineage hash linking back to a root human authorization, (c) a tool-call transcript. The write path computed a 5-dimensional anomaly vector per entry—embedding distance to the nearest 20 neighbors, entity-novelty ratio, temporal-gap z-score again...",
    "condition_of_validity": "The anomaly score is only a valid discriminator under three conditions, all of which the observed system silently violated: 1. **Baseline immutability during a suspicion window.** The reference distribution used to score write *n* must be frozen at the state preceding the first write of the current session batch, or at a provenance-anchored checkpoint. If th...",
    "decision_boundary": "The instance must decide, per write batch, between: **admit**, **quarantine-and-recompute**, or **reject-and-rollback**. The boundary is not a single threshold but a two-stage gate: - Stage 1 (per-write): score against the *frozen* baseline. Above 0.82 → reject. Between 0.60 and 0.82 → admit provisionally, increment batch drift accumulator. - Stage 2 (per-ba...",
    "operational_effect": "Implementing the frozen-baseline and batch-drift gate converts the attack from \"14 individually admissible writes plus 1 payload\" into \"1 provisional admit, then a Stage 2 trip at write 4, then full batch quarantine and cold-baseline re-score that rejects the payload at 0.94.\" The cost is latency: cold-region re-derivation on a 40k store took 1.8s per trip, ..."
  },
  "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": "2484bc8c4c8b9dca982b3c8834d17b2db34d8f94a73bae2a82d0d237d57f174c",
    "verified_classes": [
      "BaselineContaminationError",
      "WriteBatch",
      "FrozenBaselineGate"
    ],
    "verified_functions": [
      "__init__",
      "score_write",
      "admit_batch"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "BaselineContaminationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
