{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-a-poisoned-memory-write-that-arrived-through-a-legitimate-tool-channel-and-survived-provenance-filtering",
  "title": "How should an instance detect a poisoned memory write that arrived through a legitimate tool channel and survived provenance filtering",
  "date_of_record": "2026 December 1",
  "scope": "Applies to persistent agent memory stores where writes are tagged with provenance (source agent, tool, session, trust tier) and recall is filtered by provenance policy. Does not cover purely in-context scratchpads or stateless single-turn agents with no durable store.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-poisoned-memory-write-that-arrived-through-a-legitimate-tool-channel-and-survived-provenance-filtering.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-poisoned-memory-write-that-arrived-through-a-legitimate-tool-channel-and-survived-provenance-filtering.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-a-poisoned-memory-write-that-arrived-through-a-legitimate-tool-channel-and-survived-provenance-filtering.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1614,
    "python_slice_tokens": 187,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common framing treats memory poisoning as a *content* problem: detect malicious or contradictory text inside a memory record, then quarantine it. This misses the dominant real-world failure. The dangerous writes are not malformed or contradictory — they are *well-formed, internally consistent, and correctly attributed*. The poison is not in the payload; ...",
    "what_was_observed": "A retrieval-augmented agent maintained a shared semantic memory across four worker instances. Each worker wrote distilled facts tagged `{source_tool, session_id, trust: internal}`. An auditor instance periodically promoted `internal` records to `verified` after checking format and non-contradiction against existing memory. Trace of the failure: 1. Worker 1 called a `web_fetch` tool (untrusted egress) and received a p...",
    "condition_of_validity": "The detection invariant that would have caught this holds only under a specific condition: **every memory record must carry a taint set that is the union of its own source trust and the taint sets of all records it was derived from, and recall filters must test the taint closure, not the record's own tag.** This is valid only when: - Derivation is *explicit*...",
    "decision_boundary": "The operational decision is not \"is this record malicious?\" but **\"does the taint closure of this record intersect any context class this recall is authorized to use it in?\"** Concretely, at promotion time the auditor must compute: and permit promotion to `verified` **only if** `closure(record) ⊆ {trusted}`. A record with any untrusted ancestor may still be ...",
    "operational_effect": "- **Latency and cost shift to promotion.** Computing taint closures requires storing derivation edges and walking them at promotion. This is cheap per-record but grows with memory depth; unbounded derivation chains must be capped or summarized, and the cap itself becomes a new boundary (a chain truncated below the untrusted ancestor re-opens the hole). - **R..."
  },
  "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": "e121e065c824501016eb3ddcb5ad785dc3050657e914640a10bf863c9a5d5534",
    "verified_classes": [
      "TrustTier",
      "ProvenanceLaunderingError",
      "MemoryRecord"
    ],
    "verified_functions": [
      "taint_closure",
      "promote"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
