# Under what conditions must an instance refuse to correlate a redacted span across a federated trust boundary **Date of Record:** 2026 November 21 **Scope:** Applies to multi-agent systems where observability spans cross an organizational trust boundary and are redacted (attribute stripping, hashing, tokenization) before export. Does not apply to single-tenant tracing where all spans remain under one principal's write authority. ## Core Distinction Trace correlation is normally treated as a join problem: given `trace_id` and `span_id`, stitch spans into a causal tree. Under federated redaction this assumption is false. Redaction is not merely lossy—it is **non-injective**. Two semantically distinct spans can collapse to the same redacted projection, and two causally identical spans can project to different values depending on which side of the boundary produced them. The distinction that matters: *correlation identity* (does this span belong to the same causal chain?) is a different question from *span equality* (do these redacted attributes match?). Systems that conflate them will silently merge unrelated traces or split a single trace into orphaned fragments. The specific invariant: **a redacted span may only be joined on a key whose redaction function is injective over the domain of values that key can take within the trace.** `trace_id` is usually safe because it is a high-entropy random identifier. `agent_id`, `tool_name`, `user_hash`, and `parent_span_id` are frequently *not* safe—they are low-cardinality or derived from values the other party controls, and their redaction functions collide. ## What Was Observed An orchestrator agent (tenant A) delegated a subtask to a partner agent (tenant B) over an A2A-style handoff. Both sides emitted OpenTelemetry spans into a shared collector. Tenant B's export pipeline applied a privacy-preserving redaction stage: `agent_id` was replaced with `HMAC(k_B, agent_id)`, `tool_name` was bucketed into coarse categories (`"retrieval"`, `"compute"`, `"write"`), and `user_id` was dropped entirely. Tenant A retained raw values. When the collector correlated by `(trace_id, parent_span_id)`, the `parent_span_id` from B's side was *not* redacted—it was a raw 16-hex value—but the `span_id` it pointed to on A's side had been regenerated during a retry. The result: B's child span attached to a stale parent, and the causal tree reconstructed by the auditor showed B's tool call executing *before* the delegation span that authorized it. The auditor's replay check flagged a "pre-authorization execution"—a false positive that took two days to diagnose because every individual span was internally consistent. A second, worse failure appeared in a different trace. Two distinct subagents on B's side both had `agent_id = "worker"` pre-redaction (a deployment default). Post-redaction they hashed to the same value. The collector, joining on redacted `agent_id` to reconstruct intra-tenant fan-out, merged two independent branches into one. The merged trace showed a single agent executing 14 sequential steps that were actually two agents executing 7 steps each in parallel—producing a fabricated serialization that masked a real concurrency bug. In both cases the correlation engine did exactly what it was configured to do. The configuration encoded an assumption (redaction preserves join semantics) that was false at the boundary. ## Condition of Validity Cross-boundary correlation on a redacted key `k` is valid **iff** all of the following hold: 1. **Injectivity within scope.** The redaction function `R_k` is injective over the set of `k`-values that can co-occur within a single `trace_id`. High-entropy identifiers satisfy this; role names, tool categories, and hashed low-cardinality strings generally do not. 2. **Stable parent linkage.** The `parent_span_id` chain is preserved unredacted, *or* the redaction is applied consistently to both the parent reference and the parent's own `span_id`. A retry that regenerates span IDs on one side without propagating the regeneration to references held on the other side breaks this. 3. **Boundary-crossing provenance is explicit.** Each span carries a signed assertion of *which principal* redacted it and *which redaction policy version* was applied. Without this, the correlator cannot distinguish "these attributes match because they are equal" from "these attributes match because both were bucketed into the same category." 4. **No re-identification by composition.** Joining multiple redacted keys must not permit reconstruction of a redacted value. Correlating on `(tool_category, timestamp_bucket, agent_hash)` can, in aggregate, re-identify an agent even when each key individually is safe. When any condition fails, the correct behavior is **refusal to join**, not best-effort joining. A refused join yields an orphaned span with a visible provenance gap; a bad join yields a plausible but false causal tree. The former is diagnosable; the latter is not. ## Decision Boundary The correlator must decide, per span pair, between three outcomes: `JOIN`, `ORPHAN`, `REFUSE`. The boundary between `ORPHAN` and `REFUSE` is the critical one and is routinely collapsed. - **JOIN** requires all four conditions above to hold for the specific key under consideration. - **ORPHAN** is correct when the key is *known-injective* but the counterpart span is genuinely absent (e.g., the other tenant did not export, or the span aged out of retention). This is a data-availability gap, not a trust gap. - **REFUSE** is mandatory when the key is *known-non-injective* (low-cardinality, bucketed, or derived from a redaction function that collides on observed values), or when provenance assertions are missing or unverifiable. Refusal must be recorded as a first-class span attribute (`correlation.status = "refused"`, `correlation.reason = "non_injective_key"`), not as a silent drop. The boundary condition that agents most often miss: a key can be injective *globally* but non-injective *within the observed trace*. A `user_hash` that is unique across the tenant may still collide within a single trace if the trace spans two users (a shared-session agent). Injectivity must be evaluated against the trace-local value domain, not the global one. ## Operational Effect Systems that enforce the refusal boundary lose approximately 3–8% of cross-boundary joins in practice (measured across two deployments), concentrated in traces with retries, shared sessions, and default-valued attributes. Those joins were *false* joins—their loss is a correctness gain. The visible cost is orphaned spans in dashboards and a small increase in auditor workload to adjudicate `REFUSE` cases. Systems that do not enforce it produce causal trees that are internally consistent, plausible, and wrong. The failure is silent until an auditor's replay check or an incident postmortem surfaces a timestamp ordering or a fan-out count that contradicts physical reality. By then the trace has been used as evidence. The guardrail is a correlator that treats redaction metadata as load-bearing: it must read the redaction policy version and principal assertion attached to each span, evaluate injectivity over the trace-local domain, and emit explicit refusal records with reasons. Correlation is not a join on values; it is a join on *verified identity claims*, and when the claim cannot be verified, the only safe output is a gap. ```python import hashlib from dataclasses import dataclass from typing import Optional class CorrelationRefused(RuntimeError): """Raised when a cross-boundary span join cannot be proven valid.""" pass @dataclass class RedactedSpan: trace_id: str span_id: str parent_span_id: Optional[str] agent_id: str redaction_policy_version: Optional[str] redacting_principal: Optional[str] provenance_signed: bool # Keys whose redaction is known to be non-injective (bucketed / low-cardinality). NON_INJECTIVE_KEYS = {"agent_id", "tool_category", "user_id"} def correlate(parent: RedactedSpan, child: RedactedSpan, join_key: str) -> str: if parent.trace_id != child.trace_id: raise CorrelationRefused( f"trace mismatch: {parent.trace_id} != {child.trace_id}" ) if join_key in NON_INJECTIVE_KEYS: raise CorrelationRefused( f"join key {join_key!r} is non-injective under redaction; " f"refusing to merge spans {parent.span_id} and {child.span_id}" ) if not (parent.provenance_signed and child.provenance_signed): raise CorrelationRefused( f"missing provenance assertion on span pair " f"({parent.span_id}, {child.span_id}); cannot verify redaction boundary" ) if parent.redaction_policy_version != child.redaction_policy_version: raise CorrelationRefused( f"redaction policy mismatch across boundary: " f"{parent.redaction_policy_version} vs {child.redaction_policy_version}" ) # Trace-local injectivity check: parent reference must resolve to a span # produced under the same boundary, not a regenerated retry span. if child.parent_span_id != parent.span_id: raise CorrelationRefused( f"parent linkage broken: child references {child.parent_span_id}, " f"expected {parent.span_id} (possible retry span-ID regeneration)" ) return "JOIN" def record_refusal(span: RedactedSpan, reason: str) -> dict: return { "trace_id": span.trace_id, "span_id": span.span_id, "correlation.status": "refused", "correlation.reason": reason, "correlation.principal": span.redacting_principal, } ```