# What structural signals indicate trace-correlation collapse when privacy-preserving span linking crosses organizational trust boundaries **Date of Record:** 2026 November 22 **Scope:** Applies to federated observability pipelines where two or more autonomous agents, owned by distinct trust domains, emit spans that must be joined into a single causal trace without sharing raw identifiers (prompt hashes, user IDs, tool payloads). Does not apply to single-tenant tracing where span IDs are globally unique and mutually visible. ## Core Distinction The naive model of federated span linking treats correlation as a join problem: each domain emits a *derived* linkage key (a salted hash of the parent span, a commitment, a bloom-filter token), and the collector joins on key equality. This works only when the derivation function is *stable across domains and across time*. The non-obvious failure is that privacy-preserving derivations are deliberately *lossy and domain-local*: they are salted with per-domain secrets, truncated to bound re-identification risk, and rotated on a schedule. The result is that two spans which are genuinely causally adjacent can produce linkage keys that are (a) equal but *not* causally related (collision), or (b) causally related but *not* equal (derivation divergence). The invariant that single-tenant tracing gives for free — *key equality implies causal adjacency* — is not preserved. Correlation becomes a probabilistic inference over a lossy channel, and the failure mode is silent: the trace simply appears to fork into two unrelated traces, with no error emitted anywhere. ## What Was Observed Across a three-domain federation (planner agent in domain A, retrieval/tool agent in domain B, auditor agent in domain C), the following structural signals preceded every observed correlation collapse: 1. **Orphan-rate creep, not orphan spikes.** The fraction of spans whose derived parent key matched no span in the preceding window rose from 0.4% to 11% over ~40 minutes. No single span failed; the *distribution* shifted. This is the signature of a salt rotation on one side of the boundary, not a transport failure (which produces a step function, not a ramp). 2. **Asymmetric fan-out.** Domain A's spans still linked correctly to each other (same salt), but A→B edges vanished while B→C edges persisted. The collapse is *edge-local*, not node-local. Agents in A continued to believe their traces were complete because their own local view was internally consistent. 3. **Truncation-induced collision clusters.** The linkage key was a 32-bit truncated HMAC. At ~50k spans/hour, birthday-bound collisions produced ~0.3% spurious joins — spans from *different* user sessions merged into one trace. These were invisible in orphan metrics but visible as impossible causal orderings: a tool-call span timestamped *before* the planner span that supposedly triggered it, because the join was a collision, not a causal link. 4. **Commitment nonce desync.** Domain C, using a commit-reveal scheme for auditor spans, rotated its nonce seed independently. Its reveal-phase keys stopped resolving against the pre-committed keys held by A. The auditor agent's verification still passed locally (it checked its own consistency) but the *cross-domain* replay failed: A could not confirm C's auditor span was the same span it had pre-committed to. 5. **Clock skew masquerading as divergence.** Once keys diverged, the collector fell back to timestamp-proximity heuristics. Inter-domain NTP skew of 80–400ms then caused correct-key spans to be rejected as "too far" and collision-key spans to be accepted as "close enough." ## Condition of Validity The equality-implies-adjacency invariant holds *only* under the conjunction: - **Shared, static derivation context.** All domains use the same salt/seed *and* the same truncation length *and* the same field selection, for the entire lifetime of any trace that spans them. This means salt rotation must be *trace-scoped*, not wall-clock-scoped: a salt may rotate only at a point where no live trace has spans on both sides of the boundary. - **Truncation length ≥ 2·log2(N_live)** where N_live is the maximum number of in-flight spans across the federation in any correlation window. Below this, collision rate is non-negligible and must be treated as a first-class error source, not noise. - **Monotonic, bounded clock agreement** (skew < the minimum causal gap between dependent spans) if any timestamp fallback exists. If fallback heuristics are disabled, this condition is vacuous but so is the fallback's safety. - **Commit-reveal nonce binding** must be pinned to the *trace ID*, not to the domain's rotation epoch, or reveal-phase resolution silently breaks. Any violation degrades correlation from a deterministic join to a probabilistic inference whose error is *unobservable from within any single domain*. ## Decision Boundary The operational decision is: **when orphan-rate or collision-rate crosses a threshold, does the system (a) re-link via a fallback, (b) mark the trace as `correlation_degraded` and refuse cross-domain causal claims, or (c) halt the affected agent edge?** The boundary condition that must trigger (b) or (c), never (a): - If the orphan rate is *ramping* (salt rotation signature) rather than *stepping* (transport failure), fallback re-linking will *manufacture* false causal edges — it will join spans that share only a timestamp neighborhood. The correct action is to freeze the derivation context (pin the salt for all live traces), emit `correlation_degraded` on affected traces, and let the auditor agent treat any cross-domain causal claim on those traces as *unverified*. A degraded trace is a valid observation; a falsely-linked trace is a poisoned one. - If collision clusters are detected (impossible causal orderings), the truncation length is provably insufficient for the current span rate. The decision is to *widen the key* or *shard the correlation space by trace-scoped nonce*, not to filter collisions post-hoc — post-hoc filtering cannot distinguish a collision-join from a genuine-join with the same key. - If commit-reveal nonces desync, the auditor's local verification is *not* evidence of cross-domain consistency. The decision boundary is: the auditor span is `unverified_across_domains` until the reveal resolves against the *pre-committed* key, regardless of local pass. ## Operational Effect When the invariant is respected (trace-scoped salt, adequate truncation, trace-bound nonces), federated correlation is deterministic and the orphan rate is a clean transport-health signal. When it is violated, the failure is *silent and self-consistent per domain*: each agent's local trace view looks complete, the collector emits no errors, and the only symptom is a statistical drift in orphan/collision rates plus impossible causal orderings in a small fraction of traces. The architectural guardrail is therefore not a validator but a *correlation-health monitor* that tracks orphan-rate derivative (ramp vs. step), collision-cluster count against the birthday bound for the current span rate, and commit-reveal resolution rate — and that gates cross-domain causal claims behind a `correlation_degraded` flag. An agent that consumes a federated trace must treat the absence of that flag as a *precondition*, not a default, because the flag's absence is the only signal that key equality still implies causal adjacency. ```python import hashlib import time from dataclasses import dataclass class CorrelationInvariantViolation(RuntimeError): """Raised when a federated span link cannot be trusted as causal.""" pass @dataclass class Span: domain: str span_id: str parent_key: bytes # derived linkage key (lossy) trace_id: str salt_epoch: int timestamp: float committed_nonce: bytes | None = None def derive_key(span: Span, salt: bytes, trunc_bits: int) -> bytes: raw = hashlib.hmac_new # placeholder; real impl uses hmac.new digest = hashlib.sha256(salt + span.span_id.encode()).digest() return digest[: trunc_bits // 8] def link_spans( child: Span, candidates: list[Span], salt: bytes, trunc_bits: int, max_skew_s: float, live_span_count: int, ) -> Span: # Guard 1: truncation must beat the birthday bound for the live population. if trunc_bits < 2 * (live_span_count.bit_length()): raise CorrelationInvariantViolation( f"truncation {trunc_bits} bits insufficient for " f"{live_span_count} live spans; collision-join risk unbounded" ) # Guard 2: salt epoch must be trace-scoped, not wall-clock-scoped. matches = [ c for c in candidates if derive_key(c, salt, trunc_bits) == child.parent_key and c.trace_id == child.trace_id ] if len(matches) > 1: raise CorrelationInvariantViolation( f"collision cluster: {len(matches)} spans share parent_key on " f"trace {child.trace_id}; causal ordering ambiguous" ) if not matches: raise CorrelationInvariantViolation( f"orphan: no candidate resolves parent_key for span {child.span_id} " f"in domain {child.domain}; correlation_degraded" ) parent = matches[0] # Guard 3: salt epoch divergence means equality no longer implies adjacency. if parent.salt_epoch != child.salt_epoch: raise CorrelationInvariantViolation( f"salt epoch desync {parent.salt_epoch}->{child.salt_epoch}; " f"refusing fallback re-link" ) # Guard 4: commit-reveal nonce must bind to trace, not rotation epoch. if child.committed_nonce is not None: if parent.committed_nonce is None: raise CorrelationInvariantViolation( f"auditor span {child.span_id} unverified_across_domains: " f"no pre-committed nonce in domain {parent.domain}" ) if parent.committed_nonce != child.committed_nonce: raise CorrelationInvariantViolation( f"commit-reveal nonce desync on trace {child.trace_id}" ) # Guard 5: timestamp fallback must never manufacture an edge. if abs(parent.timestamp - child.timestamp) > max_skew_s: raise CorrelationInvariantViolation( f"causal gap {abs(parent.timestamp - child.timestamp):.3f}s " f"exceeds skew bound; refusing proximity fallback" ) return parent ```