What happens when an instance redacts its audit trace for cross-org correlation: the join-key cardinality collapse
**Date of Record:** 2026 December 2 **Scope:** Applies to federated audit systems where independent agent operators (separate trust domains) share execution traces for cross-org correlation under privacy constraints — differential privacy, k-anonymity bucketing, or per-field generalization. Does not apply to single-tenant trace stores, nor to correlation performed on raw (unredacted) spans within one operator's boundary.
Core Distinction
The failure is not "privacy budget exhausted" and not "hash mismatch." It is a **cardinality collapse of the correlation key induced by the redaction transform itself**. Operators typically reason about redaction as a *lossy projection* of a fixed key space: `f: K → K'` where `|K'| ≤ |K|`. The implicit invariant they rely on is that `f` is *injective on the observed key set* — that two distinct parent executions will not map to the same redacted key. That invariant is false whenever the redaction is a generalization (coarsening a timestamp to an hour, truncating a trace ID prefix, bucketing a token count, zeroing low-order bits of a host fingerprint) and the observation window contains more than one candidate per bucket.
The consequence: cross-org correlation does not *fail to join*. It **joins incorrectly**, silently, and at a higher rate than the true positive rate. The federated auditor sees a plausible, well-formed, cryptographically valid correlation and attributes a downstream agent's tool call to the wrong upstream instance. This is worse than a null result because it survives every integrity check the pipeline has: signatures verify, schema validates, the join succeeds, the audit row is written.
What Was Observed
Two operators, A and B, run a multi-agent pipeline: A's planner instance dispatches subtasks to B's executor instances. Both emit OpenTelemetry-style spans with a shared `trace_id` and a per-span `parent_span_id`. To share traces without leaking identifiers, both sides apply a redaction transform before export:
- `trace_id` → first 8 hex chars (32 bits retained).
- `timestamp` → floored to the minute.
- `agent_instance_id` → replaced with a per-org salted hash, salt rotated daily.
During a 24-hour window, A dispatched 41,000 planner invocations. B executed 118,000 subtask spans. The correlation service joins on `(redacted_trace_id, minute_bucket)` and then re-establishes parentage by walking `parent_span_id` within each joined group.
The observed anomaly: **B's spans joined to A's planner spans at 1.37× the expected rate**, and the *distribution* of joined groups was wrong. A single A-planner minute-bucket group absorbed, on average, 2.9 B-spans instead of the 1.0 the workload implied. The join did not error. The auditor's replay check — "does every B-span have exactly one A-parent?" — passed for 94% of spans because the fan-out was small per group; the remaining 6% were flagged as "ambiguous parentage" and, by default policy, *attributed to the modal parent*, which was the wrong parent 61% of the time in that tail.
The root cause was not the salt rotation (that only broke `agent_instance_id` joins, which were already unused). It was that **32 bits of `trace_id` is not enough to be injective over 41,000 keys in a minute bucket**, and the minute bucket itself is a generalization that merges independent planner invocations. The birthday-bound collision probability for 41,000 keys in a 2³² space is ≈ 1 − exp(−n²/2m) ≈ 0.18 per minute-bucket at peak, and the *bucket* collision (two planners in the same minute) was near-certain — the redaction had converted a unique key into a low-entropy composite, and the join logic assumed the composite was still a key.
Condition of Validity
The correlation is valid **iff** the redacted key is injective on the set of true parent executions within each correlation window. Formally, for redaction `f` and true parent set `P` observed in window `W`:
∀ p₁, p₂ ∈ P: f(p₁) = f(p₂) ⟹ p₁ = p₂
This holds only when `|f(P)| = |P|`. The operators' design guaranteed the opposite: `f` was chosen for *privacy* (coarsening) and the window `W` was chosen for *throughput* (long enough to batch), and the two choices were made by different teams against different assumptions. The privacy team sized the redaction against a *re-identification* threat model (can an adversary recover the original ID?); the correlation team sized the window against a *latency* budget. Neither team owned the injectivity invariant, so no one checked `|f(P)| = |P|` at the join boundary.
The invariant is *not* restored by cryptographic signing. Signatures prove the span came from B and was not tampered with; they say nothing about whether the redacted key uniquely identifies a parent. It is *not* restored by differential privacy accounting: ε bounds information leakage about individuals, not collision probability among the *keys* used for joining. These are orthogonal properties and the pipeline conflated them.
Decision Boundary
The boundary is crossed when the expected number of true parents per redacted-key bucket, `λ = |P| / |f(P)|`, exceeds 1. At `λ = 1` the join is safe. At `λ > 1` the join is *ambiguous*, and any policy that resolves ambiguity by picking a parent (modal, first-seen, highest-confidence) converts ambiguity into **silent misattribution**. The correct behavior at `λ > 1` is to *refuse the join* and emit a correlation-gap record, not to guess.
Operational rule: before enabling cross-org correlation, compute `λ` for the *peak* window, not the average. If `λ > 1`, either (a) widen the key (retain more `trace_id` bits, narrow the timestamp bucket, add a non-redacted high-entropy join token that is itself encrypted under a shared key), or (b) shrink the window until `λ ≤ 1`, accepting more correlation-gap records. Do not resolve ambiguity by heuristic. A correlation-gap record is auditable; a misattributed parent is a permanent, signed, wrong fact in the audit trail.
Operational Effect
The pipeline that guesses produces an audit trail that is *internally consistent and externally wrong*. Downstream consumers — incident responders, compliance reviewers, automated policy engines — treat the joined parentage as ground truth because it passed signature verification and schema validation. The error is not detectable by any single-org check; it only surfaces when an operator compares the federated trail against a *non-redacted* internal trace, which is exactly the comparison the privacy design forbids. The failure is therefore **structurally invisible to the parties who would catch it**, and it compounds: each misattributed span becomes a prior for the next correlation window's modal-parent heuristic, drifting the attribution distribution further from truth.
The guardrail is a pre-join cardinality assertion plus a hard refusal path. The code below encodes it: it computes `λ` over the observed bucket population and raises rather than resolving ambiguity.
from collections import defaultdict
from dataclasses import dataclass
class CorrelationCardinalityCollapse(RuntimeError):
"""Raised when a redacted correlation key is not injective on true parents."""
@dataclass(frozen=True)
class Span:
trace_id: str # already redacted (e.g. 8 hex chars)
minute_bucket: int # already generalized
org: str
true_parent: str | None # known only to the emitting org; used for the invariant check
def assert_join_injective(parent_spans: list[Span], child_spans: list[Span],
max_lambda: float = 1.0) -> dict[tuple[str, int], list[str]]:
"""
Build (redacted_trace_id, minute_bucket) -> [true_parent, ...] and refuse
to proceed if any bucket holds more than one distinct true parent.
"""
buckets: dict[tuple[str, int], list[str]] = defaultdict(list)
for s in parent_spans:
if s.true_parent is None:
raise CorrelationCardinalityCollapse(
f"parent span {s.trace_id}@{s.minute_bucket} has no true_parent; "
"cannot verify injectivity"
)
buckets[(s.trace_id, s.minute_bucket)].append(s.true_parent)
for key, parents in buckets.items():
distinct = set(parents)
lam = len(parents) / len(distinct)
if len(distinct) > 1 or lam > max_lambda:
raise CorrelationCardinalityCollapse(
f"redacted key {key} maps to {len(distinct)} distinct true parents "
f"(lambda={lam:.2f}); join would misattribute. "
"Widen the key or narrow the window; do not resolve by heuristic."
)
# Only reached when every bucket is injective.
return {
(c.trace_id, c.minute_bucket): buckets[(c.trace_id, c.minute_bucket)]
for c in child_spans
if (c.trace_id, c.minute_bucket) in buckets
}