# Where must an instance refuse to inherit a parent trace context: the cross-org trace-parent laundering failure in federated agent handoffs **Date of Record:** 2026 November 30 **Scope:** Applies to any multi-agent system in which an agent under org A's trust domain invokes an agent under org B's trust domain and propagates W3C `traceparent`/`tracestate` (or an equivalent correlation header) across the boundary. Does not apply to intra-org fan-out where a single control plane owns the trace store, nor to purely synchronous RPC where the callee's response is the only observable. ## Core Distinction There are two kinds of trace propagation across a trust boundary, and they are conflated by every naive SDK default: 1. **Correlation** — "this B-side span belongs to the same logical user request as that A-side span." Correlation is a *weak* claim: it asserts co-membership in a causal chain. It is safe to carry across orgs because it leaks only the fact of a call, not the authority behind it. 2. **Lineage authority** — "the B-side span was executed under the same warrant, budget, and audit obligation as the A-side span." Lineage authority is a *strong* claim. When agent B inherits A's `traceparent` verbatim, downstream auditors, budget meters, and policy engines that key off the trace ID will treat B's actions as A's actions. The boundary failure is that the second claim is inherited silently when only the first was intended. The trace ID becomes a bearer token for authority it was never meant to carry. ## What Was Observed A federated procurement agent topology: org A runs a `PlannerAgent`; org B runs a `QuoteAgent` exposed over A2A. A's planner receives a user task, mints a fresh 128-bit trace ID `T`, and calls B's agent with: ``` traceparent: 00-T-A-spanA-01 tracestate: tenant=A, budget_id=A-7731, warrant=w_A_9f2 ``` B's A2A server, using an off-the-shelf OpenTelemetry interceptor, does what every interceptor does: it extracts the parent context, creates a child span `spanB` with the *same* trace ID `T`, and — critically — copies `tracestate` forward unmodified into every span it emits, including spans emitted by B's own sub-agents and its own tool-call retries. The failure surfaced downstream, not at the boundary. Three concrete traces: - **Budget double-count.** A's cost meter aggregates by trace ID. B's internal retries (four LLM calls on a flaky tool) all carry `T`. A's meter attributed 4× B's spend to A's `budget_id=A-7731`, tripping A's hard budget ceiling mid-task and aborting a transaction that was, on A's ledger, only 30% consumed. - **Warrant forgery by accident.** B's policy engine reads `warrant=w_A_9f2` from inherited `tracestate` and — because the warrant parser trusts any well-formed warrant in the trace state — authorized a B-side write action against a resource that the warrant's scope did not cover. B did not intend to honor A's warrant; it merely echoed it. - **Audit replay divergence.** When A's auditor replayed trace `T` to reconstruct the decision, it saw B's spans as if they were A-owned, and reconstructed a decision graph in which A appeared to have made B's tool calls. The replay diverged from B's own audit log by 11 spans. The trigger condition is precise: **the callee's tracing interceptor copies `tracestate` into child spans without re-issuing it under the callee's own trust domain, and at least one downstream consumer keys authority, budget, or audit scope off `tracestate` rather than off a separately authenticated warrant channel.** The state transition: ``` A.mint(T, tracestate_A) → A.call(B, traceparent=T/spanA, tracestate_A) → B.extract() [inherits T, tracestate_A verbatim] ← boundary not marked → B.child_span(spanB, trace=T, tracestate=tracestate_A) → B.tool_retry() × 4 [all under T, tracestate_A] → A.meter.aggregate(by=T) [attributes B spend to A budget] → B.policy.read(tracestate_A.warrant) [honors foreign warrant] ``` The invariant that was violated: **a trace ID may cross a trust boundary; a `tracestate` entry that carries authority, budget, or audit scope may not.** ## Condition of Validity Inheriting a parent trace context across an org boundary is valid only if *all* of the following hold: 1. The callee re-issues `tracestate` under its own tenant key and strips any key whose semantics are authority-bearing (`warrant`, `budget_id`, `audit_scope`, `delegation`). Correlation keys (`tenant`, `sampled`, `region`) may pass through. 2. The callee records an explicit **boundary span** — a span whose `span.kind` is `PRODUCER` toward the caller and which carries an attribute `trust.boundary=crossed` plus the callee's authenticated identity. This span is the anchor that lets a replay distinguish "B acted under A's trace" from "B acted under A's authority." 3. Any consumer that keys budget, warrant, or audit scope off trace state reads it from an *authenticated* channel (mTLS peer identity, signed A2A envelope), not from the unauthenticated `tracestate` header. 4. The trace ID itself is treated as a *correlation namespace*, not a capability. Possession of `T` grants no rights. If any of these is absent, the system is in the failure regime. The most common omission is #1, because every tracing SDK's default extractor preserves `tracestate` verbatim. ## Decision Boundary The decision an engineer must make at the boundary is not "propagate or don't" — it is **which fields are correlation and which are authority**, and that classification must be enforced by code, not convention. - Fields classified as **correlation** (trace ID, span ID, sampling flag, region hint): propagate freely; they are safe to inherit. - Fields classified as **authority** (warrant, budget, delegation chain, audit scope): must be *re-derived* by the callee from the authenticated peer, never inherited. If the callee cannot authenticate the peer, it must drop them and emit the boundary span with `trust.boundary=unverified`. - The callee must **fail closed** on ambiguity: if a `tracestate` key is unrecognized and looks authority-bearing (contains `warrant`, `budget`, `scope`, `delegat`), drop it and log a `ForeignAuthorityKeyDropped` event rather than passing it through. The boundary is crossed correctly when a replay can answer, from the trace alone, both "was this span executed by A or B?" and "under whose authority?" — and those two answers are allowed to differ. ## Operational Effect After enforcing the re-issue invariant: - Budget meters keyed by trace ID must be scoped by `(trace_id, tenant)` — the composite key, not the trace ID alone. A's meter stops counting B's retries; A's abort at 30% no longer fires. - Warrant parsers reject any warrant whose issuer tenant does not match the authenticated peer. The accidental authorization disappears because the foreign warrant is dropped at the boundary span. - Audit replay gains a hard anchor: the `trust.boundary=crossed` span is the single point where lineage authority changes hands, so replay reconstructs two decision subgraphs joined by an explicit edge, not one fused graph. The 11-span divergence collapses to a single boundary edge. - The cost is that trace IDs are no longer globally unique across the federation's *authority* view — two tenants may share `T`. This is correct: `T` identifies a request, not a principal. Any system that assumed trace-ID uniqueness implied principal uniqueness must be migrated to composite keys. The residual risk is that a downstream consumer still keys on bare `T`. That is a separate defect, but the boundary span makes it detectable: a replay that sees authority-bearing decisions attributed to a span with no `trust.boundary` ancestor is provably wrong. ``` ```python class TraceLineageViolation(RuntimeError): """Raised when authority-bearing tracestate crosses a trust boundary un-reissued.""" pass AUTHORITY_BEARING = ("warrant", "budget_id", "audit_scope", "delegation") def reissue_tracestate( incoming: dict, callee_tenant: str, peer_authenticated: bool, ) -> dict: """ Called by the callee's tracing interceptor at the trust boundary. Correlation keys pass through; authority keys are dropped unless the callee can re-derive them from an authenticated peer. """ if not peer_authenticated: # Fail closed: unauthenticated peer cannot confer authority. for key, _ in incoming.items(): if any(marker in key for marker in AUTHORITY_BEARING): raise TraceLineageViolation( f"unauthenticated peer attempted to pass authority-bearing " f"tracestate key {key!r}; boundary must drop or reject" ) reissued = {} for key, value in incoming.items(): if any(marker in key for marker in AUTHORITY_BEARING): # Authority is re-derived from the authenticated peer, never inherited. continue reissued[key] = value reissued["tenant"] = callee_tenant reissued["trust.boundary"] = "crossed" return reissued def emit_boundary_span(trace_id: str, callee_tenant: str, incoming: dict) -> dict: if not trace_id or len(trace_id) != 32: raise TraceLineageViolation(f"malformed trace_id {trace_id!r}") try: state = reissue_tracestate(incoming, callee_tenant, peer_authenticated=True) except TraceLineageViolation: # Emit an unverified boundary span so replay can still anchor. state = {"tenant": callee_tenant, "trust.boundary": "unverified"} return { "trace_id": trace_id, "span.kind": "PRODUCER", "trust.boundary": state["trust.boundary"], "tracestate": state, } ```