{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-to-emit-a-parent-span-when-a-tainted-a2a-handoff-crosses-an-mcp-tool-boundary",
  "title": "In what scenarios must an instance refuse to emit a parent span when a tainted A2A handoff crosses an MCP tool boundary",
  "date_of_record": "2026 November 22",
  "scope": "Applies to multi-agent systems that propagate a single causal trace across MCP tool invocations, A2A peer handoffs, and GenAI inference spans, where taint lineage (untrusted-input provenance) is attached to span attributes. Does not apply to single-process, single-agent traces with no cross-protocol handoff, nor to systems that treat trace IDs as opaque correlation keys with no lineage semantics.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-emit-a-parent-span-when-a-tainted-a2a-handoff-crosses-an-mcp-tool-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-emit-a-parent-span-when-a-tainted-a2a-handoff-crosses-an-mcp-tool-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-emit-a-parent-span-when-a-tainted-a2a-handoff-crosses-an-mcp-tool-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2027,
    "python_slice_tokens": 452,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"missing trace context\" — that is a well-understood, loudly-failing condition. The failure is **silent lineage reparenting**: an A2A handoff carries a `trace_id` and a `parent_span_id` that are structurally valid, but the receiving agent's MCP client re-roots its tool-call spans under a *new local root* because the inbound `traceparent` he...",
    "what_was_observed": "A three-hop pipeline: Agent A (retriever) → A2A handoff → Agent B (planner) → MCP `tools/call` → Tool Server T → GenAI span (Agent B's synthesis) → A2A handoff → Agent C (executor). Agent A's retrieval returned a document containing an injected instruction. Agent A correctly marked its output span with `genai.taint.source=retrieval:doc_4417` and `genai.taint.propagate=true`. The A2A envelope serialized the trace cont...",
    "condition_of_validity": "The invariant — \"every span that consumed tainted input carries the taint lineage of its nearest tainted ancestor\" — holds only under the following bounded condition: 1. **Protocol translation is lossless for lineage attributes.** Every boundary crossing (A2A envelope → agent runtime → MCP client → MCP server → GenAI SDK) must have an explicit, tested mappin...",
    "decision_boundary": "The decision an instance must make at each cross-protocol boundary is binary and must be made *before* emitting the child span: - **If the inbound lineage attribute set is complete and mapped** → emit the child span as a tainted descendant, propagating the full lineage token set unchanged. - **If the inbound lineage attribute set is incomplete or unmapped** ...",
    "operational_effect": "Enforcing the refusal boundary changes three operational properties: 1. **Audit completeness becomes provable, not assumed.** A trace query for taint lineage now returns either the full causal chain or an explicit `broken_at` marker. The auditor can distinguish \"no taint reached this span\" from \"we lost track of whether taint reached this span.\" The former i..."
  },
  "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": "9e72d55148c079bbb9279a2b232a863509aea12feb4adb4e220d6412560c2b33",
    "verified_classes": [
      "TaintLineageBreakError",
      "SpanContext"
    ],
    "verified_functions": [
      "emit_child_span",
      "demo",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "AssertionError",
      "TaintLineageBreakError"
    ],
    "sample_fail_closed_invariants": [
      "assert b.taint_tokens == {'retrieval:doc_4417'}",
      "silent lineage break was not caught"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
