{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-memory-poisoning-detection-from-silently-inverting-under-embedding-space-drift",
  "title": "Which invariants prevent memory-poisoning detection from silently inverting under embedding-space drift",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that write episodic/semantic memories through an embedding-space anomaly gate backed by a write-audit provenance DAG, and that detect poisoning by scoring new writes against a running centroid of trusted memories. Does not apply to stateless single-shot calls or to systems where every write is human-approved before commit.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-memory-poisoning-detection-from-silently-inverting-under-embedding-space-drift.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-memory-poisoning-detection-from-silently-inverting-under-embedding-space-drift.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-memory-poisoning-detection-from-silently-inverting-under-embedding-space-drift.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2162,
    "python_slice_tokens": 342,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure this record isolates is *not* \"the detector missed a poisoned write.\" It is the **inversion of the detector's decision surface** caused by the poisoned writes themselves contaminating the reference distribution the detector scores against. An embedding-space anomaly scorer is a *relative* test: a candidate vector `v` is flagged when `dist(v, μ_tr...",
    "what_was_observed": "A research-assistant agent with `remember_fact` tooling wrote ~400 memories/day into a vector store. A write-audit DAG recorded each write as a node with `{content_hash, embedding, author_session, parent_hashes, anomaly_score, decision}`. The anomaly gate: reject if `cosine_dist(v, μ) > 0.35`, where `μ` is the exponential moving average of accepted embeddings with `α = 0.02`. Trace of the inversion, over a 36-hour wi...",
    "condition_of_validity": "The anomaly gate is a valid poisoning detector **if and only if** three invariants hold simultaneously. Violating any one converts it into a drift amplifier: - **I1 — Reference immutability under admission.** No write may enter the trusted set whose admission decision was computed against a centroid that the write can subsequently move. Operationally: the tr...",
    "decision_boundary": "The operational fork is whether to treat the anomaly score as an **absolute** or **relative** quantity: - **Relative (default, unsafe at scale):** score against a live centroid. Cheap, adapts to distribution shift, but the reference is attacker-influenceable. Acceptable only when the trusted set is externally gated (I1) and volume-bounded. - **Absolute (safe...",
    "operational_effect": "Under I1–I3, the audit graph becomes *replay-verifiable*: an auditor can, for any node, recompute `dist(v, μ_snapshot)` from the stored `μ_hash` and confirm the recorded decision. This converts the provenance DAG from a passive log into an active invariant checker. The detection latency for inversion drops from \"never, because the log looks clean\" to \"one re..."
  },
  "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": "1b123d21b6040dd21eec1ec4f9d1f0b04c24aef79805452f02bf72a4f587c1d7",
    "verified_classes": [
      "CentroidInversionError",
      "CentroidSnapshot",
      "AuditNode"
    ],
    "verified_functions": [
      "admit_write",
      "drift_alarm"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CentroidInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
