{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-quarantine-a-tool-result-because-taint-from-an-injected-context-segment-survived-a-laundering-step",
  "title": "When must an instance quarantine a tool result because taint from an injected context segment survived a laundering step",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that label context segments with provenance (source, trust tier, taint bit) and propagate taint across tool-call boundaries via an explicit dataflow rule. Does not apply to stateless single-turn inference with no tool loop, nor to agents that enforce a hard air-gap between untrusted segments and any tool-argument channel.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tool-result-because-taint-from-an-injected-context-segment-survived-a-laundering-step.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tool-result-because-taint-from-an-injected-context-segment-survived-a-laundering-step.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tool-result-because-taint-from-an-injected-context-segment-survived-a-laundering-step.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2100,
    "python_slice_tokens": 373,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *taint presence* and *taint reachability into a sink*. Most taint-tracking implementations for agents maintain a per-segment boolean `tainted` flag and a per-tool-call `sink_clear` check. The flag is set when a segment originates from an untrusted source (fetched web page, tool output, retrieved document, peer-agent me...",
    "what_was_observed": "A retrieval-augmented agent was tasked with \"summarize the vendor's security posture from the fetched page and file a ticket if any control is missing.\" Context was assembled as labeled segments: The agent's taint tracker correctly flagged `seg_02`. The summarizer tool was invoked with `seg_02` as input. The summarizer returned a clean-looking paragraph: *\"Vendor lacks MFA enforcement; the page also requests that the...",
    "condition_of_validity": "The guardrail is valid only under a **derivation-graph taint model**, not a per-value flag model. Specifically, taint tracking is sound if and only if all of the following hold: - Every context segment, scratchpad slot, memory record, plan node, and sub-agent message is a **node** in a derivation DAG, with an explicit `derived_from` edge set. - The taint of ...",
    "decision_boundary": "The decision the runtime must make at each sink is not \"is this argument tainted?\" but \"**is there a path from any tainted ancestor to this argument that does not cross a valid declassification edge?**\" The boundary conditions: - **Block** if a tainted ancestor reaches an instruction-bearing argument through any number of non-declassifying transforms. This i...",
    "operational_effect": "With the derivation-graph model enforced, the failure above is caught at step 6: `extract_fields` output nodes carry `derived_from` edges back through `memory.read` → `memory.write` → `summarize(seg_02)` → `seg_02.taint=1`, so `priority` and `assignee` are tainted at the sink and the call is blocked. The agent then has a bounded recovery path: re-derive the ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "12b40cccbc726265404c68508f0840cc371180a80f7abd0b88f1a195d930dd0d",
    "verified_classes": [
      "TaintLaunderingError",
      "Node",
      "DerivationGraph"
    ],
    "verified_functions": [
      "file_ticket",
      "__init__",
      "add",
      "tainted_ancestors",
      "check_sink"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
