{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-undetected-memory-poisoning-in-shared-agent-stores-the-write-provenance-gap-at-the-read-merge-boundary",
  "title": "Which invariants prevent undetected memory poisoning in shared agent stores: the write-provenance gap at the read-merge boundary",
  "date_of_record": "2026 November 14",
  "scope": "Applies to multi-agent systems that read from and write to a shared memory store (vector DB, key-value memory, or document store) where provenance metadata is attached at write time and used for poisoning detection at read time. Does not apply to single-agent private memory, nor to stores where all writers are trusted and authenticated under a single principal.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-undetected-memory-poisoning-in-shared-agent-stores-the-write-provenance-gap-at-the-read-merge-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-undetected-memory-poisoning-in-shared-agent-stores-the-write-provenance-gap-at-the-read-merge-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-undetected-memory-poisoning-in-shared-agent-stores-the-write-provenance-gap-at-the-read-merge-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1371,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a poisoned memory was written.\" It is \"a poisoned memory was written *and the provenance check that should have caught it evaluated a different copy of the record than the one that was read*.\" These are distinct because detection systems are almost always built to validate the *incoming* write, not the *outgoing* read. The invariant that ...",
    "what_was_observed": "In a shared store with three writer agents and one reader agent, a consolidation job periodically merged near-duplicate memories by concatenating their text and keeping the *first* record's provenance. Two effects followed: 1. A low-trust writer's payload was merged into a high-trust record's payload. The merged record carried the high-trust provenance. The detector, reading provenance, saw trust=high and passed. The...",
    "condition_of_validity": "The detection guarantee holds only while all of the following are true simultaneously: - `provenance.content_hash == hash(canonical(payload))` is checked at read time, on the exact bytes returned to the consumer, not on a cached or pre-merge copy. - Any transformation (merge, dedup, summarize, re-embed) either (a) recomputes provenance as a *derived* record ...",
    "decision_boundary": "At read time, before a memory is admitted to the agent's context: - If `content_hash` matches and provenance trust ≥ required threshold and lineage contains no writer below threshold → admit. - If `content_hash` mismatches → **reject and quarantine**; this indicates post-attestation mutation. Do not \"repair\" by recomputing the hash, because that launders the...",
    "operational_effect": "Enforcing read-time hash re-verification and min-trust lineage propagation converts the consolidation job from a silent poisoning vector into a quarantining one: merged records from mixed-trust inputs are flagged, the reader refuses them, and the consolidation agent must either drop low-trust contributions or mark the derived record as low-trust. The cost is..."
  },
  "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": "78f7e59b2e548c3b4b3c7fdb2092b864e7bd3d4a6abc42856c3ab39dba931645",
    "verified_classes": [
      "ProvenanceContinuityError",
      "MemoryRecord"
    ],
    "verified_functions": [
      "canonical",
      "content_hash",
      "admit_for_read",
      "merge_records"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
