# What happens when an instance’s redacted span summary silently collapses cross-org causal edges during federated trace aggregation **Date of Record:** 2026 November 28 **Scope:** Applies to multi-organization agent fleets that emit OpenTelemetry-style spans, apply per-org redaction, and aggregate traces centrally or semi-centrally for incident analysis. Does not apply to single-tenant observability where raw spans remain inside one trust boundary. ## Core Distinction Privacy-preserving trace aggregation is not “redaction plus a join.” It is a **causal-edge preservation problem under lossy projection**. Each org projects its span graph through a redaction function that removes payloads, identifiers, and sometimes entire attribute keys. The aggregator then tries to reconstruct a cross-org causal DAG using the surviving join keys—typically `trace_id`, `span_id`, `parent_span_id`, and a small set of “safe” attributes such as `peer.service`, `rpc.method`, or `agent.role`. The non-obvious failure is this: **redaction that is individually safe can be jointly edge-destroying.** Two orgs can each pass their privacy review while their combined projections remove the only attribute that disambiguated two concurrent child spans sharing a parent. The aggregator does not see “missing data.” It sees a well-formed graph with a *different topology*—one where a baton-pass edge has been silently rewired or dropped. The invariant that must hold is not “no PII leaks” but **“the redacted projection preserves the causal reachability relation among spans that cross the org boundary.”** Most redaction policies are designed against the first invariant and never state the second. ## What Was Observed A three-org agent pipeline: Org A hosts a planner agent, Org B hosts a tool-executor agent behind MCP, Org C hosts an auditor agent that verifies B’s outputs. A single user task produces one `trace_id`. Spans flow A → B → C → B → A (planner delegates, executor calls tool, auditor checks, executor revises, planner finalizes). Each org ran an independent redaction pass before shipping spans to the shared aggregator: - **Org A** stripped `agent.instance_id` because it encoded a tenant hint. It kept `parent_span_id`. - **Org B** stripped `parent_span_id` for spans where the parent was external, replacing it with a synthetic `external.parent=true` flag, on the theory that cross-org parentage was itself identifying. - **Org C** kept everything except free-text `audit.reason`, which it replaced with a hash. Individually, each policy passed review. Combined, the aggregator received: 1. A’s planner span with `parent_span_id = null` (root) and a child executor-call span whose `parent_span_id` pointed to the planner span—fine. 2. B’s executor spans with `parent_span_id` **removed** and `external.parent=true`. The aggregator could not link B’s executor span to A’s planner child span. 3. C’s auditor span with `parent_span_id` intact, pointing at a B span that, from the aggregator’s view, had no inbound edge from A. The reconstructed DAG showed the auditor’s verification as a **root-level operation** rather than a downstream check on B’s tool output. During an incident replay, the aggregator concluded the auditor had run *before* the executor—because both appeared as siblings under a synthetic root—and the on-call engineer spent forty minutes chasing a race condition that did not exist. The real failure (B’s tool call timing out mid-retry) was invisible because the retry span’s parent edge had been severed by B’s `parent_span_id` stripping. The mechanism: **edge severance is not detected as data loss because the aggregator’s schema validation only checks that every span has a valid `trace_id` and a syntactically well-formed parent reference (including `null`).** A `null` parent is a legal root. So a severed edge is indistinguishable from a genuine root span. The aggregator’s “graph is connected” check passed because the synthetic root made it connected—just wrongly. ## Condition of Validity The aggregation is only valid when, for every span `s` emitted by org `O` whose true parent `p` was emitted by a different org `O'`, the redacted projection of `s` retains a **stable, aggregator-resolvable reference to `p`**—either the original `parent_span_id`, or a cross-org correlation token that both `O` and `O'` agree to emit and that the aggregator can join on without re-identifying either party. This condition fails when any of the following hold: - An org replaces `parent_span_id` with a boolean or enum flag (`external.parent=true`) instead of a join key. - An org strips `span_id` on the parent side while the child side still references it (asymmetric stripping). - Two concurrent child spans under the same parent lose the attribute (`agent.role`, `rpc.method`) that disambiguated them, so the aggregator’s edge-resolution becomes ambiguous and it picks one by sort order. - The aggregator’s schema treats `null` parent as “root” rather than “unknown,” collapsing “severed” and “genuine root” into one state. The condition holds only if redaction is specified as a **projection that is a graph homomorphism on the cross-org subgraph**—i.e., it may collapse attributes but must not collapse distinct edges into one or map a non-root to root. ## Decision Boundary The boundary is between **redaction as attribute removal** and **redaction as topology-preserving projection**. The former is what most orgs implement because it is easy to review (“we removed the field”). The latter requires the org to reason about what the aggregator will do with the surviving fields. Concretely, the decision boundary is crossed when an org’s redaction policy removes or replaces a field that the aggregator uses as a **join key** for cross-org edges. The aggregator must publish its join-key contract; the org must treat those keys as *non-removable* and instead apply **value-level generalization** (e.g., replace `parent_span_id` with an HMAC under a shared cross-org key, so the edge survives but the identifier is not linkable outside the trace). If the org cannot preserve the join key even under generalization—because the key itself is identifying—then the correct action is to **drop the span from the federated aggregate entirely and emit a coverage-gap record**, not to emit a synthetic root. A synthetic root is a lie the aggregator cannot detect. A coverage gap is a hole the aggregator can count. The operational rule: **never emit a span whose parent edge has been severed without also emitting an explicit `edge.severed=true` marker and a `severed.toward=` field**, so the aggregator can distinguish “root” from “unknown parent” and refuse to build a causal claim across that edge. ## Operational Effect Without this boundary, federated trace aggregation produces **confidently wrong causal graphs**. The failure is silent because every individual span is schema-valid, every org’s redaction passed review, and the aggregator’s connectivity check passes. The damage surfaces only during incident replay, when an engineer reasons from a topology that does not match execution—typically concluding that a downstream verifier ran early, or that a retry never happened, or that a timeout was a race. The downstream effect is **trust erosion in the observability layer itself**: once an engineer has been burned by a phantom race condition, they stop trusting the aggregated graph and fall back to per-org logs, which defeats the purpose of federation. The architectural guardrail is a two-part invariant enforced at ingestion: 1. **Edge-severance accounting**: every span must carry either a resolvable parent reference or an explicit `edge.severed` marker; the aggregator rejects spans that have neither. 2. **Coverage-gap surfacing**: the aggregator emits a per-trace `causal_completeness` score (fraction of cross-org edges that are resolvable) and refuses to answer causal queries on traces below a threshold, rather than answering them from a silently rewired DAG. The code below encodes the ingestion check as a validator that raises when a span claims a cross-org parent but has neither a resolvable reference nor a severance marker—the exact condition that produced the phantom race. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class CausalEdgeSeveranceError(RuntimeError): """Raised when a redacted span loses its cross-org parent edge without declaring the severance.""" pass @dataclass class RedactedSpan: trace_id: str span_id: str org: str parent_span_id: Optional[str] = None parent_org: Optional[str] = None # set when parent is known to be cross-org edge_severed: bool = False severed_toward: Optional[str] = None attributes: dict = field(default_factory=dict) def _resolve_key(span_id: str, shared_key: bytes) -> str: return hashlib.sha256(shared_key + span_id.encode()).hexdigest()[:16] def validate_cross_org_edge(span: RedactedSpan, shared_key: bytes) -> str: """ Enforce the topology-preserving invariant for a single redacted span. A span is valid iff: - it is a genuine root (no parent_org declared), OR - it carries a resolvable parent reference (raw or HMAC-generalized), OR - it explicitly declares edge_severed with a severed_toward target. A span that declares a cross-org parent but provides neither a reference nor a severance marker is the exact failure mode observed: the aggregator would otherwise treat it as a root and rewire the DAG. """ is_cross_org = span.parent_org is not None and span.parent_org != span.org if not is_cross_org: # intra-org edges are not subject to the federation invariant return "intra_org" has_resolvable_ref = span.parent_span_id is not None has_severance_marker = span.edge_severed and span.severed_toward is not None if not has_resolvable_ref and not has_severance_marker: raise CausalEdgeSeveranceError( f"trace={span.trace_id} span={span.span_id} org={span.org} " f"declares cross-org parent in org={span.parent_org} but has neither " f"a resolvable parent_span_id nor an edge_severed marker; " f"aggregator would misclassify this span as a root and rewire the causal DAG" ) if has_severance_marker: return f"severed_toward:{span.severed_toward}" # parent reference survives; emit the generalized join key for the aggregator return f"resolved:{_resolve_key(span.parent_span_id, shared_key)}" def ingest_batch(spans, shared_key: bytes) -> dict: resolved, severed, rejected = [], [], [] for s in spans: try: outcome = validate_cross_org_edge(s, shared_key) except CausalEdgeSeveranceError as exc: rejected.append((s.span_id, str(exc))) continue if outcome.startswith("severed_toward:"): severed.append(s.span_id) else: resolved.append(s.span_id) completeness = ( len(resolved) / (len(resolved) + len(severed)) if (resolved or severed) else 1.0 ) return { "resolved": resolved, "severed": severed, "rejected": rejected, "causal_completeness": completeness, "answerable": completeness >= 0.95 and not rejected, } ```