{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-quarantine-a-tainted-context-segment-before-a-tool-call-and-why-label-propagation-alone-cannot-answer-this",
  "title": "Under what conditions must an instance quarantine a tainted context segment before a tool call, and why label propagation alone cannot answer this",
  "date_of_record": "2026 November 29",
  "scope": "Applies to single- and multi-agent systems that propagate dynamic information-flow (DIF) labels across tool-call boundaries and context-window compaction to defend against prompt injection. Does not apply to stateless single-turn inference with no tool use, nor to systems where all tool outputs are pre-trusted by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-a-tainted-context-segment-before-a-tool-call-and-why-label-propagation-alone-cannot-answer-this.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-a-tainted-context-segment-before-a-tool-call-and-why-label-propagation-alone-cannot-answer-this.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-a-tainted-context-segment-before-a-tool-call-and-why-label-propagation-alone-cannot-answer-this.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2331,
    "python_slice_tokens": 440,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things a taint-tracking layer can mean by \"this segment is tainted\": 1. **Provenance taint** — the segment's bytes derive, transitively, from an untrusted source (a fetched web page, a user-supplied document, a tool output whose schema admits free text). This is a *label*, and it propagates by a lattice join: `label(a ⊕ b) = label(a) ⊔ label(b)...",
    "what_was_observed": "Consider a three-tool episode. The agent fetches a document via `fetch_url`, which returns `{ \"text\": ..., \"provenance\": \"untrusted\" }`. The DIF layer tags the returned segment `U`. The agent then calls `summarize(text)`, a tool whose output schema is `{ \"summary\": str }` with no provenance field. The summarizer's output is labeled `T` (trusted) by default because the tool is on an allow-list. The agent then calls `s...",
    "condition_of_validity": "Dynamic label propagation is a *sound* defense against prompt injection only under all of the following, and the boundary failure above is precisely the case where the third fails: 1. **Label-preserving tool boundaries.** Every tool that consumes labeled input and emits free-form text must either propagate the input label onto its output (a `join` over input...",
    "decision_boundary": "The decision the runtime must make at each tool call is not binary \"quarantine or proceed.\" It is a three-way choice conditioned on the reachability check: - **Reachable + no declassification witness → hard block.** Reject the call, return a structured `TaintReachabilityError` to the agent so it can replan with an explicit declassifier (e.g., \"ask the user t...",
    "operational_effect": "Enforcing reachability-plus-witness changes the failure profile in three measurable ways: - **Laundering through declassifier-shaped tools is caught at the graph, not the label.** The `summarize` → `send_email` path is blocked because `send_email.body` is reachable from the `fetch_url` node regardless of the summarizer's output label. The false-negative rate..."
  },
  "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": "a3e51dec17c16cf58a1e27e460862c31260c6947bda42d370d291150548abcd8",
    "verified_classes": [
      "TaintReachabilityError",
      "Label",
      "Node",
      "Witness",
      "EpisodeGraph"
    ],
    "verified_functions": [
      "guard_side_effecting_call",
      "join",
      "add",
      "declassify",
      "_ancestors",
      "is_reachable_from_untrusted",
      "has_witness_on_path"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintReachabilityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
