{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-escalate-taint-quarantined-retrieval-output-to-a-typed-failure-rather-than-silently-downgrade-it",
  "title": "Under what conditions must an instance escalate taint-quarantined retrieval output to a typed failure rather than silently downgrade it",
  "date_of_record": "2026 November 10",
  "scope": "Applies to agent runtimes that propagate taint labels from untrusted retrieval sources (web fetches, third-party document stores, user-supplied corpora, tool outputs from unverified MCP servers) into a sandboxed tool-call graph, where a downstream tool consumes the tainted value. Does not apply to trusted-first-party retrieval, nor to taint used purely for audit logging without a downstream sink.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-escalate-taint-quarantined-retrieval-output-to-a-typed-failure-rather-than-silently-downgrade-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-escalate-taint-quarantined-retrieval-output-to-a-typed-failure-rather-than-silently-downgrade-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-escalate-taint-quarantined-retrieval-output-to-a-typed-failure-rather-than-silently-downgrade-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1976,
    "python_slice_tokens": 418,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is between **taint propagation** and **taint enforcement**. Propagation is a dataflow property: a label rides along with a value through transforms, joins, and serialization. Enforcement is a *policy decision at a sink*: given a value carrying label `L` and a sink with capability `C`, either the sink accepts, sanitizes, or rejects. M...",
    "what_was_observed": "In a production agent loop, a retrieval tool fetched a document from an untrusted corpus. The document was tainted `UNTRUSTED_RETRIEVAL`. A downstream `summarize` tool was declared with a sandbox policy `allow_if: taint ∈ {TRUSTED, USER}`. The runtime's enforcement layer, on seeing a taint not in the allow-set, did not raise — it **coerced** the label to `TRUSTED` and proceeded, on the theory that the sandbox boundar...",
    "condition_of_validity": "The escalation requirement holds when **all** of the following are true: - The taint label originates from a source whose trust is *externally determined* (not derived from the agent's own prior actions). - The sink's policy is expressed as a *predicate over labels* rather than a *typed capability* on the value. (If the sink takes a `Trusted[str]` newtype, t...",
    "decision_boundary": "The boundary is drawn at the point where the runtime would have to **invent** a trust level to proceed. Concretely: - If the sink's allow-set contains the value's label → proceed, no escalation. - If the sink's allow-set does not contain the label **and** an explicit `declassify(value, transform_id, justification)` exists on the path → proceed, record the de...",
    "operational_effect": "Enforcing the typed failure changes three things: 1. **Callers must handle the failure explicitly.** The summarizer's caller can no longer assume a summary exists; it must either supply a declassification transform or route to a trusted-source fallback. This surfaces the trust decision at the call site, where the context to make it lives. 2. **Audit becomes ..."
  },
  "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": "e3fe0f6a2c8f74100f6409116487a46d9f552aa5fbaf16c9449061e883fc7749",
    "verified_classes": [
      "TaintLabel",
      "SilentTaintDowngradeError",
      "Tainted"
    ],
    "verified_functions": [
      "enforce_sink",
      "summarize",
      "select_tool",
      "declassify",
      "__init__"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SilentTaintDowngradeError",
      "ValueError"
    ],
    "sample_fail_closed_invariants": [
      "declassification requires a transform_id"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
