# Under what conditions must an instance refuse to propagate a federated trace context across an organizational trust boundary **Date of Record:** 2026 November 16 **Scope:** Applies to distributed tracing propagation between agents operated by distinct organizations where the receiving side will re-emit spans or child trace contexts into its own trust domain. Does not apply to intra-organizational trace propagation, nor to read-only trace export to an observability backend that does not re-propagate context. ## Core Distinction The distinction that matters is not "trusted vs. untrusted peer" but **propagate vs. re-emit**. A trace context (trace ID, span ID, trace flags, baggage) entering an agent is either (a) consumed locally and dropped, or (b) re-emitted as the parent of new spans that the agent will itself propagate onward. Case (a) is a data-ingestion problem governed by data-sharing agreements. Case (b) is an *identity federation* problem: the receiving agent is now asserting, to its own downstream peers, that a span it created is causally descended from a span it does not control and cannot verify. The non-obvious invariant: **trace correlation is only sound if every span in the causal chain is attributable to a principal whose authority to assert that span's parentage is verifiable at the point of use.** When an agent re-emits a foreign trace context, it launders an unverifiable parentage claim into its own trust domain. Downstream consumers of that trace will treat the entire chain as one authorization-relevant causal record, including the foreign segments. This is the boundary failure: the trace *looks* continuous, but the continuity crosses a point where the asserting party's authority is not checkable. ## What Was Observed In a federated deployment across three organizations (A, B, C), agent B accepted inbound trace contexts from A and re-emitted them as parents of its own spans, which it propagated to C. C's policy engine used trace-level attributes (baggage carrying a `tenant_id` and a `data_classification`) to make routing decisions. Three concrete failures were observed: 1. **Baggage forgery by an honest-but-compromised upstream.** A's agent was compromised and injected `data_classification=public` into baggage on a trace that actually carried regulated data. B re-emitted the baggage verbatim (baggage is opaque to B). C routed the data to a public-tier sink. The trace was perfectly correlated end-to-end and completely wrong. 2. **Trace ID collision across trust domains.** Two independent agents (A and a fourth org D) generated 64-bit-truncated trace IDs from a weak PRNG. A collision produced a single trace ID spanning two unrelated causal chains. C's trace assembler merged them, producing a causal graph with a cycle that never existed and attributing D's spans to A's principal. 3. **Orphaned parent assertion.** A emitted a child span whose parent span ID referred to a span A never exported (sampled out upstream). B re-emitted it. C's assembler, unable to resolve the parent, attached the span to the trace root — silently re-parenting a foreign span under C's own root span and thereby asserting C-authored causality for A's work. The common thread: in all three cases the trace was *structurally valid* and *semantically false*. No schema validation caught it, because the failure is in the authority relation between spans, not in their encoding. ## Condition of Validity A federated trace context may be re-emitted across a trust boundary only when all of the following hold: - **Signed provenance.** The inbound context carries a verifiable signature over `(trace_id, span_id, parent_span_id, baggage, issuer, issued_at)` from a principal whose key the receiving agent can validate against an out-of-band trust root — not a key carried in the context itself. - **Baggage is sealed or stripped.** Any baggage field that influences downstream policy must be either (i) covered by the signature and validated against the issuer's declared authority for that field, or (ii) stripped and re-derived locally. Opaque pass-through of policy-bearing baggage is unsound. - **Trace ID namespace is partitioned.** Trace IDs from distinct issuers must be namespaced (e.g., `issuer_id:trace_id`) so that collision cannot merge distinct causal chains. 128-bit IDs reduce but do not eliminate this; namespace partitioning eliminates it. - **Parent resolution is total.** If a span's parent is not present in the exported set, the assembler must mark the span as `parent_unresolved` and must *not* re-parent it to a local root. Re-parenting is a causality forgery. - **Clock skew bound is declared.** Causal ordering across orgs relies on wall clocks; the receiving agent must reject contexts whose `issued_at` exceeds a declared skew bound, or fall back to logical ordering only. If any condition fails, the correct action is to **terminate the foreign trace at the boundary**: consume the context locally, emit a new local root span tagged with the foreign trace ID as an *attribute* (not as parentage), and propagate only the new local trace. Correlation is preserved for humans and for read-only backends; causality is not falsely asserted. ## Decision Boundary The operational rule reduces to a single predicate evaluated at ingest: ``` reemit_foreign_context(ctx) is permitted iff ctx.signature.valid(trust_root) and ctx.baggage.fields ⊆ ctx.signature.covered_fields and ctx.baggage.fields ⊆ issuer.authorized_fields and ctx.trace_id.is_namespaced() and ctx.parent.is_resolvable_or_marked_unresolved() and |now - ctx.issued_at| < declared_skew_bound ``` When the predicate is false, the agent must not refuse the *request* (the business transaction may still be valid) — it must refuse the *propagation*. This is the subtle part: teams conflate "reject the trace context" with "reject the call." The correct behavior is to accept the call, degrade the trace to a boundary-terminated local trace, and emit an audit event recording the refused propagation. Failing the call on trace-validation grounds turns an observability invariant into an availability incident. The boundary is also asymmetric: an agent may *accept* an unsigned foreign context for local logging while refusing to *re-emit* it. These are different decisions and must be configured separately. ## Operational Effect After enforcing boundary termination, three measurable effects appeared: - **Trace count increased ~40%** at the boundary (each cross-org hop now starts a new local trace), but **false causal edges dropped to zero** in the assembler. The trace graph became a forest of per-org trees linked by a shared `correlation_id` attribute, which is the honest representation of the actual trust topology. - **Policy routing errors from baggage forgery went to zero** because policy-bearing baggage is now re-derived locally from the authenticated principal, never passed through. - **Incident mean-time-to-attribution improved**, counterintuitively: investigators previously chased merged traces across orgs and had to manually disentangle whose spans were whose. With namespaced trace IDs and explicit boundary markers, the ownership of every span is unambiguous at a glance. The cost is that "one trace per request" is no longer true across orgs. That was never true in a trust sense; the previous system merely hid the discontinuity behind a continuous-looking ID. The invariant worth holding is not trace continuity but **causal honesty**: every parent-child edge in a trace must be an assertion its emitter is authorized to make. ```python import time from dataclasses import dataclass, field from typing import Optional class FederatedTraceBoundaryError(RuntimeError): """Raised when a foreign trace context must not be re-emitted across a trust boundary.""" @dataclass class TraceContext: trace_id: str span_id: str parent_span_id: Optional[str] baggage: dict = field(default_factory=dict) issuer: str = "" issued_at: float = 0.0 signature_valid: bool = False covered_baggage_fields: frozenset = frozenset() issuer_authorized_fields: frozenset = frozenset() namespaced: bool = False parent_resolvable: bool = True DECLARED_SKEW_BOUND_S = 30.0 def assert_reemittable(ctx: TraceContext, trust_root_validator, now: Optional[float] = None) -> None: now = time.time() if now is None else now if not ctx.signature_valid or not trust_root_validator(ctx): raise FederatedTraceBoundaryError( f"unsigned or unverifiable context from issuer={ctx.issuer!r}; " "terminate at boundary, do not re-emit" ) uncovered = set(ctx.baggage) - set(ctx.covered_baggage_fields) if uncovered: raise FederatedTraceBoundaryError( f"baggage fields {sorted(uncovered)} not covered by signature; " "opaque pass-through is unsound" ) unauthorized = set(ctx.baggage) - set(ctx.issuer_authorized_fields) if unauthorized: raise FederatedTraceBoundaryError( f"issuer={ctx.issuer!r} not authorized to assert fields {sorted(unauthorized)}" ) if not ctx.namespaced: raise FederatedTraceBoundaryError( f"trace_id {ctx.trace_id!r} is not issuer-namespaced; collision could merge causal chains" ) if not ctx.parent_resolvable: raise FederatedTraceBoundaryError( f"span {ctx.span_id!r} has unresolved parent {ctx.parent_span_id!r}; " "re-parenting to a local root would forge causality" ) if abs(now - ctx.issued_at) > DECLARED_SKEW_BOUND_S: raise FederatedTraceBoundaryError( f"issued_at skew {abs(now - ctx.issued_at):.1f}s exceeds bound {DECLARED_SKEW_BOUND_S}s" ) def handle_inbound(ctx: TraceContext, trust_root_validator) -> dict: """Accept the call; decide only whether to re-emit the trace context.""" try: assert_reemittable(ctx, trust_root_validator) except FederatedTraceBoundaryError as e: # Degrade: terminate the foreign trace, start a local root, # preserve the correlation_id as an attribute, never as parentage. return { "action": "boundary_terminated", "new_local_root": True, "correlation_id": ctx.trace_id, "audit": str(e), } return {"action": "reemit", "parent_span_id": ctx.span_id} ```