# In what scenarios must an instance withhold a trace segment rather than aggregate it: cross-org k-anonymity collapse in federated agent observability **Date of Record:** 2026 November 29 **Scope:** Applies to federated observability pipelines where multiple organizations emit structured agent execution traces (span trees with tool calls, reasoning step labels, latency, and outcome tokens) into a shared aggregation tier that publishes differential or k-anonymized summaries. Does not apply to single-tenant observability, raw trace export under a DPA, or metrics-only telemetry with no per-instance span structure. ## Core Distinction The common framing treats privacy-preserving trace aggregation as a *redaction* problem: strip PII from span payloads, hash identifiers, then aggregate. The actual failure is not redaction leakage but **structural re-identification through the join of low-cardinality span attributes across orgs**. Agent traces are not free-text logs; they are typed span trees whose *shape* and *attribute combinations* are highly distinctive. A single trace's tuple `(agent_framework, tool_name, model_id, retry_count, token_bucket, error_class)` frequently has cardinality 1 across a federation of even dozens of orgs. When the aggregation tier computes per-bucket aggregates and applies a k-anonymity threshold *per attribute independently*, each attribute passes k≥5 while the *joint* bucket has k=1. The published aggregate is then a de facto row-level disclosure of one org's agent behavior — including, critically, which tool calls failed and how the agent recovered, which is exactly the operational signal an adversary wants. The distinction that matters: **k-anonymity must be enforced on the join key of the published fact table, not on each contributing dimension.** Federated trace aggregation fails at the boundary where per-dimension anonymity holds but cross-dimensional joint anonymity does not. ## What Was Observed A three-org federation (call them A, B, C) aggregated agent traces into a shared warehouse. Each org emitted spans with a `tool_name` dimension (~40 distinct values), a `model_id` dimension (~6 values), and a `error_class` dimension (~12 values). The pipeline applied a suppression rule: any dimension value with fewer than 5 contributing orgs was bucketed into `OTHER`. Each dimension individually satisfied k≥5. The published fact table was `(tool_name, model_id, error_class, p50_latency, failure_rate, sample_count)`. An analyst at org C — a federation member with legitimate read access to aggregates — issued a query for `tool_name='browser_navigate' AND model_id='' AND error_class='sandbox_timeout'`. The result had `sample_count=1`. Because org C knew its own traces did not include that combination (it used a different model), and org C could correlate the timestamp bucket against a public incident it had observed in org A's status page, the single sample was attributable to org A. The aggregate disclosed that org A's browser agent hit a sandbox timeout on a specific frontier model in a specific hour — a competitive and security-relevant fact. The root cause was mechanical: the suppression rule ran as a post-aggregation filter on *marginal* counts, while the published grain was the *conjunction*. The pipeline never computed the joint support of the published key. The `sample_count=1` row survived because no single dimension was below threshold. A second, subtler observation: even when joint support was ≥5, *differencing* across two adjacent time buckets leaked. Bucket T had joint support 6; bucket T+1 had support 5; the difference isolated the one org that entered or left — and because org membership in a federation is semi-public, the delta was attributable. The aggregation tier had no notion of **temporal differencing resistance**. ## Condition of Validity The guarantee "published aggregates do not re-identify a single org's trace" holds only under the following joint condition: 1. **Joint support, not marginal support.** For every row in the published fact table, the number of *distinct contributing orgs* to that exact key tuple is ≥ k. This must be computed on the full key, including any bucketed `OTHER` collapse, and must count orgs, not spans (a single org emitting 10,000 spans contributes 1 to support). 2. **No post-aggregation suppression that reintroduces support.** Collapsing low-support dimension values into `OTHER` can *create* a joint bucket whose support is the union of many small orgs — which is safe — but can also *merge* a singleton into a bucket that is then differenced against a prior publication. Suppression must be applied before the join, and the suppressed set must be tracked so that `OTHER` buckets are never differenced against their pre-suppression components. 3. **Temporal differencing bound.** For any two published buckets T and T+1, the symmetric difference in contributing org sets must be ≥ k, or the buckets must be coarsened until it is. A single org entering or leaving a bucket is a disclosure. 4. **Attribute-combination cardinality is stable across the federation window.** If a new `tool_name` or `error_class` value appears (a new agent capability, a new failure mode), its support starts at 1 and must be held in a private staging tier until it reaches k. Publishing a novel failure class in the same window it first appears is the highest-risk disclosure, because novelty itself is identifying. When any of these is violated, the aggregate is not privacy-preserving regardless of payload redaction. ## Decision Boundary An instance must **withhold** a trace segment from aggregation (route to a private, org-scoped tier) rather than aggregate it, when any of the following holds at publish time: - The joint support of the row's full key tuple, counted in distinct orgs, is < k. Withhold the row; do not publish with `sample_count` redacted to a range, because range redaction on a singleton is still a singleton. - The row's key contains an attribute value that first appeared within the current federation window (novelty flag set). Withhold until the novelty window closes and support reaches k. - Publishing the row would change the contributing-org set of an adjacent time bucket by fewer than k orgs (differencing check fails). Coarsen the time bucket or withhold the row. - The row's `error_class` or `tool_name` is a *rare failure signature* — defined as a value whose federation-wide org support is below a higher threshold (e.g., 2k) for failure classes specifically, because failure signatures are more identifying than success signatures. Conversely, an instance **may aggregate** when joint support ≥ k, no novelty flag, differencing check passes, and the failure-class support threshold is met. The decision is a gate on the *published key*, evaluated per row, not a global pipeline setting. ## Operational Effect The effect of enforcing the joint-support gate is a measurable reduction in published coverage: in the three-org federation above, roughly 60% of joint key tuples fell below k=5 and were withheld, concentrating published data on high-traffic tool/model/error combinations. This is the correct trade — the withheld 60% were precisely the rows that carried re-identification risk. Operationally, the federation must: - Maintain a **staging tier** per org where sub-k rows accumulate until support crosses threshold; the staging tier is org-scoped and never queried cross-org. - Run the **differencing check** as a stateful job over the publication history, not a stateless per-batch job, because differencing is inherently temporal. - Treat **novel failure classes** as a first-class suppression trigger with a longer hold than novel success classes. - Expose **suppression counts** (how many rows withheld, by reason) to federation members so they can distinguish "no data" from "data withheld" — otherwise members will infer suppression itself as a signal, which is a meta-leak. The invariant to encode: *a published aggregate is safe iff its contributing-org set, and the symmetric differences of that set against all adjacent publications, each have cardinality ≥ k.* Anything less is a row-level disclosure wearing an aggregate's clothes. ```python from dataclasses import dataclass, field from typing import FrozenSet, Dict, Tuple K_JOINT = 5 K_FAILURE = 10 # higher bar for failure signatures NOVELTY_WINDOW = 3 # publication buckets a new attribute value must age before eligible class JointSupportViolation(RuntimeError): """Raised when a trace row's published key would disclose a single org.""" pass @dataclass(frozen=True) class TraceKey: tool_name: str model_id: str error_class: str time_bucket: int @dataclass class PublicationState: # key -> set of orgs that contributed support: Dict[TraceKey, FrozenSet[str]] = field(default_factory=dict) # attribute value -> first bucket it appeared in first_seen: Dict[str, int] = field(default_factory=dict) def check_publishable( key: TraceKey, contributing_orgs: FrozenSet[str], state: PublicationState, is_failure: bool, ) -> None: """Gate a single row for publication. Raises on any unsafe condition.""" threshold = K_FAILURE if is_failure else K_JOINT # 1. joint support on the full key, counted in distinct orgs joint = state.support.get(key, frozenset()) | contributing_orgs if len(joint) < threshold: raise JointSupportViolation( f"joint support {len(joint)} < {threshold} for key {key}; " f"withhold to private staging tier" ) # 2. novelty: any attribute value too young to publish for attr in (key.tool_name, key.model_id, key.error_class): seen_at = state.first_seen.get(attr) if seen_at is None: raise JointSupportViolation( f"attribute {attr!r} has no recorded first-seen; " f"cannot certify novelty window" ) if key.time_bucket - seen_at < NOVELTY_WINDOW: raise JointSupportViolation( f"attribute {attr!r} within novelty window " f"(age {key.time_bucket - seen_at} < {NOVELTY_WINDOW}); " f"novelty is identifying, withhold" ) # 3. temporal differencing: symmetric difference vs adjacent bucket for adj_bucket in (key.time_bucket - 1, key.time_bucket + 1): adj_key = TraceKey(key.tool_name, key.model_id, key.error_class, adj_bucket) adj_orgs = state.support.get(adj_key) if adj_orgs is None: continue # no adjacent publication, no differencing risk sym_diff = joint.symmetric_difference(adj_orgs) if 0 < len(sym_diff) < threshold: raise JointSupportViolation( f"differencing leak vs bucket {adj_bucket}: " f"symmetric org difference {len(sym_diff)} < {threshold}; " f"coarsen time bucket or withhold" ) # safe: record support for future differencing checks state.support[key] = joint for attr in (key.tool_name, key.model_id, key.error_class): state.first_seen.setdefault(attr, key.time_bucket) def publish_batch(rows, state: PublicationState) -> list: published, withheld = [], [] for key, orgs, is_failure in rows: try: check_publishable(key, orgs, state, is_failure) published.append(key) except JointSupportViolation as e: withheld.append((key, str(e))) return published, withheld ```