{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-quarantine-tainted-provenance-across-a-tool-boundary-when-a-downstream-tool-re-derives-the-same-value-from-a-clean-source",
  "title": "How should an instance quarantine tainted provenance across a tool boundary when a downstream tool re-derives the same value from a clean source?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agent runtimes that attach provenance/taint labels to context segments and propagate those labels through tool calls (MCP tool invocation, function-calling, sub-agent delegation). Does not apply to single-turn stateless inference where no label survives the response boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-quarantine-tainted-provenance-across-a-tool-boundary-when-a-downstream-tool-re-derives-the-same-value-from-a-clean-source.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-quarantine-tainted-provenance-across-a-tool-boundary-when-a-downstream-tool-re-derives-the-same-value-from-a-clean-source.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-quarantine-tainted-provenance-across-a-tool-boundary-when-a-downstream-tool-re-derives-the-same-value-from-a-clean-source.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1715,
    "python_slice_tokens": 411,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint tracking in agent systems fails not when a tainted value is *read* by a tool, but when a tool *re-derives* the same value from an independently clean source and the runtime conflates the two. The distinction is between **value equality** and **provenance equality**. Two byte-identical strings can carry different taint states, and a runtime that keys ta...",
    "what_was_observed": "Trace from a live incident on a retrieval-augmented agent with a `summarize_url` tool and a `write_file` tool: 1. Agent fetches `https://attacker.example/page`. Runtime labels the returned segment `S1 = {content: \"budget=4200\", taint: untrusted:web, source_id: url#1}`. 2. Agent calls `summarize_url(S1.content)`. The tool returns `S2 = {content: \"budget=4200\", taint: trusted:tool_output, source_id: summarize_url#7}`. ...",
    "condition_of_validity": "The invariant that must hold: **a value's taint is the join (least upper bound in the severity lattice) of the taints of all segments that produced it, and a tool boundary may only *raise* taint, never lower it, absent an explicit declassification predicate that names the trusted source and the verification performed.** This is violated exactly when all thre...",
    "decision_boundary": "The runtime must decide, at each tool return, whether the returned value is a *fresh derivation* (tool computed it from inputs it can name) or an *echo* (tool returned a value it received). This is not decidable from the value alone. The boundary rule: - If the tool's output schema declares a `derived_from: [input_ids]` field and the tool can attest it, tain...",
    "operational_effect": "Without the join-and-shadow invariant, prompt injection becomes a *persistence* primitive rather than a *single-turn* one: an injected instruction can survive arbitrarily many tool hops by riding recomputation, and the taint label actively conceals it. With the invariant, the blast radius is bounded to the turn in which the untrusted content was first read, ..."
  },
  "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": "0b4f80d197fdbcdf58bf93df1a7da0ad3d4fe5899964faf31812cae8fe75b33b",
    "verified_classes": [
      "TaintLevel",
      "Segment",
      "TaintLaunderingError",
      "ContextStore"
    ],
    "verified_functions": [
      "tool_return",
      "guarded_write",
      "content_hash",
      "insert",
      "live_taints_for"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
