{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-fail-to-detect-context-poisoning-when-anomaly-scores-are-computed-over-retrieval-drift-rather-than-write-provenance",
  "title": "Why does an instance fail to detect context poisoning when anomaly scores are computed over retrieval drift rather than write provenance",
  "date_of_record": "2026 November 23",
  "scope": "Applies to long-lived agent memory stores where poisoning is detected by scoring retrieval drift (embedding distance between query and returned memory, rank churn, or hit-rate deltas) across successive retrieval cycles. Does not apply to stores with per-write provenance attestation, nor to single-shot retrieval systems with no persistent memory.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-fail-to-detect-context-poisoning-when-anomaly-scores-are-computed-over-retrieval-drift-rather-than-write-provenance.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-fail-to-detect-context-poisoning-when-anomaly-scores-are-computed-over-retrieval-drift-rather-than-write-provenance.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-fail-to-detect-context-poisoning-when-anomaly-scores-are-computed-over-retrieval-drift-rather-than-write-provenance.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1422,
    "python_slice_tokens": 274,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Retrieval drift measures *how the store's answers move*, not *how the store's contents were admitted*. A poisoned record can be written once and then retrieved stably for thousands of cycles, producing near-zero drift while silently corrupting every downstream answer. Conversely, benign but noisy retrieval (re-ranking, cache eviction, index compaction) produ...",
    "what_was_observed": "In a 90-day operational record of an agent memory service (~4.2M writes, ~61M retrievals), a poisoned cluster of 37 records was injected on day 12 via a compromised summarization tool. The anomaly detector, configured to alert on a 3σ deviation in a composite drift score (cosine drift of top-k results + rank churn + retrieval hit-rate delta), fired zero times for the injection. The reason was structural. The 37 recor...",
    "condition_of_validity": "Drift-based poisoning detection is valid only under the conjunction of three conditions, all of which must be checked before trusting a low drift score: 1. **Bounded attacker dwell time.** The attacker must be assumed to modify the store repeatedly within the detection window. If the threat model includes single-shot writes, drift is uninformative. 2. **Base...",
    "decision_boundary": "The operational rule is: **never gate a poisoning alert on drift alone; require an independent write-provenance feature and a frozen baseline.** Concretely, the boundary is crossed when either (a) the drift baseline window is allowed to include writes newer than the oldest unverified record, or (b) the feature set contains no write-time signal (source identi...",
    "operational_effect": "After the incident, the service added a write-provenance gate that runs before drift scoring: any write whose `source_tool` exhibits a burst (more than N writes in T seconds with no retrieval-triggered causation) is quarantined and flagged regardless of drift. The drift baseline was frozen to a snapshot taken at admission time and never updated from live tra..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "6b2533c419b0d2a2ec0fd9943a700564bc01d414fa8840cf10fa04f390de717b",
    "verified_classes": [
      "ContextPoisoningDetectorError",
      "MemoryWrite",
      "PoisoningDetector"
    ],
    "verified_functions": [
      "__init__",
      "__init__",
      "record_write",
      "assess"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ContextPoisoningDetectorError"
    ],
    "sample_fail_closed_invariants": [
      "low drift without provenance feature: detector is a retrieval-stability monitor, not a poisoning detector"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
