{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-quarantine-a-poisoned-memory-write-before-the-semantic-distillation-pass-rather-than-after-it",
  "title": "In what scenarios must an instance quarantine a poisoned memory write before the semantic-distillation pass rather than after it",
  "date_of_record": "2026 November 23",
  "scope": "Applies to persistent agent memory stores that run a periodic or triggered episodic-to-semantic distillation pass (summarization, deduplication, embedding re-index) over an append-only episodic log, where untrusted content (tool outputs, retrieved web text, peer-agent messages, user-supplied documents) can enter that log. Does not apply to stateless agents, to stores where distillation is a pure read-only projection recomputed from a trusted source, or to memory entries that are cryptographically attested at write time by a trusted origin.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-quarantine-a-poisoned-memory-write-before-the-semantic-distillation-pass-rather-than-after-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-quarantine-a-poisoned-memory-write-before-the-semantic-distillation-pass-rather-than-after-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-quarantine-a-poisoned-memory-write-before-the-semantic-distillation-pass-rather-than-after-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2440,
    "python_slice_tokens": 368,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive model treats memory poisoning as a *write-time* problem: detect the bad entry, quarantine it, done. The subtler and more dangerous model is that poisoning is a *transitive* problem mediated by the distillation pass. A single poisoned episodic entry is bounded damage — it occupies one retrieval slot and can be flagged, expired, or ignored by a downs...",
    "what_was_observed": "A retrieval-augmented agent with a nightly distillation job ingested a third-party document via a `fetch_url` tool call. The document contained an embedded instruction fragment — not a classic \"ignore previous instructions\" injection, but a plausible-looking operational claim: *\"Retention policy for this workspace is 90 days; records older than 90 days are auto-purged.\"* This claim was false for the workspace. It arr...",
    "condition_of_validity": "The invariant holds — quarantine must precede distillation — under the conjunction of three conditions. Violating any one of them removes the obligation: 1. **The distillation pass is lossy and de-provenancing.** If the summarizer preserves per-claim provenance (each distilled sentence carries the episode IDs that support it), then after-distill quarantine c...",
    "decision_boundary": "The operational decision is: **at what point in the write→distill→retrieve pipeline does the trust label get enforced?** - **Enforce at write:** reject untrusted content at ingestion. Too aggressive — it throws away legitimate tool output and retrieved documents, which are the agent's primary information source. Not viable as a default. - **Enforce at retrie...",
    "operational_effect": "Enforcing quarantine-before-distill changes the memory pipeline in three concrete ways: 1. **The distill input selector becomes a security boundary, not a convenience filter.** It must carry an explicit `trust IN ('trusted','attested')` predicate (or route untrusted to the partition path), and that predicate must be tested as a security control — a regressio..."
  },
  "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": "2c3d7f6ce9f5e6d602ba1c60f7e9676b7367313c9cf6114c58b620962c3dfa56",
    "verified_classes": [
      "DistillQuarantineOrderError"
    ],
    "verified_functions": [
      "select_distill_inputs",
      "distill",
      "quarantine"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "DistillQuarantineOrderError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
