{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-quarantine-provenance-tainted-context-before-tool-dispatch-rather-than-after-retrieval-scoring",
  "title": "Under what conditions must an instance quarantine provenance-tainted context before tool dispatch rather than after retrieval scoring",
  "date_of_record": "2026 November 22",
  "scope": "Applies to single- and multi-step agents that attach provenance labels to retrieved chunks and tool outputs and propagate taint across turns. Does not cover static prompt hardening, model-side refusal training, or injection detection that operates only on the raw user turn without a provenance graph.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-provenance-tainted-context-before-tool-dispatch-rather-than-after-retrieval-scoring.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-provenance-tainted-context-before-tool-dispatch-rather-than-after-retrieval-scoring.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-quarantine-provenance-tainted-context-before-tool-dispatch-rather-than-after-retrieval-scoring.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2457,
    "python_slice_tokens": 445,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common framing of prompt-injection defense is a *content* classifier: score the retrieved chunk, block if suspicious. That framing conflates two distinct mechanisms that fail at different layers. The first is **detection**: does this span contain an instruction-like pattern? The second is **taint propagation**: given that span $s$ entered the context wit...",
    "what_was_observed": "A retrieval-augmented agent was tasked with summarizing a set of internal documents and emailing the summary to a distribution list. The retrieval layer fetched 40 chunks, each carrying a provenance label: `INTERNAL_CORPUS` for indexed documents, `EXTERNAL_FETCH` for chunks pulled by a `fetch_url` tool mid-task. A taint tracker assigned `EXTERNAL_FETCH` chunks taint class `T2` and propagated `T2` to any chunk whose e...",
    "condition_of_validity": "The quarantine-before-dispatch invariant is *valid and necessary* under the following joint conditions. Outside them, the cheaper score-at-retrieval approach may be adequate, and imposing full taint enforcement is over-engineering. 1. **Derivation is indirect.** The agent produces tool arguments by synthesizing across multiple chunks rather than copying a si...",
    "decision_boundary": "The boundary is between two enforcement placements, and the decision is not \"which is more secure\" but \"which placement survives the state transformations the task actually performs.\" - **Score-at-retrieval** is correct when taint is a function of content and content is not transformed before the sink. Enforcement point: retrieval ingress. Failure mode: indi...",
    "operational_effect": "With quarantine-before-dispatch enforced and the taint field carried through compaction, the `send_email` call in the observed incident is blocked at dispatch: the argument-attribution step maps two `to` addresses to `c_117` (taint `T2`), the dispatch gate sees `T2` without a declassification token, and raises. The agent receives a structured refusal naming ..."
  },
  "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": "f55ada72c4c1f97a10bf2b9d99375ebad3a44de127dd95938cf1e463f2b91a4d",
    "verified_classes": [
      "TaintClass",
      "TaintLaunderingError",
      "QuarantineViolation",
      "Span",
      "DerivedArgument",
      "ContextState"
    ],
    "verified_functions": [
      "derive",
      "dispatch_side_effecting_tool",
      "_execute",
      "run_task",
      "compact"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "QuarantineViolation",
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
