# What happens when an instance exports a federated trace aggregate whose span-level k-anonymity is satisfied per-organization but violated after cross-org merge **Date of Record:** 2026 November 27 **Scope:** Applies to multi-organization agent observability pipelines that aggregate execution traces (spans, tool-call records, reasoning-loop checkpoints) across trust boundaries using per-tenant anonymization (k-anonymity, l-diversity, or differential privacy noise) before federated merge. Does not apply to single-tenant observability, nor to raw trace shipping where no aggregation invariant is claimed. ## Core Distinction The failure is not "anonymization is imperfect." It is that **k-anonymity is a property of a dataset, not of a record, and federated aggregation composes records from datasets that were each independently k-anonymized against different quasi-identifier populations.** A per-org aggregator can honestly certify every exported span group as satisfying k≥5 *within its own tenant's span population*, and the receiving federation merge can produce a group of size 1 without any component lying. The invariant that breaks is the implicit assumption that "k-anonymized slice" is closed under union. It is not. Set union of two k-anonymous partitions is not k-anonymous; it is anonymous only against the *joint* quasi-identifier distribution, which neither party controlled. This matters specifically at the agent layer because traces carry unusually rich quasi-identifiers: exact tool-call sequences, model versions, retry counts, token budgets consumed, and wall-clock timing of reasoning loops. These are not PII in the classic sense, yet they are near-unique fingerprints of a specific agent instance executing a specific task — and the whole point of federated observability is to correlate those fingerprints *across* orgs (e.g., to detect a failing MCP server that multiple vendors' agents call). ## What Was Observed Three vendors (A, B, C) each run a federated observability exporter. Each exporter buckets spans by a quasi-identifier tuple: `(tool_name, model_id, retry_bucket, latency_decile)`. Each enforces k≥5: any bucket with fewer than 5 spans is suppressed before export. Each publishes a signed manifest attesting `min_bucket_size ≥ 5` for the export window. Vendor A's window contains 6 spans in bucket `("mcp__fs__write", "claude-x", retry=2, lat_decile=9)`. Passes k=5. Exported. Vendor B's window contains 5 spans in the *same* bucket tuple. Passes k=5. Exported. Vendor C contains 7. Passes. Exported. The federation merger receives three aggregates for one tuple. Naively, the merged bucket has 18 spans — safe. But the merger's job is to *attribute* the failing tool call to a specific agent run for root-cause, and it holds a side channel: a separate "incident correlation" feed where each org publishes `(incident_id, tool_name, model_id, timestamp)`. Joining the k=5 aggregate against the incident feed, with the retry and latency buckets acting as the de-anonymizer, collapses the 18 spans to a single distinguishable agent run per org — because within each org only one incident of that shape occurred in that window. The merged view has k=1. Every exporter's manifest was true. The federation's output was a re-identification. The trigger condition is precise: **the merge key (quasi-identifier tuple) must be shared across orgs, and at least one org must have an auxiliary dataset that is keyed on a strict subset of that tuple.** Both conditions are the normal case in agent observability, because the quasi-identifiers are exactly the fields engineers want to correlate on. ## Condition of Validity Per-org k-anonymity is a valid privacy bound for a federated merge **only if** one of the following holds: 1. **Global suppression, not local.** The merger re-computes bucket sizes over the union and suppresses any tuple whose *global* count is below k. This requires the merger to receive true counts, which means the per-org suppression must be replaced by per-org *count reporting* plus merger-side suppression — a different protocol with different leakage (counts themselves leak). 2. **Disjoint quasi-identifier domains.** No two orgs share the same tuple space, so union cannot collapse. Almost never true for tool names and model IDs. 3. **Differential privacy with a federation-level budget.** Each org adds calibrated noise, and the merger's query is bounded by a composed privacy budget. This is valid but is not k-anonymity and cannot be certified by a `min_bucket_size` manifest. 4. **No auxiliary join exists.** The merger holds no side channel keyed on a subset of the tuple. Unverifiable in practice and falsified by the incident feed above. Absent one of these, the manifest's `min_bucket_size ≥ 5` claim is true and irrelevant. The condition of validity is *not* "each exporter is honest"; it is "the merge operator enforces the invariant on the merged distribution." ## Decision Boundary The boundary is between two protocols that look identical in logs: - **Export-then-suppress (broken):** org suppresses locally, ships surviving buckets, merger unions. The merger's output cardinality is `|union of surviving buckets|`, which can be as low as `max(k_i)` but is not bounded below by `min(k_i)` because surviving buckets are *selected* — the selection itself is the leak. Buckets that survive local suppression are disproportionately the ones with exactly k members, and the merger knows this. - **Report-then-suppress (correct):** org ships `(tuple, true_count)` with DP noise on the count; merger sums noisy counts, suppresses tuples whose summed count is below k, and only then releases span-level detail for surviving tuples. Here the invariant is enforced on the distribution the adversary actually sees. The decision rule for an agent-observability architect: **if the merger can join any external feed on a subset of the aggregation key, local suppression is void.** Audit for the auxiliary feed before trusting any per-org privacy manifest. In agent systems the auxiliary feed is always present in the form of incident tickets, deployment logs, model-version registries, or the agents' own task queues. ## Operational Effect Concretely, an exporter that certifies k≥5 per org while the merger unions buckets will, under the incident-feed join, emit trace groups of size 1 — a complete execution fingerprint of a single agent run, including its tool-call sequence and reasoning-loop timing. The re-identification is silent: no manifest fails, no alert fires, because every component's local invariant held. The only observable symptom is that the merger's released span groups have cardinality below the advertised k, which must be checked *at the merger*, not at the exporter. The guardrail is a merger-side cardinality assertion that runs before any span-level release, plus a refusal to accept per-org suppression manifests as sufficient evidence. The following reference implementation enforces that assertion and raises on the exact failure above. ```python from dataclasses import dataclass, field from collections import defaultdict from typing import Dict, Tuple, List K_MIN = 5 class FederatedKAnonymityViolation(RuntimeError): """Raised when a merged federated trace bucket falls below k after union, even though every contributing org certified k locally.""" pass @dataclass class OrgExport: org_id: str # tuple -> true count reported by the org (post-DP in production) buckets: Dict[Tuple, int] = field(default_factory=dict) # tuple -> locally certified min bucket size (the manifest claim) certified_min: int = K_MIN @dataclass class MergedBucket: quasi_id: Tuple total_count: int contributing_orgs: List[str] def merge_and_enforce( exports: List[OrgExport], auxiliary_join_keys: List[Tuple], ) -> List[MergedBucket]: """Merge per-org bucket counts, then enforce k-anonymity on the UNION. auxiliary_join_keys are tuples the merger can join against external feeds (incident tickets, deployment logs). If any auxiliary key is a strict subset of a merged quasi-id, that quasi-id is treated as a de-anonymizer and its effective k is 1 regardless of count. """ totals: Dict[Tuple, int] = defaultdict(int) orgs: Dict[Tuple, List[str]] = defaultdict(list) for exp in exports: # Reject orgs that claim a weaker invariant than the federation floor. if exp.certified_min < K_MIN: raise FederatedKAnonymityViolation( f"org {exp.org_id} certifies k={exp.certified_min} < {K_MIN}" ) for qid, count in exp.buckets.items(): totals[qid] += count orgs[qid].append(exp.org_id) merged: List[MergedBucket] = [] for qid, total in totals.items(): # The actual invariant: cardinality of the MERGED bucket. if total < K_MIN: raise FederatedKAnonymityViolation( f"merged bucket {qid} has k={total} < {K_MIN} " f"(contributors: {orgs[qid]}); per-org manifests were " f"individually valid but union collapsed the group" ) # The subtle invariant: auxiliary joins on subsets void the count. for aux in auxiliary_join_keys: if _is_strict_subset(aux, qid): raise FederatedKAnonymityViolation( f"merged bucket {qid} is joinable on strict subset {aux}; " f"effective k=1 despite count={total}" ) merged.append(MergedBucket(qid, total, orgs[qid])) return merged def _is_strict_subset(aux: Tuple, qid: Tuple) -> bool: """True if every field of aux appears in qid and qid has more fields.""" if len(aux) >= len(qid): return False return all(a in qid for a in aux) # --- Reproduction of the observed failure ------------------------------- def reproduce_incident(): qid = ("mcp__fs__write", "claude-x", 2, 9) # tool, model, retry, lat_decile exports = [ OrgExport("A", {qid: 6}), # passes local k=5 OrgExport("B", {qid: 5}), # passes local k=5 OrgExport("C", {qid: 7}), # passes local k=5 ] # Incident feed keyed on (tool, model) — a strict subset of qid. aux = [("mcp__fs__write", "claude-x")] try: merge_and_enforce(exports, aux) except FederatedKAnonymityViolation as e: print(f"BLOCKED: {e}") return raise FederatedKAnonymityViolation( "merger released a joinable bucket; invariant not enforced" ) if __name__ == "__main__": reproduce_incident() ```