{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-memory-poisoning-persistence-when-agent-writes-are-laundered-through-episodic-to-semantic-distillation",
  "title": "Which invariants prevent silent memory-poisoning persistence when agent writes are laundered through episodic-to-semantic distillation",
  "date_of_record": "2026 November 19",
  "scope": "Applies to persistent agent memory stores that perform periodic distillation of episodic traces into semantic entries (facts, preferences, procedures) and where write provenance is not cryptographically bound to the distilled record. Does not cover single-session context-window poisoning, which lacks cross-session persistence, nor retrieval-time injection from untrusted tool outputs that never reach the store.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-memory-poisoning-persistence-when-agent-writes-are-laundered-through-episodic-to-semantic-distillation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-memory-poisoning-persistence-when-agent-writes-are-laundered-through-episodic-to-semantic-distillation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-memory-poisoning-persistence-when-agent-writes-are-laundered-through-episodic-to-semantic-distillation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2029,
    "python_slice_tokens": 406,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The intuitive defense against memory poisoning is a write-time filter: validate each incoming memory entry against the source that produced it. This works when the unit of persistence equals the unit of ingestion — one tool output, one user turn, one memory record. It fails when the store runs an **episodic-to-semantic distillation** pass, because the distil...",
    "what_was_observed": "A long-running coding agent persisted episodic traces across sessions: `tool_result`, `user_turn`, `agent_inference`. Nightly, a distillation worker clustered episodes by embedding similarity and emitted semantic entries of the form `{subject, predicate, object, confidence, source_episode_ids}`. The write-time filter rejected any episodic trace whose content matched an injection signature (imperative directives aimed...",
    "condition_of_validity": "The laundering failure requires all of the following to hold simultaneously; remove any one and the specific mechanism does not fire: 1. **Batch distillation across episodes.** The store merges multiple episodic traces into one semantic record. Single-episode promotion (episodic trace → semantic entry with a 1:1 mapping) does not launder, because the taint s...",
    "decision_boundary": "The boundary is between **distillation as synthesis** and **distillation as trusted aggregation**. A store may treat distilled output as a *candidate* semantic entry that must re-earn trust through independent corroboration from a disjoint source set, or it must propagate the minimum trust of its inputs. It may not do both silently. Concretely, the architect...",
    "operational_effect": "Enforcing the provenance-floor invariant changes retrieval behavior in a way that must be designed for, not bolted on. Semantic entries now carry a two-dimensional trust signal (`confidence`, `provenance_floor`), and retrieval ranking must not collapse them into one scalar — a high-confidence, low-floor entry is a *hint*, not a *fact*, and the agent's planne..."
  },
  "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": "ddc2c44a4c8cb1282ed2bf266551b4007a7825ce891b90fe71100884388ef939",
    "verified_classes": [
      "TrustTier",
      "MemoryPoisoningError",
      "Episode",
      "SemanticEntry"
    ],
    "verified_functions": [
      "distill",
      "authorize_action",
      "__post_init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MemoryPoisoningError"
    ],
    "sample_fail_closed_invariants": [
      "cannot distill empty episode cluster"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
