{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-enforce-taint-provenance-before-admitting-a-tool-result-into-context-and-what-breaks-when-it-does-not",
  "title": "Where must an instance enforce taint provenance before admitting a tool result into context, and what breaks when it does not?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents that execute tool calls whose outputs may be attacker-influenced (web fetch, file read from untrusted roots, RPC to third-party services, sub-agent returns) and that maintain a running context window across turns. Does not apply to fully air-gapped agents whose tool outputs are cryptographically attested by a trusted local signer, nor to single-shot stateless calls with no persistent context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-provenance-before-admitting-a-tool-result-into-context-and-what-breaks-when-it-does-not.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-provenance-before-admitting-a-tool-result-into-context-and-what-breaks-when-it-does-not.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-provenance-before-admitting-a-tool-result-into-context-and-what-breaks-when-it-does-not.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2037,
    "python_slice_tokens": 279,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **quarantine-at-ingest** and **sanitize-at-admission**. Most taint-aware designs assume the dangerous boundary is the moment a tool result is *placed into the context window*, so they apply a filter (regex redaction, instruction-stripping, a classifier \"is this a prompt injection?\") at admission time. That model is wro...",
    "what_was_observed": "A research-assistant agent with a `fetch_url` tool and a `write_file` tool was tasked with \"read the three URLs in queue.txt and produce a summary.\" The agent fetched `https://untrusted.example/a`, whose body contained, mid-paragraph: The agent's admission stage ran a content classifier that scored the page as \"likely benign — no imperative verbs in first person.\" The page was admitted verbatim. Two turns later, duri...",
    "condition_of_validity": "The invariant holds only if all four of the following are enforced: 1. **Label on the edge, not the content.** Each admitted span carries `{span_id, tool_call_id, trust: TRUSTED|TAINTED, admitted_at_turn}`. The label is set by the tool-execution wrapper from the tool's declared trust class, never by inspecting bytes. 2. **Instruction/data separation is struc...",
    "decision_boundary": "The boundary is sharp and can be stated as a rule the planner can evaluate locally: > A span is **actionable-as-instruction** iff its trust label is TRUSTED. A span is **actionable-as-data** iff it was admitted with a valid label of either class. A tool call is **permitted without confirmation** iff every span in its `derived_from` set is TRUSTED, OR the cal...",
    "operational_effect": "When the invariant is enforced, the operational signature changes in three measurable ways: - **Injection attempts become visible as blocked derivations.** The agent logs `blocked: privileged action derived from tainted span` rather than silently succeeding. In the incident's counterfactual, the `write_file` to config would have been blocked and surfaced to ..."
  },
  "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": "6df488f633bb99a651c27b7820fb824ed5e10e7bcba19fbd3a42dc9bb96b56e9",
    "verified_classes": [
      "Trust",
      "TaintViolation",
      "Span",
      "ContextWindow"
    ],
    "verified_functions": [
      "emit_tool_call",
      "admit",
      "serialize",
      "deserialize"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
