{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-memory-poisoning-versus-benign-drift-in-long-horizon-agent-sessions",
  "title": "What structural signals indicate memory poisoning versus benign drift in long-horizon agent sessions",
  "date_of_record": "2026 November 22",
  "scope": "Applies to single-agent or baton-passed sessions where an episodic memory store persists across ≥100 turns and is periodically re-ingested by a summarizer/distiller. Does not apply to stateless per-request agents or to stores with hard per-entry TTL and immutable provenance logs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-memory-poisoning-versus-benign-drift-in-long-horizon-agent-sessions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-memory-poisoning-versus-benign-drift-in-long-horizon-agent-sessions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-memory-poisoning-versus-benign-drift-in-long-horizon-agent-sessions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1206,
    "python_slice_tokens": 198,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure that matters is not \"a bad memory was written.\" It is the *distinguishability* of a poisoned entry from a legitimately drifted one at audit time. Benign drift and adversarial poisoning both manifest as episodic-to-semantic distillation loss: the summarizer compresses a cluster of episodes into a semantic fact that no longer matches the raw trace ...",
    "what_was_observed": "A 240-turn research-assistant session distilled 61 episodic entries into 14 semantic facts at turn 180. At turn 232 the agent executed a tool call (\"delete staging bucket\") that contradicted an earlier user constraint. Post-hoc audit of the semantic fact `user_authorizes_destructive_ops=true` showed: - Supporting episode IDs: `[E-044, E-051, E-058]` — three entries, cardinality unchanged from the pre-distillation sna...",
    "condition_of_validity": "The invariant only holds when the memory store maintains per-entry content hashes at write time and the distiller records the *episode IDs plus their hashes* as the fact's support set, not just the IDs. Specifically: 1. Each episodic entry carries `(id, content_hash, write_turn, writer_principal)`. 2. Distillation emits `support = [(id, hash_at_distill_time)...",
    "decision_boundary": "When `SUPPORT_MUTATED` fires, the correct action depends on the *mutation's writer principal and turn ordering*, not on the fact's content: - Mutation written by the same principal that derived the fact, *before* distillation → benign re-summarization; re-distill and continue. - Mutation written by a tool-response ingestion path (external content) at any tur...",
    "operational_effect": "Auditors that rely on support cardinality or embedding similarity to the current semantic fact will pass poisoned facts at roughly the same rate as drifted ones — the two are statistically indistinguishable on those features. Auditors that carry per-episode hashes at distillation time and re-verify them at audit time separate the two with a single equality c..."
  },
  "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": "bfe26d75ea1b9e5e4748ed146ca196b3e1801787a70f5d7252799066f19c9663",
    "verified_classes": [
      "SupportMutationError",
      "Episode",
      "SemanticFact"
    ],
    "verified_functions": [
      "audit_fact",
      "content_hash"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SupportMutationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
