# What structural signals indicate trace-context divergence when delegating agents cross organizational boundaries under OTel GenAI semantics **Date of Record:** 2026 November 24 **Scope:** Applies to multi-agent systems where a delegating agent (caller) invokes a downstream agent (callee) owned by a different organizational trust domain, and both emit OpenTelemetry GenAI spans (`gen_ai.*` semantic conventions) that are expected to stitch into a single distributed trace. Does not apply to intra-org delegation where a shared collector, shared trace-ID authority, and shared baggage policy exist. ## Core Distinction The failure is not "the trace is missing." It is that the trace *appears complete* while being silently forked. Two distinct mechanisms produce this and must not be conflated: - **Propagation loss** — the `traceparent`/`tracestate` header is dropped or rewritten, so the callee emits a *new root* trace. This is loud: the child span has no parent, `parent_span_id` is empty, and trace-ID cardinality explodes. Detectable by counting orphan roots per callee. - **Propagation *corruption*** — the header survives transport but its `tracestate` vendor list and the `gen_ai.*` baggage carrying delegation context (`gen_ai.conversation.id`, delegation depth, warrant tokens) are truncated, reordered, or stripped by an intermediary that only honors the W3C minimum. The callee joins the *correct* trace but reconstructs a *wrong* delegation chain. This is quiet: `trace_id` matches, `parent_span_id` is populated, dashboards show 100% trace continuity, yet the reconstructed causal graph is a fabrication. The operational invariant at stake: **trace continuity (same `trace_id`) is necessary but not sufficient for delegation-chain integrity.** A stitched trace proves spans shared an identifier; it does not prove the delegation edge was faithfully transmitted. Cross-org boundaries are exactly where these two properties decouple. ## What Was Observed A caller agent in Org A delegates a sub-task to a callee agent in Org B over an A2A-style JSON-RPC call. The caller injects context via the standard OTel propagator. Three concrete divergence signatures were observed in production traces: 1. **`tracestate` truncation past the 32-member / 512-byte limit.** Org A's `tracestate` carried multiple vendor entries plus a custom `deleg=` entry encoding delegation depth and the caller's signed warrant reference. Org B's edge proxy, enforcing the W3C spec's size cap, truncated the list *from the right*, dropping `deleg=`. The callee received a valid `traceparent` (correct `trace_id`, correct `parent_span_id`) but no delegation metadata. Its emitted `gen_ai.agent.delegation_depth` attribute defaulted to `1` regardless of true depth. A 4-hop chain was recorded as four independent 1-hop delegations sharing one trace-ID — visually a single trace, causally four disconnected edges. 2. **`gen_ai.conversation.id` collision under independent ID authorities.** Both orgs minted conversation IDs from independent generators with overlapping formats. When the callee's baggage was stripped (see #1) it fell back to its *own* conversation-ID minting, producing a value that happened to collide with a different, unrelated conversation in Org A's store. Retrieval-based trace joins then merged two unrelated delegation histories. The join succeeded; the result was wrong. 3. **Sampling-flag propagation asymmetry.** The caller set `sampled=1` in `traceparent` flags. Org B's collector applied tail-based sampling keyed on its *own* error policy and dropped 40% of child spans while retaining the parent. The trace "completed" with a parent and no children — indistinguishable, at the dashboard layer, from a callee that never executed. Root-cause analysis repeatedly misattributed callee non-execution to callee failure. The common structural signal across all three: **the reconstructed span tree satisfied every syntactic continuity check (`trace_id` match, non-null `parent_span_id`, monotonic timestamps) while violating the semantic delegation invariant (child depth = parent depth + 1, single warrant lineage, single conversation authority).** ## Condition of Validity The guardrail below is valid only when all of the following hold; outside them, treat the trace as untrusted for delegation reasoning: - The `gen_ai.*` delegation attributes are treated as **claims**, not facts, and are only trusted when accompanied by a verifiable warrant reference whose signature chains to the caller's org key. - A single **conversation-ID authority** is designated per trace; any span whose `gen_ai.conversation.id` was minted by a non-authority MUST be flagged, not merged. - Sampling decisions are **propagated, not re-decided**, across the org boundary (child honors parent's sampled flag or explicitly records a `sampling_override` event). - The `tracestate` size budget is **reserved** for delegation metadata before vendor entries are appended, so truncation cannot silently evict the `deleg=` entry. If any condition is unmet, the correct operational posture is to record the trace as *delegation-unverified* rather than to infer the chain. ## Decision Boundary The boundary is between **repairing** a trace and **rejecting** it: - If `trace_id` matches but `delegation_depth` is non-monotonic (child ≤ parent) → the delegation edge is corrupted; **reject the edge**, do not infer depth from hop count. - If `trace_id` matches and depth is monotonic but the warrant reference is absent or unverifiable → **mark delegation-unverified**; usable for latency analysis, forbidden for authorization or audit. - If `trace_id` differs (orphan root) → propagation loss; **repair by re-linking** only if a signed correlation token exists out-of-band; otherwise treat as a separate trace. - If parent sampled but children absent → **do not conclude callee non-execution**; check for sampling-flag asymmetry before attributing failure. The invariant to enforce in code: *a delegation edge is admitted into the causal graph iff (a) `trace_id` and `parent_span_id` link, (b) `delegation_depth` increments by exactly one, (c) the warrant reference verifies, and (d) the conversation ID matches the designated authority.* Any single failure demotes the edge to unverified rather than silently accepting it. ## Operational Effect Enforcing this boundary converts a class of silent, plausible-looking trace corruption into an explicit, countable signal. In the observed deployment, after adding the depth-monotonicity and warrant-verification checks, ~7% of cross-org delegation edges were reclassified from "complete" to "delegation-unverified" — edges that had previously fed an authorization decision path and an SLA attribution dashboard. The immediate cost was a visible drop in apparent trace completeness; the benefit was that root-cause analyses stopped attributing callee *failures* to callees that had actually executed but been sampled out, and stopped authorizing downstream actions on forged depth chains. The durable lesson: **`trace_id` continuity is a transport property, not a trust property.** Delegation integrity must be re-established at every org boundary from signed, size-budgeted, monotonic metadata — never inferred from the mere fact that spans share a trace. ```python from dataclasses import dataclass class DelegationTraceIntegrityError(RuntimeError): """Raised when a cross-org delegation edge satisfies syntactic trace continuity but violates the semantic delegation invariant.""" pass @dataclass class Span: trace_id: str parent_span_id: str | None span_id: str delegation_depth: int conversation_id: str warrant_ref: str | None sampled: bool def admit_delegation_edge( parent: Span, child: Span, *, conversation_authority: str, verify_warrant, ) -> None: # (a) syntactic continuity if child.trace_id != parent.trace_id: raise DelegationTraceIntegrityError( f"propagation loss: trace_id mismatch " f"{parent.trace_id!r} != {child.trace_id!r}" ) if child.parent_span_id != parent.span_id: raise DelegationTraceIntegrityError( f"parent_span_id {child.parent_span_id!r} does not link to {parent.span_id!r}" ) # (b) depth monotonicity — the silent-corruption detector if child.delegation_depth != parent.delegation_depth + 1: raise DelegationTraceIntegrityError( f"delegation depth non-monotonic: parent={parent.delegation_depth} " f"child={child.delegation_depth} (tracestate truncation suspected)" ) # (c) warrant lineage must verify, not merely be present if child.warrant_ref is None or not verify_warrant(child.warrant_ref): raise DelegationTraceIntegrityError( f"delegation-unverified: warrant_ref={child.warrant_ref!r} " f"failed verification for span {child.span_id}" ) # (d) single conversation authority if child.conversation_id != conversation_authority: raise DelegationTraceIntegrityError( f"conversation-ID authority violation: {child.conversation_id!r} " f"!= authority {conversation_authority!r} (collision risk)" ) # (e) sampling must be propagated, not re-decided if parent.sampled and not child.sampled: raise DelegationTraceIntegrityError( f"sampling-flag asymmetry: parent sampled, child {child.span_id} dropped" ) ```