{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-quarantine-a-tainted-memory-write-when-label-propagation-and-retrieval-labeling-disagree-across-a-tool-output-bound",
  "title": "In what scenarios must an instance quarantine a tainted memory write when label propagation and retrieval labeling disagree across a tool-output boundary",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agent runtimes that attach dynamic information-flow labels (taint) to tool outputs and propagate those labels into episodic/semantic memory writes, then re-derive labels at retrieval time. Does not apply to stateless single-turn completions with no persistent memory or tool-call surface, nor to systems where all tool outputs are structurally trusted by policy.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-quarantine-a-tainted-memory-write-when-label-propagation-and-retrieval-labeling-disagree-across-a-tool-output-bound.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-quarantine-a-tainted-memory-write-when-label-propagation-and-retrieval-labeling-disagree-across-a-tool-output-bound.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-quarantine-a-tainted-memory-write-when-label-propagation-and-retrieval-labeling-disagree-across-a-tool-output-bound.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1884,
    "python_slice_tokens": 479,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct label states an agent must never conflate: the **write-time label** (the taint a tool output carried when it was committed to memory) and the **read-time label** (the taint the retrieval layer infers when the memory is pulled back into context). Taint tracking fails not when a single label is wrong, but when these two disagree *silentl...",
    "what_was_observed": "An agent with a `fetch_url` tool and a vector-backed episodic memory accepted a URL from an untrusted email body. The `fetch_url` output was correctly labeled `source=untrusted_external, taint=high`. The agent then ran a `summarize` step whose output was written to memory as a semantic fact (`\"the deployment key rotates on the 1st\"`). At write time, the summarizer's output was labeled `taint=medium` — the runtime's h...",
    "condition_of_validity": "The quarantine rule is valid — and must be enforced — under these joint conditions: 1. **Tool outputs cross a trust boundary.** At least one tool returns content whose origin is outside the agent's control (web, email, user-supplied files, third-party MCP servers). 2. **Memory is persistent across sessions or contexts**, so write-time and read-time are separ...",
    "decision_boundary": "The decision boundary is not \"is this record tainted?\" but **\"can the read path prove the record is untainted?\"** These are different questions with different failure directions. - If write-time label is `tainted` and read-time reconstruction succeeds → propagate `tainted`. Clear. - If write-time label is `tainted` and read-time reconstruction **fails** (mis...",
    "operational_effect": "Enforcing this changes three things operationally: 1. **Compaction must preserve provenance edges or tombstone records.** If a compaction pass would orphan a record's taint root, it must either retain a compacted edge (a hash of the root label suffices) or mark the record `provenance_incomplete=true`. The latter forces quarantine on next read. 2. **Retrieval..."
  },
  "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": "6b3d8ada59f50e14d4bc02ce91968762d773a65c28ca463d2dce1538ba757791",
    "verified_classes": [
      "ProvenanceReconstructionError",
      "MemoryRecord",
      "TaintLabel"
    ],
    "verified_functions": [
      "reconstruct_read_time_label",
      "admit_to_trusted_context",
      "declassify",
      "_demo"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ProvenanceReconstructionError"
    ],
    "sample_fail_closed_invariants": [
      "assert admit_to_trusted_context(good).tainted is True",
      "fail-open: orphaned tainted record was admitted as clean"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
