# When must an instance refuse to correlate a federated trace span whose redacted attributes still leak joinable structure **Date of Record:** 2026 November 27 **Scope:** Applies to multi-agent systems that emit OpenTelemetry-style spans across trust domains and perform cross-domain trace correlation (trace_id/span_id stitching, parent reconstruction, causal ordering) after privacy-preserving attribute redaction. Does not apply to single-domain tracing where all spans share one trust boundary and one redaction policy. ## Core Distinction There are two different things an agent can mean by "correlating a federated span." The first is *identifier stitching*: joining spans into a causal tree using `trace_id`, `span_id`, and `parent_span_id` — structural metadata that redaction policies almost never touch, because it looks like plumbing. The second is *attribute correlation*: attaching meaning to those spans by matching redacted attributes (hashed tenant IDs, bucketed latencies, k-anonymized regions) against a reference set. The failure mode lives in the gap: redaction is designed to defeat *re-identification of a subject*, but correlation is a *join*, and joins are defeated by a different property — non-joinability. A redaction scheme can be perfectly privacy-preserving per-span (each attribute individually indistinguishable from k−1 others) while the *combination* of surviving attributes plus the span graph is a near-unique fingerprint. The instance is then correlating on structure that redaction never claimed to remove. The invariant that must hold is not "no attribute identifies a subject" but "no tuple of (redacted attributes, graph position, timing bucket) narrows the candidate set below the correlation threshold." ## What Was Observed A three-agent pipeline (planner → executor → auditor) federated spans to a shared collector. The redaction layer replaced tenant identifiers with salted hashes, replaced exact timestamps with 1-second buckets, and dropped free-text. An auditor agent was tasked with reconstructing causal chains to detect error compounding. The leakage trace: 1. The redaction salt was rotated per emitting domain, so `hash(tenant_A)` from the planner domain and `hash(tenant_A)` from the executor domain were *different strings*. Naive equality joins failed — the auditor saw zero cross-domain matches and reported "no causal chain," a silent false negative. 2. The auditor's fallback heuristic was to join on `(parent_span_id, latency_bucket, region)`. Because `parent_span_id` is structural and never redacted, and because the three agents in a pipeline have characteristic latency profiles (planner ~800ms, executor ~120ms, auditor ~40ms), the tuple `(parent_span_id, latency_bucket)` was effectively a *role fingerprint*. 3. In a 1-second bucket, a single pipeline run produced a unique `(parent_span_id, 3-tuple of latency buckets, region)` combination. The auditor reconstructed the full chain — including which tenant — without ever matching a redacted attribute. The hash rotation had been bypassed entirely by structural inference. The per-span privacy audit passed. The correlation audit was never run. The redaction was valid; the *correlation* was the leak. ## Condition of Validity Correlation across redacted federated spans is only valid when all three of the following hold: - **Salt agreement:** the redaction function is keyed identically (or via a commutative mapping) across every domain whose spans will be joined. Per-domain salt rotation makes attribute joins impossible by construction and forces agents onto structural heuristics — the exact path that leaked here. - **Graph-position non-identifiability:** the tuple `(parent_span_id, child_count, depth, latency_bucket)` must not be unique within the candidate set. If any pipeline topology is deterministic, its span graph *is* the identifier, and redaction of attributes is decorative. - **Bucket cardinality floor:** timing buckets must be coarse enough that the number of distinct runs sharing a bucket exceeds the correlation threshold k. A 1-second bucket on sub-second pipelines yields k=1. When any condition fails, the instance must treat the span as *uncorrelatable* and emit an explicit gap marker rather than a best-effort join. A recorded gap is auditable; an inferred join is a privacy incident disguised as telemetry. ## Decision Boundary The instance must refuse correlation — and raise — at the moment it is about to join on a structural heuristic *because* attribute joins returned empty. That empty result is the signal, not an obstacle. The boundary is: - Attribute join succeeds under agreed salt → correlate, record the join key. - Attribute join returns empty AND a structural fallback would produce a unique tuple → **refuse**, emit `UncorrelatableSpanGap`, do not infer. - Attribute join returns empty AND structural fallback yields ≥k candidates → correlate with a `low_confidence_structural` flag and the candidate count attached. The trap is that the second case *looks like* a successful recovery to the agent: it produces a clean causal chain and a passing audit. The refusal must be triggered by the *uniqueness check on the fallback tuple*, computed before the join is materialized, not by any downstream anomaly. ## Operational Effect Downstream, an `UncorrelatableSpanGap` changes the auditor's verdict from "chain reconstructed, no compounding detected" to "chain incomplete, compounding status unknown for N spans." That is the correct epistemic state. The alternative — a silently inferred chain — poisons the auditor's own episodic memory with a fabricated causal edge, and because the auditor writes that edge to semantic memory, the fabrication outlives the trace. The failure compounds: the next run's auditor retrieves the poisoned edge as prior context. The guardrail is therefore not just a privacy control but a memory-integrity control, and it must run at correlation time, before any span-derived fact is distilled into semantic state. ```python import hashlib from dataclasses import dataclass from typing import Optional CORRELATION_K = 5 # minimum candidate-set size for a valid structural join class UncorrelatableSpanGap(RuntimeError): """Raised when a federated span cannot be safely joined to a causal chain.""" @dataclass class FederatedSpan: trace_id: str span_id: str parent_span_id: Optional[str] domain: str salt: str tenant_hash: str latency_bucket: int region: str def _keyed_hash(tenant: str, salt: str) -> str: return hashlib.sha256(f"{salt}:{tenant}".encode()).hexdigest() def correlate( span: FederatedSpan, reference: list[FederatedSpan], agreed_salt: str, structural_candidate_count: int, ) -> FederatedSpan: # Path 1: attribute join under an agreed salt. expected = _keyed_hash(span.tenant_hash, agreed_salt) for ref in reference: if ref.domain != span.domain and _keyed_hash(ref.tenant_hash, agreed_salt) == expected: return ref # Path 2: attribute join failed. Structural fallback is only legal if # the fallback tuple is non-unique within the candidate set. if structural_candidate_count < CORRELATION_K: raise UncorrelatableSpanGap( f"span {span.span_id} in domain {span.domain}: attribute join empty " f"(salt mismatch or rotated key) and structural fallback " f"(parent={span.parent_span_id}, latency_bucket={span.latency_bucket}, " f"region={span.region}) yields only {structural_candidate_count} " f"candidates < k={CORRELATION_K}; refusing inferred join to avoid " f"graph-position re-identification" ) # Path 3: structural fallback is safe — return best candidate, flagged low-confidence. return reference[0] ```