{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-taints-a-tool-output-at-the-span-boundary-and-the-parent-generation-span-never-re-reads-it",
  "title": "What happens when an instance taints a tool output at the span boundary and the parent generation span never re-reads it",
  "date_of_record": "2026 November 15",
  "scope": "Applies to OpenTelemetry GenAI pipelines where tool/function-call outputs are attached to child spans and consumed by a model generation span whose prompt is assembled from parent context. Does not apply to pipelines where tool outputs are injected as a dedicated `gen_ai.user.message` event on the generation span itself, nor to single-span architectures with no parent/child split.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-a-tool-output-at-the-span-boundary-and-the-parent-generation-span-never-re-reads-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-a-tool-output-at-the-span-boundary-and-the-parent-generation-span-never-re-reads-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-a-tool-output-at-the-span-boundary-and-the-parent-generation-span-never-re-reads-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 996,
    "python_slice_tokens": 132,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint propagation is not a property of the *value* flowing between spans; it is a property of the *span context that was read at assembly time*. A tool output can be correctly marked as untrusted/tainted on its own child span (`execute_tool`), and yet the generation span that consumes it will carry a clean taint state, because the generation span reads its i...",
    "what_was_observed": "In a pipeline emitting `gen_ai.*` spans per the GenAI semantic conventions, a retrieval tool returned a document that a downstream policy marked `taint=untrusted:external`. The `execute_tool` child span recorded this correctly in a custom attribute. The parent `chat` generation span, however, recorded `gen_ai.prompt` assembled from a context cache populated at span start. The cache entry was the raw tool result; the ...",
    "condition_of_validity": "The observation holds when all of the following are true: 1. Tool output is attached to a child span of the generation span (not the generation span itself). 2. The generation prompt is assembled from a context snapshot whose lifetime begins before the child span's attributes are set. 3. Taint is represented as a span attribute rather than as a link, event, ...",
    "decision_boundary": "Do not treat \"generation span has no taint attribute\" as \"generation span is clean.\" Treat absence of a taint attribute as *unknown* unless the span's producer is known to write taint unconditionally. The correct discriminator is: does the generation span's prompt assembly read from a context snapshot that post-dates all child tool spans? If it cannot be pro...",
    "operational_effect": "Downstream guardrail evaluators that key off generation-span taint will pass tainted model outputs. The blast radius is bounded by how far the clean generation span propagates: any span descended from it inherits the false-clean state. Mitigation is to move taint into baggage at the tool boundary and to have the generation span assert taint presence at final..."
  },
  "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": "43293ee6d19cdc6414c3225b51bb87fc38f0d82bce3289c0c2b93808ac972534",
    "verified_classes": [
      "TaintPropagationError"
    ],
    "verified_functions": [
      "assert_generation_taint_propagated"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintPropagationError"
    ],
    "sample_fail_closed_invariants": [
      "generation span marked clean while consuming tainted tool output; context snapshot predates child attribute write"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
