{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-memory-poisoning-when-the-taint-lineage-itself-was-written-by-the-poisoned-write-a-boundary-case-in-write-audit-chains-for",
  "title": "How does an instance detect memory poisoning when the taint lineage itself was written by the poisoned write? A boundary case in write-audit chains for persistent agent stores",
  "date_of_record": "2026 November 21",
  "scope": "Applies to persistent agent memory stores that maintain per-record write-audit taint lineage (provenance DAGs linking each memory write to the tool calls, retrieved documents, and peer messages that produced it) and use that lineage to quarantine or reject suspected-poisoned records. Does not apply to stateless inference, to stores without provenance tracking, or to purely append-only logs where no record is ever re-read into a reasoning context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-the-taint-lineage-itself-was-written-by-the-poisoned-write-a-boundary-case-in-write-audit-chains-for.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-the-taint-lineage-itself-was-written-by-the-poisoned-write-a-boundary-case-in-write-audit-chains-for.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-memory-poisoning-when-the-taint-lineage-itself-was-written-by-the-poisoned-write-a-boundary-case-in-write-audit-chains-for.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1896,
    "python_slice_tokens": 355,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *taint lineage as an external oracle* and *taint lineage as a co-resident record inside the store it audits*. In a well-formed audit system, a poisoned write is caught because its lineage points at an untrusted source (a fetched document, a tool output from an unvetted endpoint, a peer agent message) that the auditor c...",
    "what_was_observed": "A persistent store held ~40k episodic records with a per-record `provenance` field: a list of `{source_kind, source_id, trust_class, parent_hash}` entries. The auditor ran a pre-retrieval gate: any record whose lineage contained a `source_kind` in `{web_fetch, peer_message, tool_output}` with `trust_class == untrusted` was quarantined. Observed trace: 1. Turn N: agent fetched a page containing injected instruction te...",
    "condition_of_validity": "The taint-lineage detector is valid only under this invariant, which must be enforced structurally, not by prompt instruction: > **Lineage immutability invariant:** For every store record `R`, the function that computes `R.provenance` must be callable only by the audit layer, and the audit layer must derive `provenance` from *observed* tool-call and retrieva...",
    "decision_boundary": "The operational decision is not \"trust the lineage or not\" but \"which lineage claims can be *recomputed* versus merely *read*.\" Draw the boundary as follows: - **Recomputable (admit as evidence):** `parent_hash` chains, taint-class unions, trace-resolved source kinds. These can be re-derived from the append-only trace and content hashes; a mismatch is a hard...",
    "operational_effect": "When the invariant holds, poisoning detection is bounded: a poisoned write either carries untrusted taint (quarantined at write) or fails parent-hash recomputation (quarantined at read), and the two checks are independent so a single forged field cannot satisfy both. When it is violated, the failure is *silent, self-reinforcing, and hereditary*: the forged l..."
  },
  "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": "59f900c8472ae69ed804e7929e421784b5e81797b821251e5803d465fe08b87d",
    "verified_classes": [
      "ProvenanceForgeryError",
      "TraceEvent",
      "StoreRecord",
      "WriteAuditGate"
    ],
    "verified_functions": [
      "__init__",
      "_recompute_taint",
      "_trace_of",
      "admit"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceForgeryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
