# How does an instance detect cross-org trace correlation poisoning when privacy-preserving span linking silently re-associates forensic spans to the wrong agent lineage **Date of Record:** 2026 November 22 **Scope:** Applies to federated multi-org agent deployments where distributed traces are correlated across trust boundaries using privacy-preserving linking tokens (hashed span IDs, salted join keys, or differential-privacy (DP) sketches) rather than raw span identifiers. Does not apply to single-org tracing, or to federated correlation that shares raw span IDs under a shared trust domain. ## Core Distinction The distinction that matters is between **linkage correctness** and **linkage verifiability**. In a single trust domain, a trace correlation is correct if the join key matches; the join key is the authoritative record and can be re-read at any time. In a federated, privacy-preserving deployment, the join key is *deliberately destroyed or obfuscated* at the producer boundary — the consumer org only ever sees a salted hash, a bucketed sketch, or a noisy count. That means a mis-correlation is **not detectable by re-reading the source**; the source org has already discarded the preimage, and the consumer org has no way to recompute it. Linkage correctness becomes a probabilistic claim, not a verifiable one. The failure mode is therefore not "the hash collided" (rare, and usually caught). It is **silent re-association**: a span that belongs to agent lineage A gets linked to lineage B because the privacy mechanism (salt rotation, DP noise, sketch collision under heavy cardinality) made two distinct lineages indistinguishable at the join boundary, and the consumer's correlation engine resolves the ambiguity by *choosing* — usually by first-match or by most-recent-write. The consumer then attributes A's reasoning trace, tool calls, and audit events to B's agent identity. Forensics, incident attribution, and cross-org accountability all inherit the error. ## What Was Observed A three-org federated deployment: an orchestrator org (O), a tool-provider org (T), and an auditor org (A). O runs the agent; T executes tool calls; A receives privacy-preserving span links for compliance replay. Linking used a per-epoch salted hash of `(lineage_id, span_id)` with the salt held by T and rotated every 6 hours; A received only the salted digest plus a DP-noised duration bucket. The observed trace: 1. Agent lineage `L-4417` (a sub-agent spawned by O for a long-running data-reconciliation task) issued 14 tool calls to T over 5 hours 50 minutes — spanning a salt rotation boundary at hour 6. 2. At rotation, T re-salted. The same `L-4417` span family produced digests under salt `S1` for calls 1–11 and under salt `S2` for calls 12–14. T emitted both digest sets to A without a linkage-continuity marker; the rotation was an internal T concern. 3. A's correlation engine, receiving `S2` digests it had never seen, attempted to attach them to an existing lineage by nearest-DP-sketch match. The noised duration sketch for `L-4417` call 12 was within the noise band of a *different* lineage `L-4402` (a sibling sub-agent that had terminated 40 minutes earlier). 4. A re-associated calls 12–14 to `L-4402`. Because `L-4402` was marked terminated, A's replay engine flagged the new spans as **post-termination activity** — a high-severity anomaly — and opened an incident against `L-4402`'s owning account. 5. Meanwhile `L-4417`'s audit record showed a 3-call gap. On subsequent replay, A's verifier treated the gap as *missing telemetry* and down-weighted `L-4417`'s compliance score, even though the calls existed and succeeded. The poisoning was silent in both directions: `L-4402` was accused of activity it never performed, and `L-4417` was penalized for telemetry that was present but mis-routed. Neither org could detect it from its own side. O saw successful tool calls; T saw correct digests emitted; A saw a coherent (but wrong) correlation graph. ## Condition of Validity The re-association is only possible under a specific conjunction, and the guardrail must be evaluated against that conjunction rather than against correlation accuracy in general: - **Salt/epoch rotation occurs within a single lineage's lifetime.** If lineages are shorter than the rotation period, rotation never splits a lineage and the ambiguity cannot arise from this path. The invariant is `lineage_duration < rotation_period` OR an explicit continuity token carried across the rotation. - **The privacy mechanism's ambiguity set is non-singleton at the join boundary.** DP noise bands, sketch collisions, or bucketed hashes must *overlap* for two distinct lineages. If the mechanism guarantees injective linkage within the population, no re-association is possible. The invariant is `collision_probability(lineage_population) < ε` for the declared ε. - **The consumer resolves ambiguity by selection rather than by rejection.** This is the decisive condition. A correlation engine that *rejects* an ambiguous link (marks it `UNRESOLVED`) cannot poison; one that *selects* a best match can. The invariant is: **ambiguous links must be surfaced as unresolved, never resolved by heuristic.** The failure does *not* require a bug in the hash, the salt, or the DP mechanism. Each component behaved as specified. The failure is in the composition: a correct privacy mechanism plus a correct correlation engine plus a rotation policy that no single component owned. ## Decision Boundary The operational decision is where to place the resolution authority for an ambiguous federated link. Three boundaries are defensible; the observed failure came from an implicit fourth. | Boundary | Who resolves ambiguity | Detectable? | Forensic value | |---|---|---|---| | Producer resolves (T emits continuity token across rotation) | T | Yes, at T | High — linkage preserved | | Consumer rejects (`UNRESOLVED` state) | A | Yes, at A (as a gap) | Medium — gap is honest | | Auditor cross-checks against raw (breaks privacy) | A with O's consent | Yes | High but violates the privacy contract | | **Consumer selects by heuristic (observed)** | A implicitly | **No** | **Negative — poisons both lineages** | The decision boundary is: **any federated correlation that must resolve ambiguity to produce a usable trace has already forfeited privacy-preserving verifiability.** If the trace is only usable when every span is linked, then the linkage must be made verifiable (continuity token, or a commitment scheme the producer can later open), not merely probable. If the trace can tolerate unresolved spans, the consumer must be *required* to emit `UNRESOLVED` rather than select. The concrete rule: a correlation engine must treat "two candidate lineages within the ambiguity band" as a **hard stop**, not a ranking problem. Ranking is the poison. ## Operational Effect Downstream of a silent re-association, three effects compound: 1. **False post-termination anomalies.** A terminated lineage that receives re-associated spans generates high-severity alerts that are unfalsifiable from the auditor's side — the auditor cannot prove the spans belong elsewhere without the preimage it deliberately discarded. 2. **Telemetry-gap penalties on the true lineage.** The lineage that actually emitted the spans shows a gap and is scored as non-compliant. The penalty is applied to the *victim*, not the mechanism. 3. **Irreversible forensic drift.** Once A's correlation graph is written, replay against it reproduces the same wrong associations deterministically. The error is stable and therefore looks like ground truth on re-inspection — the worst property a forensic record can have. The guardrail that bounds this: **linkage continuity must be a first-class, producer-signed artifact, not an emergent property of matching.** Concretely: (a) the producer emits a `lineage_continuity_token` that survives salt rotation and is signed by the producer's key; (b) the consumer's correlation engine has no code path that resolves an ambiguous link by selection — ambiguity yields `UNRESOLVED` and a `LINKAGE_AMBIGUITY` event; (c) the auditor treats any span arriving under a rotated epoch without a continuity token as *unlinked*, never as *re-associated*. The invariant to assert at the consumer boundary is: `for every received span, exactly one of {linked-with-valid-continuity-token, explicitly-unresolved} holds; linked-by-heuristic is a protocol violation.` ```python import hashlib from dataclasses import dataclass, field from typing import Optional class LinkagePoisoningError(RuntimeError): """Raised when a federated correlation engine attempts to resolve an ambiguous span link by heuristic selection instead of declaring it UNRESOLVED. Selecting here is what silently re-associates forensic spans to the wrong agent lineage.""" pass @dataclass class FederatedSpan: lineage_id: str span_id: str epoch_salt: str continuity_token: Optional[str] = None # producer-signed, survives rotation duration_bucket: Optional[int] = None # DP-noised @dataclass class CorrelationEngine: ambiguity_band: int = 2 # buckets of overlap treated as ambiguous known_lineages: dict = field(default_factory=dict) # lineage_id -> last_bucket resolved: list = field(default_factory=list) unresolved: list = field(default_factory=list) def _candidate_lineages(self, span: FederatedSpan) -> list: if span.duration_bucket is None: return [] return [ lid for lid, bucket in self.known_lineages.items() if abs(bucket - span.duration_bucket) <= self.ambiguity_band ] def ingest(self, span: FederatedSpan) -> str: # Path 1: continuity token present -> verifiable link, no ambiguity. if span.continuity_token is not None: self.resolved.append(span) self.known_lineages[span.lineage_id] = span.duration_bucket or 0 return "LINKED_VERIFIED" # Path 2: no token. If the ambiguity set is non-singleton, we MUST NOT select. candidates = self._candidate_lineages(span) if len(candidates) > 1: # The observed failure: a naive engine ranks candidates and picks one. # That is a protocol violation under a privacy-preserving contract. raise LinkagePoisoningError( f"span {span.span_id} from lineage {span.lineage_id} is ambiguous " f"across candidates {candidates}; heuristic selection would " f"re-associate forensic spans. Emit UNRESOLVED instead." ) if len(candidates) == 1 and candidates[0] != span.lineage_id: # Single candidate but wrong lineage: also a re-association attempt. raise LinkagePoisoningError( f"span {span.span_id} claims lineage {span.lineage_id} but only " f"candidate is {candidates[0]}; refusing silent re-association." ) # Genuinely unambiguous or no overlap: accept as unresolved-safe. self.unresolved.append(span) return "UNRESOLVED" def correlate_batch(engine: CorrelationEngine, spans: list) -> dict: outcomes = {"LINKED_VERIFIED": 0, "UNRESOLVED": 0, "POISONED": 0} for span in spans: try: outcome = engine.ingest(span) outcomes[outcome] += 1 except LinkagePoisoningError: outcomes["POISONED"] += 1 return outcomes # Reproduction of the observed failure trace. if __name__ == "__main__": engine = CorrelationEngine(ambiguity_band=2) # L-4402 terminated earlier, bucket 10. engine.known_lineages["L-4402"] = 10 spans = [ # L-4417 call 12: post-rotation, no continuity token, DP bucket within # the ambiguity band of the terminated L-4402. FederatedSpan(lineage_id="L-4417", span_id="s12", epoch_salt="S2", continuity_token=None, duration_bucket=11), # A properly signed span for contrast. FederatedSpan(lineage_id="L-4417", span_id="s13", epoch_salt="S2", continuity_token="sig:O:4417:13", duration_bucket=11), ] print(correlate_batch(engine, spans)) # Expected: the unsigned ambiguous span is refused, not re-associated. ```