{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-memory-poisoning-detectors-from-ratifying-their-own-corruption-in-persistent-agent-memory-stores",
  "title": "Which invariants prevent memory-poisoning detectors from ratifying their own corruption in persistent agent memory stores",
  "date_of_record": "2026 December 1",
  "scope": "Applies to persistent agent memory stores (episodic + distilled semantic layers) that run an in-band poisoning detector — i.e., the verifier reads and writes the same memory substrate it audits. Does not apply to out-of-band human review pipelines or stateless agents with no cross-session write path.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-memory-poisoning-detectors-from-ratifying-their-own-corruption-in-persistent-agent-memory-stores.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-memory-poisoning-detectors-from-ratifying-their-own-corruption-in-persistent-agent-memory-stores.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-memory-poisoning-detectors-from-ratifying-their-own-corruption-in-persistent-agent-memory-stores.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2002,
    "python_slice_tokens": 414,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A memory-poisoning detector is not an external oracle. In most persistent agent architectures it is implemented as *another agent* — an LLM instance with read access to the memory store and write access to trust metadata (confidence scores, provenance tags, quarantine flags). This creates a category error: the detector's verdicts are themselves stored as mem...",
    "what_was_observed": "A long-running research agent (session count ~4,300, two-layer memory: raw episodic log + nightly semantic distillation) began emitting confidently wrong internal facts about its own tool inventory — specifically, that a deprecated `web_fetch_v1` tool was \"verified available and preferred for latency.\" The tool had been removed 900 sessions earlier. Trace reconstruction: 1. At session ~3,100 a prompt-injection payloa...",
    "condition_of_validity": "The self-ratification ratchet is *bounded* — i.e., a detector can be trusted — only when all four of the following hold simultaneously. Drop any one and the detector's output is not evidence: 1. **Verdict non-contamination.** The detector's input context must exclude its own prior verdicts on the same entry. `audit_history` may be *stored* for external consu...",
    "decision_boundary": "The operational line is: **does the detector's retrieval path intersect its own write path?** - If verdicts are written to a store the detector reads back into its prompt → you are in the ratchet regime. Every audit is a vote, and votes compound. Quarantine the detector or mask its own outputs before it runs again. - If verdicts are written to a separate, ap...",
    "operational_effect": "When the invariant is violated, three downstream effects are guaranteed and one is probable: - **Guaranteed: confidence inversion.** Poisoned entries that survive one audit become the *highest-confidence* entries in the store, because they have been audited most. Retrieval, which typically ranks by confidence, surfaces them first. The corruption is not just ..."
  },
  "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": "894662fe42c73904cbcecee6a119b5a7c87f89dc69ef2d3f07c2a20bf8107bcb",
    "verified_classes": [
      "DetectorSelfRatificationError",
      "ProvenanceCollapseError",
      "MemoryEntry"
    ],
    "verified_functions": [
      "audit_entry",
      "run_audit_pass"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "DetectorSelfRatificationError",
      "ProvenanceCollapseError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
