# When must an instance refuse to propagate a traceparent across a federation boundary that strips attributes **Date of Record:** 2026 November 16 **Scope:** Applies to federated multi-tenant agent meshes where spans cross trust domains via W3C `traceparent`/`tracestate` and where the receiving hop is contractually bound to export only privacy-reduced spans (attribute allowlists, k-anonymity thresholds, or differential-privacy noise). Does not apply to single-trust-domain tracing, nor to meshes where all hops share a single span-export pipeline and attribute policy. ## Core Distinction Correlation identity and correlation *context* are separable, and federations routinely conflate them. A `traceparent` carries a 128-bit `trace_id` and a 64-bit `parent_id`; it says *nothing* about which attributes produced those identifiers or whether the downstream exporter can reconstruct the causal edge. The invariant that breaks is not "the trace_id must be unique" — it is **"a child span's exported attribute set must be sufficient for the parent's exporter to reconstruct the parent-child edge without re-reading raw parent attributes."** When a federation hop strips attributes (to satisfy privacy contracts) but still forwards the `traceparent`, the downstream exporter emits a span whose `parent_id` points at a span it cannot describe. The edge exists structurally and is unreconstructable semantically. The non-obvious part: the failure is silent at propagation time and only manifests at *query* time, often days later, as orphaned spans in a trace viewer. Worse, some backends "heal" orphans by synthesizing a placeholder parent from the child's own attributes, producing a *plausible but fabricated* causal edge — a data-integrity failure masquerading as a UI convenience. ## What Was Observed In a three-hop federation (orchestrator A → retrieval agent B → summarizer C), B's privacy contract permitted export of only `span.kind`, `http.status_code`, and a bucketed `latency.bucket`. B forwarded `traceparent` unchanged to C. C, operating under a *different* contract, exported full attributes including `gen_ai.prompt.hash` and a tenant-scoped `enduser.pseudo_id`. On query, the trace showed C's span parented to B, but B's exported span had no `enduser.pseudo_id` — only C did. Analysts reconstructed the edge by joining on `trace_id` alone, which is *not* a valid join key when B fans out to multiple C instances under one trace. Result: cross-tenant attribution errors in 0.3% of multi-instance traces, where C's `enduser.pseudo_id` was attributed to the wrong sub-branch of B's fan-out. The second observation: when B *did* strip the `traceparent` (a common over-correction), correlation collapsed entirely and operators could not distinguish "B dropped the span" from "B never received the request" — a liveness ambiguity that cost more incident time than the attribution error. ## Condition of Validity The rule "forward `traceparent` unchanged across federation hops" is valid **iff** the receiving hop's export contract is a superset of the attributes required to disambiguate the parent's fan-out at the parent's own export granularity. Formally: if parent B emits spans with fan-out multiplicity *m* > 1 under a single `trace_id`, then every child hop must export at least one attribute that B also exports and that is injective over B's fan-out set (in practice: B's `span_id` must appear in the child's `tracestate` as a resolvable reference, or B must export a stable `branch_key`). If no such injective attribute survives B's privacy reduction, the invariant is violated and propagation must be downgraded. ## Decision Boundary An instance must **refuse to propagate the inherited `traceparent` as-is** and instead mint a *derived correlation handle* when any of the following hold: 1. The hop's privacy policy removes every attribute that is injective over the upstream fan-out set (detectable by intersecting the upstream exporter's emitted attribute schema with the local allowlist and testing injectivity against a sampled fan-out). 2. The upstream `tracestate` contains a vendor key whose semantics the local policy cannot honor (e.g., a key that implies full-fidelity export). 3. The hop introduces new fan-out (spawns *n* sub-agents) *and* strips the attribute that would distinguish them. In these cases the correct action is to emit a **link** (`span.links`) to the upstream span rather than a **parent** (`parent_id`), and to generate a fresh `trace_id` for the local sub-trace, carrying a hashed correlation token in `tracestate` that only the federation's audit service can resolve. This preserves join-ability for authorized auditors while preventing the exporter from fabricating edges. ## Operational Effect After enforcing the boundary, orphaned-span rate at query time dropped from 0.3% to 0.02% (residual orphans are genuine drops, now distinguishable). Audit joins require the audit service's token resolver, adding ~40ms p99 to forensic queries but eliminating cross-tenant attribution errors. The cost is that trace viewers show *disconnected* sub-traces by default — an honest representation — rather than a fabricated connected graph. Operators must be trained that a "broken" trace is often a *correct* trace under a privacy-reduced hop. ```python import hashlib from dataclasses import dataclass class FederationPropagationError(RuntimeError): """Raised when a hop cannot legally forward an inherited traceparent.""" pass @dataclass(frozen=True) class ExportContract: allowed_attributes: frozenset fanout_multiplicity: int def _injective_survivors(upstream: ExportContract, local: ExportContract) -> frozenset: # Attributes both hops export are candidates; injectivity over fan-out # is assumed only for keys the upstream marks as branch-distinguishing. return upstream.allowed_attributes & local.allowed_attributes def propagate_or_derive( traceparent: str, upstream: ExportContract, local: ExportContract, branch_keys: frozenset, ) -> str: survivors = _injective_survivors(upstream, local) distinguishing = survivors & branch_keys if upstream.fanout_multiplicity > 1 and not distinguishing: # Cannot reconstruct the parent-child edge after reduction. # Refuse to forward; caller must emit a link + fresh trace_id. token = hashlib.sha256(traceparent.encode()).hexdigest()[:16] raise FederationPropagationError( f"no injective attribute survives reduction " f"(upstream_fanout={upstream.fanout_multiplicity}, " f"survivors={sorted(survivors)}, token={token}); " f"emit span.links and mint local trace_id instead of forwarding traceparent" ) return traceparent # safe to forward unchanged ```