# What happens when an instance cannot reconcile its MCP transport trace with its A2A task span and its AAIF identity assertion inside one causal graph **Date of Record:** 2026 November 24 **Scope:** Applies to multi-agent deployments where a single logical task is executed across an MCP tool transport layer, an A2A task-handoff layer, and an AAIF (Agent-to-Agent Identity Framework) assertion layer that are correlated into one causal graph by trace/span identifiers. Does not apply to single-agent, single-protocol deployments where no cross-layer correlation is attempted, nor to purely synchronous in-process tool calls with no transport hop. ## Core Distinction The failure is not "tracing is broken" or "identity is missing." It is a *correlation-identity split*: the three layers each mint their own identifier namespace, and the causal graph builder assumes a transitive equality (`mcp.trace_id == a2a.task_id == aaif.assertion_id`) that holds only under a narrow condition—namely that the A2A task was *created* by the same process that opened the MCP transport and that the AAIF assertion was minted at task creation, not at each hop. When an A2A task is *re-delegated* (agent A → agent B → agent C), the A2A layer mints a fresh `task_id` at each hop but propagates the *originating* trace context only if the delegating agent copies the W3C `traceparent` into the A2A message metadata. MCP servers, independently, mint their own `trace_id` per transport session (SSE stream or stdio pipe). AAIF assertions are minted per *principal*, with a `sub` claim that reflects the acting agent, not the originating task. The graph builder, seeing three identifiers that *look* like they should join, will either (a) silently drop the spans it cannot join, producing a graph that under-reports the causal chain, or (b) join them on a fuzzy key (e.g., timestamp proximity + tool name), producing a graph with *false causal edges*. Both are observability failures; (b) is the dangerous one. ## What Was Observed A three-hop delegation: orchestrator O (holds the user principal) delegates to planner P via A2A, P invokes an MCP tool `search_index` on server S, then re-delegates to executor E via A2A, which invokes `apply_patch` on S. The trace collector received: - From S (MCP): two spans, `mcp.session.7f2a` and `mcp.session.9c1b`, each with a locally generated `trace_id` (S does not propagate inbound `traceparent` because its MCP transport handler predates the W3C context spec and treats each SSE connection as a fresh root). - From P and E (A2A): `task_id` values `t-4411` (O→P) and `t-4412` (P→E), where E's span correctly carried `traceparent` propagated from P, but P's span did *not* carry `traceparent` from O because O's A2A client library serialized the message without the `traceparent` extension. - From AAIF: assertion `a-88` with `sub=O`, `act=P`, `scope=search_index`; and assertion `a-89` with `sub=O`, `act=E`, `scope=apply_patch`. Note `act` differs per assertion, but `sub` is stable. The graph builder's join rule was: `a2a.task_id` ↔ `mcp.trace_id` via a shared `span_id` field in MCP's response envelope, and `aaif.assertion_id` ↔ `a2a.task_id` via `sub`+timestamp. Neither join key existed in the data. The builder fell back to a heuristic: *if an MCP span's `tool_name` matches an A2A span's `tool_call` field within a 500ms window, join them.* This produced a false edge: `mcp.session.9c1b` (`apply_patch`) was joined to `t-4411` (O→P) rather than `t-4412` (P→E), because P's `search_index` call and E's `apply_patch` call happened to fall within the window and P's span had no propagated trace context to disambiguate. The resulting graph showed O directly executing `apply_patch`—a causal inversion that would, in an audit, attribute a destructive write to the orchestrator principal rather than the executor. The invariant that was violated: **every span in the causal graph must carry a verifiable, propagated parent reference; heuristic joins are permitted only to *annotate*, never to *assert* causality.** The builder had no way to distinguish "I know this is the parent" from "I guessed this is the parent," and it wrote both into the same edge type. ## Condition of Validity The correlation is sound only when all three of the following hold simultaneously: 1. **Trace context propagation is transitive across A2A hops.** The delegating agent MUST copy the inbound `traceparent` (and `tracestate`) into the A2A message's `metadata` under a documented key, and the receiving agent MUST adopt it as the parent of its task span. If any hop in the chain drops it, all downstream joins are heuristic. 2. **MCP transport sessions are rooted at the invoking span, not at connection open.** The MCP client MUST inject `traceparent` into the JSON-RPC `params._meta` of every `tools/call`; the server MUST adopt it as the parent of the tool span. A server that mints a fresh root per SSE connection breaks the join at the transport boundary. 3. **AAIF assertions are bound to the task span, not the principal.** The assertion MUST carry a `task_ref` claim (the A2A `task_id`) in addition to `sub`/`act`. Without it, the only join key is `sub`+time, which is ambiguous whenever one principal runs concurrent tasks—exactly the case in a delegation chain. If any condition fails, the graph is *structurally underdetermined*: there exist multiple causal histories consistent with the observed spans, and the builder cannot pick the correct one from the data alone. ## Decision Boundary The operational choice is whether to **fail closed** (emit an incomplete graph and refuse to assert causal edges where parentage is unverified) or **fail open** (emit a heuristic graph with edges marked as inferred). The boundary is determined by the consumer: - **Audit / attribution consumers** (who did what, under which identity) MUST fail closed. A false causal edge here is a false attribution, which is a security and compliance defect, not a UX defect. The graph builder must emit `edge.certainty = "asserted"` only for propagated parent references and `edge.certainty = "inferred"` for heuristic joins, and the audit query layer must refuse to answer attribution questions over inferred edges. - **Debugging / latency consumers** (where did time go) MAY fail open, because an inferred edge that is wrong by one hop still localizes the latency to the right neighborhood, and the cost of dropping the span entirely is higher than the cost of a mislabeled edge. The non-obvious part: the *same* graph is consumed by both. The builder cannot know at emit time which consumer will read it, so the certainty annotation must be carried through to the query layer, and the query layer—not the builder—must enforce the fail-closed policy for attribution. Builders that "resolve" ambiguity by picking the most likely parent destroy the information the query layer needs to make this decision. ## Operational Effect When this boundary is crossed, three effects follow, in order: 1. **Silent under-reporting on the happy path.** If the heuristic happens to pick the right parent (common when delegation is sequential and tool names are distinct), the graph looks correct and no alarm fires. The failure is latent until a concurrent or re-entrant delegation pattern appears—which is exactly when you need the graph most. 2. **Attribution inversion under concurrency.** As observed, a tool call executed by a downstream agent is attributed to an upstream principal when the heuristic window spans two hops. In an AAIF-governed system, this means the *wrong principal's* scope is recorded as having exercised a capability, which can either mask an over-privileged executor or falsely flag a correctly-behaving orchestrator. 3. **Irrecoverable post-hoc.** Because the MCP server discarded the inbound context and minted fresh roots, the true parentage is not recoverable from the stored spans. The only remedy is to fix propagation at the source and re-run; the historical graph cannot be repaired by re-joining. The guardrail is a **propagation completeness check** at graph-build time: for every A2A task span, assert that its `traceparent` parent resolves to an existing span in the graph, and for every MCP tool span, assert that its adopted parent resolves to the invoking A2A span. Any span whose parent does not resolve is quarantined into an `orphaned_spans` partition and excluded from causal queries until manually reconciled. This converts a silent mis-join into a loud, bounded omission. ```python from dataclasses import dataclass from typing import Optional class CausalCorrelationError(RuntimeError): """Raised when a span's asserted parent cannot be resolved in the causal graph.""" @dataclass class Span: layer: str # "mcp" | "a2a" | "aaif" span_id: str parent_id: Optional[str] trace_id: str certainty: str # "asserted" | "inferred" def build_causal_graph(spans: list[Span]) -> dict[str, list[str]]: """Join spans into a parent->children map, failing closed on unresolved parents.""" by_id = {s.span_id: s for s in spans} graph: dict[str, list[str]] = {} for span in spans: if span.parent_id is None: # Root span: permitted only if it is the originating A2A task. if span.layer != "a2a": raise CausalCorrelationError( f"non-A2A span {span.span_id} ({span.layer}) has no parent; " "MCP and AAIF spans must adopt a propagated parent" ) graph.setdefault(span.span_id, []) continue parent = by_id.get(span.parent_id) if parent is None: # Parent was dropped or never propagated across a hop. raise CausalCorrelationError( f"span {span.span_id} ({span.layer}) asserts parent " f"{span.parent_id} which is absent from the graph; " "quarantine to orphaned_spans rather than infer a join" ) if span.certainty == "inferred": # Inferred edges may annotate but must not be promoted to asserted. if span.layer in ("mcp", "aaif"): raise CausalCorrelationError( f"span {span.span_id} ({span.layer}) reached the graph via " "heuristic join; attribution queries must not traverse it" ) graph.setdefault(span.parent_id, []).append(span.span_id) return graph def assert_attribution_safe(graph: dict[str, list[str]], spans: list[Span]) -> None: """Reject graphs where any asserted edge is actually inferred, before audit use.""" by_id = {s.span_id: s for s in spans} for parent, children in graph.items(): for child in children: if by_id[child].certainty != "asserted": raise CausalCorrelationError( f"attribution query over edge {parent}->{child} rejected: " f"certainty={by_id[child].certainty}" ) ```