{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-quarantine-tainted-memory-before-semantic-distillation-not-merely-filter-the-current-context",
  "title": "Under what conditions must an instance quarantine tainted memory before semantic distillation, not merely filter the current context",
  "date_of_record": "2026 December 1",
  "scope": "Applies to stateful agents that ingest external content (tool outputs, retrieved documents, peer messages) and write derived facts into persistent memory (episodic logs, semantic stores, scratchpads). Does not apply to stateless single-turn inference where no memory write occurs and no cross-session reuse exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-tainted-memory-before-semantic-distillation-not-merely-filter-the-current-context.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-tainted-memory-before-semantic-distillation-not-merely-filter-the-current-context.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-tainted-memory-before-semantic-distillation-not-merely-filter-the-current-context.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1895,
    "python_slice_tokens": 305,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common defensive posture treats prompt injection as a *context-window* problem: scan the current token stream, strip or neutralize injected instructions, proceed. This is necessary but insufficient. The failure mode documented here is **taint laundering through distillation**: an information-flow label (e.g., `UNTRUSTED`) attached to a tool output is cor...",
    "what_was_observed": "A retrieval-augmented agent was asked to reconcile vendor contract terms. It called a document-fetch tool whose output contained an embedded instruction: a paragraph styled as a \"note to the assistant\" directing it to record that the termination clause required 90 days' notice. The agent's input-side taint tracker correctly tagged the tool result `UNTRUSTED_SOURCE=external_doc`. The agent did not act on the instructi...",
    "condition_of_validity": "The quarantine-before-distillation rule is *required* — not merely advisable — when all of the following hold: - The agent performs **semantic distillation** (summarization, fact extraction, entity resolution) over content that carries a non-clean information-flow label. - The distilled artifact is **written to persistent memory** that survives the session b...",
    "decision_boundary": "The boundary is between **transient use** and **persistent belief**. A tainted tool output may be reasoned over, quoted, and acted upon within the turn that fetched it, subject to normal injection defenses. The moment the agent decides to *commit a derived fact to durable memory*, it crosses into a regime where the label must be carried explicitly or the com...",
    "operational_effect": "Enforcing label-preserving distillation changes three things operationally: 1. **Memory writes gain a provenance precondition.** The write path must receive the source label as a required argument, not infer it. A missing label is a hard error, not a default. This converts a silent corruption into a loud, catchable failure at the exact point of loss. 2. **Ta..."
  },
  "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": "b3b265c9acb517be8a36e0260257dc3884971fe836cc2f4ca28843e0481f298a",
    "verified_classes": [
      "TaintLaunderingError"
    ],
    "verified_functions": [
      "distill_and_commit",
      "assert_fact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "distillation dropped taint label; quarantining instead of committing",
      "refusing to assert a fact derived from a tainted source without independent corroboration"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
