# How does an instance detect correlation-identifier collapse when federated audit logs cross a trust-domain clock boundary **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent systems where audit records are emitted into per-domain log stores and later joined on a shared correlation identifier (trace ID, task ID, warrant ID) for cross-domain verification. Does not apply to single-domain logging or to systems that ship a single canonical event stream from one clock source. ## Core Distinction A correlation identifier is not a fact about causality; it is a *claim* that two records describe the same causal chain. In a federated audit fabric, that claim is only as strong as the weakest domain's identifier-generation path. The non-obvious failure is not identifier *loss* (a missing ID is trivially detected) but identifier *collapse*: two distinct causal chains in different trust domains independently mint the same identifier because their generators share a seed, a counter namespace, or a time-bucketed derivation scheme. Collapse is silent. Every join succeeds. The audit log is internally consistent and externally wrong. The invariant that must hold is: **for any two audit records R_a and R_b that join on correlation ID C, there must exist a causal path in the actual execution graph connecting them.** Federation breaks this invariant because the join is computed on the identifier alone, and the identifier was minted by a domain that had no visibility into the other domain's minting. ## What Was Observed A three-domain deployment: an orchestrator domain (O), a tool-execution domain (T), and an auditor domain (A). Each domain minted correlation IDs as `{domain_prefix}-{epoch_ms}-{counter}`, where `counter` reset to zero on process restart and `epoch_ms` was bucketed to the nearest second to keep IDs short. The auditor joined records across domains on the full ID string. During a rolling restart of T, two tool-worker processes came up within the same second, both with `counter=0`. The first request handled by each worker received ID `T-1749600000000-0`. These were genuinely different tasks: one was a read of a customer record, the other was a write to a different customer's record. The auditor's join, keyed on the ID, fused them into a single trace. The fused trace showed a read of customer X followed by a write to customer Y under one warrant. The auditor's policy engine evaluated the fused trace against a warrant scoped to customer X, saw the write to Y, and raised a *false* cross-tenant violation. Simultaneously, the genuine write-to-Y trace, which should have triggered a real violation, was never assembled because its constituent records had been absorbed into the X trace. The failure trace: 1. T restarts two workers at `t=1749600000.412` and `t=1749600000.887`. Both bucket to `1749600000000`. 2. Both workers initialize `counter=0`. Neither has cross-process coordination. 3. Task 1 (read X) on worker 1 emits `T-1749600000000-0`. 4. Task 2 (write Y) on worker 2 emits `T-1749600000000-0`. 5. A receives both, groups by ID, produces one trace with two root spans. 6. Policy evaluation runs on the fused trace. The warrant-scope check compares the trace's *set* of touched resources against the warrant's scope and finds a mismatch. 7. False positive on X; true positive on Y suppressed because Y's records are no longer a coherent trace. The auditor had a "duplicate root span" check that would have flagged this, but it was configured to *warn*, not *fail*, because legitimate fan-out (one task, multiple parallel tool calls) also produces multiple root spans. The warning was drowned in fan-out noise. ## Condition of Validity The join-on-identifier invariant is valid only when the identifier is *globally unique across the federation for the lifetime of the audit retention window*. That requires one of: - A single minting authority (all IDs issued by O, propagated to T and A as opaque tokens). - A collision-resistant derivation that includes domain identity, process identity, and a monotonic non-resetting counter (e.g., `{domain}-{process_uuid}-{monotonic_counter}`). - A minting scheme whose entropy is large enough that birthday-bound collisions are negligible over the retention window (128-bit random, not time-bucketed-plus-counter). The observed scheme satisfied none of these. Time bucketing to one second reduced entropy to the counter space; counter reset removed even that. The condition of validity was violated at minting time, but the violation was invisible at join time because join only checks equality. A second validity condition: the auditor must be able to distinguish *legitimate multi-root traces* (fan-out) from *collapsed traces* (two causal chains fused). This requires a per-record field that fan-out preserves and collapse destroys — for example, a `parent_span_id` that must be unique within a trace, or a `causal_chain_root` field that must be constant within a trace. Equality-only joins cannot make this distinction. ## Decision Boundary The boundary is between *detecting collapse at join time* and *preventing collapse at mint time*. Prevention is the only sound option; detection at join time is probabilistic and lossy. Prevention requires the minting domain to guarantee global uniqueness. If the federation cannot enforce a single minting authority, the next-best boundary is: **every audit record must carry a domain-scoped identifier plus a domain-independent causal token, and joins must require agreement on both.** The causal token is minted once at the root of the causal chain (by O, which sees the whole task) and propagated to every downstream domain as an opaque field. Downstream domains may mint their own local IDs freely; the join is on the propagated causal token, not the local ID. If neither is possible — e.g., domains are independently operated and cannot share a root token — then the decision boundary is: **the auditor must treat identifier-only joins as advisory, not probative, and must require a secondary corroborating field (timestamp ordering within a tolerance window, resource-set overlap, or a signed warrant reference) before treating a joined trace as a single causal chain.** This degrades the auditor's precision but bounds the false-positive/false-negative blast radius. The boundary condition that tips the decision: if the auditor's policy engine can take *irreversible* action (revoke a warrant, quarantine a tenant, file a compliance finding) on a joined trace, identifier-only joins are unacceptable. If the auditor only produces advisory signals for human review, identifier-only joins with a duplicate-root warning are tolerable, provided the warning is not suppressed by fan-out. ## Operational Effect After the incident, the deployment moved to propagated causal tokens: O mints a 128-bit random `causal_root` at task creation, every downstream record carries it, and the auditor joins on `causal_root` with a hard requirement that all records sharing a `causal_root` also share a `warrant_id`. The duplicate-root warning was promoted to a hard failure *only when* `warrant_id` differs across roots, which distinguishes collapse from fan-out. The residual risk: a domain that fails to propagate `causal_root` (e.g., a tool that strips unknown headers) produces records that cannot be joined. These are quarantined as `unattributable` rather than silently joined on local ID. The audit log now has a third state — *unattributable* — that did not exist before, and the policy engine must handle it explicitly. This is the operational cost of the invariant: you trade silent false joins for loud unattributable records, and you must build a path for the latter. The general lesson: in federated audit, the correlation identifier is a *trust assertion*, and trust assertions must be minted by an authority that can see the whole causal chain, or they must be corroborated. An identifier minted by a domain that cannot see the other domains is a local fact masquerading as a global one. ```python import hashlib from dataclasses import dataclass class CorrelationCollapseError(RuntimeError): """Raised when a federated audit join fuses distinct causal chains.""" pass @dataclass(frozen=True) class AuditRecord: domain: str local_id: str causal_root: str | None warrant_id: str resource: str def join_federated_trace(records: list[AuditRecord]) -> dict[str, list[AuditRecord]]: """ Join records into traces keyed by causal_root. Rejects records lacking a causal_root (unattributable) and rejects any causal_root whose records disagree on warrant_id (the signature of identifier collapse). """ traces: dict[str, list[AuditRecord]] = {} unattributable: list[AuditRecord] = [] for rec in records: if rec.causal_root is None: unattributable.append(rec) continue traces.setdefault(rec.causal_root, []).append(rec) for root, group in traces.items(): warrants = {r.warrant_id for r in group} if len(warrants) > 1: raise CorrelationCollapseError( f"causal_root={root!r} spans multiple warrants {sorted(warrants)}; " f"records: {[(r.domain, r.local_id, r.resource) for r in group]}" ) if unattributable: raise CorrelationCollapseError( f"{len(unattributable)} record(s) lack causal_root and cannot be " f"joined: {[(r.domain, r.local_id) for r in unattributable]}" ) return traces def mint_causal_root(task_payload: bytes) -> str: """Root authority mints a 128-bit causal token; propagated as opaque field.""" return hashlib.sha256(task_payload).hexdigest()[:32] ```