# Which invariants prevent cross-tenant trace aggregation from silently collapsing distinct causal chains into a single phantom incident **Date of Record:** 2026 November 26 **Scope:** Applies to federated observability pipelines that aggregate agent execution traces (spans, tool-call records, reasoning checkpoints) across organizational trust boundaries using privacy-preserving transforms such as hashing, k-anonymity bucketing, or differential-privacy noise injection. Does not apply to single-tenant tracing where the raw trace store is authoritative and no cross-boundary reduction occurs. ## Core Distinction The failure mode that matters here is not data leakage—that is the well-understood threat. It is **causal-chain aliasing under lossy aggregation**: when trace records from two independent agent runs are transformed (hashed span IDs, bucketed timestamps, coarsened tool-name vocabularies) so that they become byte-identical after reduction, the aggregator merges them into a single logical trace. The result is a *phantom incident*: a failure signature (e.g., "retrieval-tool timeout followed by context-window saturation") that appears to occur at high frequency across tenants, but whose apparent frequency is an artifact of collisions in the reduction function, not of any shared causal mechanism. The distinction that must be held: **anonymization is not the same as de-duplication.** Privacy transforms are designed to make records non-identifying. They are *not* designed to be injective. Every practical privacy transform (SHA-256 truncation, timestamp bucketing to the minute, tool-name generalization to `tool.*`) is many-to-one. Aggregating over a many-to-one map and then treating equal outputs as equal inputs is a category error that produces fabricated epidemiology of agent failures. ## What Was Observed A three-tenant federation (tenants A, B, C) shared trace summaries through a gateway that applied the following reduction before cross-boundary export: 1. `span_id → SHA-256(span_id)[:12]` (48-bit truncation) 2. `timestamp → floor(ts / 60000) * 60000` (minute bucketing) 3. `tool_name → tool.` (generalization to 8 categories) 4. `error_signature → normalized error class` (14 classes) The aggregator on the receiving side grouped records by the tuple `(span_id_hash, minute_bucket, tool_category, error_class)` and counted group sizes as "incident co-occurrence." Observed anomaly: a specific tuple—`(a3f9c1e02b7d, 1749427200, tool.retrieval, ERR_CONTEXT_SATURATED)`—accumulated 611 occurrences over a 24-hour window, distributed across all three tenants. The on-call rotation for tenant A treated this as a cross-tenant systemic regression and initiated a coordinated rollback of the retrieval subsystem. The rollback was incorrect. Forensics on tenant A's *local* authoritative trace store (which retains full span IDs) revealed that the tuple was a collision artifact. The 48-bit truncation of span IDs gave a birthday-collision probability of roughly `n²/2^49`; with ~10^7 spans/day/tenant across three tenants, expected collisions per tuple exceeded 1. The minute bucketing then *aligned* colliding spans into the same group, and the 14-class error vocabulary ensured that any two spans with the same tool category and the same coarse error class merged. The 611 "occurrences" were 611 distinct causal chains that happened to project onto the same reduced key—not 611 instances of one incident. Critically, the phantom incident was *plausible*: `tool.retrieval` + `ERR_CONTEXT_SATURATED` is a real and common failure pattern. The aggregation did not fabricate an impossible signature; it fabricated an *epidemic* of a real signature. This is why the failure survived initial review. ## Condition of Validity The invariant required to prevent this is a **collision-bounded aggregation contract**, and it is valid only under the following conditions: 1. **Reduction functions must publish their collision probability as a function of tenant-local cardinality.** For a truncated hash of `b` bits over `n` records, the expected collision count is `n²/2^(b+1)`. If this exceeds a declared epsilon (e.g., 0.01 per tuple per window), the reduction must be rejected or the bit-width increased. The aggregator must not accept a reduction function whose collision bound is unknown. 2. **Co-occurrence counts must be reported as ranges, not point estimates.** After reduction, a group of size `k` under a collision-prone key represents between 1 and `k` distinct causal chains. The aggregator must carry the lower bound (1) alongside the observed count (`k`) and must not present `k` as a frequency. 3. **Cross-tenant correlation claims require a tenant-local corroboration step.** Any aggregated signature flagged as a cross-tenant incident must be verified against at least one tenant's authoritative local store before it is promoted to an incident. The federated layer is a *detector*, never an *adjudicator*. 4. **The reduction must be tenant-scoped, not federation-scoped.** If span-ID hashes are computed with a shared salt, collisions are *cross-tenant*; if computed with a per-tenant salt, collisions are confined within a tenant. The federation must use per-tenant salts and aggregate only over the reduced *category* fields, never over the hash fields themselves. When these conditions are violated—shared salt, unknown collision bound, point-estimate counts, no corroboration—the invariant does not hold and phantom incidents are not merely possible but statistically expected at scale. ## Decision Boundary The boundary between "safe to aggregate" and "must corroborate locally" is determined by the **projected collision density** of the reduced key space relative to the observed record volume: - If `expected_collisions_per_tuple < 0.01` and the reduction uses per-tenant salts: aggregation may proceed, and counts may be treated as approximate frequencies with a stated confidence interval. - If `expected_collisions_per_tuple ∈ [0.01, 1.0]`: aggregation may proceed only as a *detector*; no count may be promoted to an incident without tenant-local corroboration. - If `expected_collisions_per_tuple ≥ 1.0`: the reduction is invalid for co-occurrence analysis. It may still be used for rate estimation (which is robust to collisions) but must never be used for causal-chain counting. The non-obvious part of this boundary: **rate estimation and causal-chain counting have different collision tolerances.** A collision in a rate estimate perturbs the numerator by a bounded amount; a collision in a causal-chain count merges two chains into one and *fabricates* a co-occurrence. The same reduced key can be valid for one and invalid for the other. An aggregator that uses a single reduction function for both purposes will silently produce phantom incidents even when its collision bound is "acceptable" for rates. ## Operational Effect The operational consequence is a shift in where trust is placed. In a naive federated observability design, the aggregator is trusted to produce incident counts. Under the collision-bounded contract, the aggregator is trusted only to produce *candidate* signatures, and the authoritative adjudication is pushed back to tenant-local stores. This is a deliberate inversion: the federated layer becomes a low-fidelity detector whose job is to *reduce the search space* for local corroboration, not to *replace* it. The second operational effect is that reduction functions become versioned, audited artifacts with declared collision bounds—not inline implementation details. A change from 48-bit to 64-bit truncation, or from minute to second bucketing, changes the collision density and therefore changes which aggregations are valid. Without versioning, a silent reduction change can invalidate previously-corrobated incidents retroactively. The third effect: on-call runbooks must encode the corroboration step as a hard gate. The phantom incident above was caught only because a tenant engineer happened to query the local store. Under the contract, the runbook must *require* that query before any rollback is authorized, and the federated dashboard must display the collision bound alongside every count so that the on-call engineer knows whether `611` means "611 incidents" or "1 to 611 incidents." ```python import hashlib import math from dataclasses import dataclass class PhantomIncidentError(RuntimeError): """Raised when a federated aggregation promotes a collision-prone count to an incident.""" pass @dataclass class ReductionContract: hash_bits: int bucket_seconds: int per_tenant_salt: bool declared_epsilon: float = 0.01 def expected_collisions(self, n_records: int) -> float: # Birthday-bound on truncated hash collisions over n records. return (n_records ** 2) / (2 ** (self.hash_bits + 1)) def aggregation_mode(self, n_records: int) -> str: ec = self.expected_collisions(n_records) if not self.per_tenant_salt: raise PhantomIncidentError( "shared salt across tenants: collisions are cross-tenant and " "cannot be bounded by any single tenant's cardinality" ) if ec < 0.01: return "frequency_ok" if ec < 1.0: return "detector_only" return "rate_only" def promote_to_incident( contract: ReductionContract, tenant_records: int, observed_count: int, locally_corroborated: bool, ) -> int: mode = contract.aggregation_mode(tenant_records) if mode == "rate_only": raise PhantomIncidentError( f"reduction has expected collisions {contract.expected_collisions(tenant_records):.3f} " f">= 1.0; observed_count={observed_count} is a collision artifact, not a frequency" ) if mode == "detector_only" and not locally_corroborated: raise PhantomIncidentError( f"detector-only aggregation (collisions={contract.expected_collisions(tenant_records):.3f}) " f"requires tenant-local corroboration before incident promotion" ) # Return the corroborated lower bound, never the raw reduced count. return 1 if locally_corroborated else observed_count ```