# What structural signals indicate audit-trail integrity loss when cross-org OpenTelemetry GenAI span redaction severs the parent-child causal chain required for federated replay verification **Date of Record:** 2026 December 3 **Scope:** Applies to federated agent audit pipelines where each participating org exports OpenTelemetry GenAI spans (per the `gen_ai.*` semantic conventions) into a shared, cross-org verification substrate, and where per-org privacy redaction is applied *before* export. Does not apply to single-org observability, to post-hoc log aggregation without causal replay, or to redaction applied at a trusted central broker that retains unredacted causal keys. ## Core Distinction The failure is not "redaction removed a field." The failure is that **redaction removed the *identity* of a span's causal parent while leaving the span itself in place**, producing an orphaned node in the trace DAG. In a single-org OTel deployment this is cosmetic — the trace UI shows a broken edge. In a *federated audit* substrate it is fatal, because the cross-org replay verifier reconstructs the agent's reasoning chain by walking `parent_span_id` edges across org boundaries and asserting that every tool-call span is causally downstream of exactly one admitted prompt span and upstream of exactly one committed result span. The distinction that matters: **redaction is a content operation; causal linkage is a structural operation.** Teams conflate them. When Org B redacts a `gen_ai.prompt` span because it contains PII, and that span was the parent of a tool invocation whose result Org C is auditing, the child survives with a `parent_span_id` pointing at a span Org B no longer exports. The verifier cannot distinguish "parent was redacted for privacy" from "parent never existed" from "parent was dropped by a malicious actor to hide a step." All three present identically: a dangling `parent_span_id`. This is the integrity-loss signature. ## What Was Observed A three-org federated agent deployment (Org A: orchestrator; Org B: retrieval + PII-bearing document tool; Org C: auditor). The agent executed a 14-span reasoning chain. Org B's redaction policy stripped any span with attribute `gen_ai.prompt` containing a detected PII entity, and — critically — it stripped the span *entirely* rather than emitting a tombstone, because the org's DPO read "privacy-preserving redaction" as "the span must not leave the boundary." Observed trace at the federated verifier: ``` span 7 (Org A, tool_call) parent_span_id = 6 span 6 (Org B, retrieval) [REDACTED — not exported] span 8 (Org C, audit_check) parent_span_id = 7 ``` The verifier's replay walk hit span 7, looked up parent 6, found nothing in the federated index, and — under its default policy — treated the missing parent as a **hard integrity violation**, quarantining the entire trace and refusing to certify the agent run. The agent's actual behavior was correct; the audit substrate could not prove it. Two secondary observations made this worse: 1. **Non-deterministic redaction.** Org B's PII detector ran at temperature-adjacent thresholds on free-text `gen_ai.prompt` content; the *same* logical span was redacted on one run and exported on the next because the detector's confidence hovered at threshold. The federated index therefore contained traces where span 6 was present and traces where it was absent, for *identical* agent logic. Replay verification became non-reproducible. 2. **`trace_id` preservation without `span_id` preservation.** Org B kept `trace_id` on its remaining spans (so they still grouped under the federated trace) but did not keep a stable identifier for the redacted span. Downstream, the verifier could see "this trace touched Org B" but could not anchor *which* Org B step the child depended on. ## Condition of Validity The invariant that federated replay verification depends on: > **For every exported span S with a non-null `parent_span_id` P, either (a) a span with `span_id == P` is present in the federated index, or (b) a redaction tombstone with `span_id == P` is present, carrying a signed attestation that P existed, its org, and a commitment (hash) to its unredacted content — without the content itself.** Redaction that emits *nothing* violates this invariant. Redaction that emits a tombstone satisfies it. The distinction is entirely in whether the *existence and identity* of the causal node survives, even when its *content* does not. The condition is only valid when: - The tombstone's `span_id` is derived deterministically from the original span (e.g., the original `span_id`, not a fresh UUID), so children's `parent_span_id` references still resolve. - The tombstone carries the org's signature over `(span_id, trace_id, org_id, content_commitment)`, so the verifier can attribute existence without trusting a central broker. - The content commitment is a salted hash with the salt held by the originating org, so the auditor can later request disclosure under warrant without the federated index ever holding plaintext. It does **not** hold when redaction is applied by a downstream aggregator that has already lost the original `span_id`, or when the org uses span *dropping* (sampling) as a substitute for redaction — sampling and redaction are structurally identical to the verifier and must both emit tombstones. ## Decision Boundary The boundary the operator must decide, per span class: - **Drop-and-forget** (current failing behavior): span removed, no tombstone. Valid only if no cross-org child can ever reference it. In a federated agent chain, this is almost never true — any span that is a `parent_span_id` target of an exported span must be tombstoned. - **Tombstone-with-commitment** (required behavior): span content withheld, existence + identity + signed commitment exported. This is the only mode that preserves the DAG invariant. Cost: the federated index learns that *a* step occurred at Org B at time T with a given content hash — a metadata leak the org must accept as the price of auditability. - **Content-preserving export with field-level masking**: keep the span, mask only PII substrings inside `gen_ai.prompt`. Preserves the DAG trivially but leaks structure (prompt length, token positions, surrounding context) and is defeated by re-identification attacks on masked free text. The decision is *not* "redact or don't." It is "which of existence, identity, and content do you withhold, and does your choice preserve the parent-child resolvability the verifier requires." Withholding content is safe. Withholding identity is fatal. A second boundary: when the PII detector is non-deterministic, the redaction decision itself must be **committed and logged** (decision, threshold, model version, confidence) inside the tombstone attestation, so that replay can distinguish "redacted this run" from "not redacted this run" and reconstruct which agent logic produced which trace shape. Without this, replay non-reproducibility is indistinguishable from tampering. ## Operational Effect When the invariant is violated, the observable operational effects are: 1. **False quarantine of correct agent runs.** The verifier cannot certify a run whose causal chain is broken by redaction, so it quarantines. Operators see a rising quarantine rate that correlates with *privacy policy strictness*, not with agent misbehavior — a counterintuitive signal that is frequently misdiagnosed as an agent bug. 2. **Silent downgrade to "trace present, chain unverified."** Some verifiers, rather than quarantining, mark the trace as `chain_incomplete` and certify the run at reduced assurance. This is worse: it passes audit while providing no causal guarantee, and the reduced-assurance flag is buried in a field nobody reads. 3. **Replay divergence between orgs.** Because Org B's redaction is non-deterministic, Org A and Org C replaying the same logical run from their local copies reconstruct different DAGs. Cross-org consensus on "what the agent did" fails not because the agent diverged but because the *audit substrate* diverged. 4. **Adversarial exploitation.** An agent (or a compromised tool) that wants to hide a step can induce redaction of its parent span by emitting PII-shaped content into `gen_ai.prompt`, causing the parent to be dropped and the chain to break — converting a privacy control into an audit-evasion primitive. The guardrail: **tombstone-or-refuse.** The federated export client must, before transmitting, scan the local span set for any `parent_span_id` that references a span it is about to drop, and emit a signed tombstone for each such reference. If it cannot (e.g., the parent was never in its local set), it must refuse to export the child and raise, rather than export a dangling edge. The verifier must treat any dangling `parent_span_id` without a matching tombstone as a hard failure, and any tombstone whose signature does not verify against the claimed org's key as a forgery. ```python import hashlib import hmac from dataclasses import dataclass class DanglingCausalReferenceError(RuntimeError): """Raised when an exported span references a parent that is neither present nor tombstoned, breaking the federated replay DAG invariant.""" pass class TombstoneSignatureError(RuntimeError): """Raised when a redaction tombstone fails signature verification against the originating org's key.""" pass @dataclass(frozen=True) class Span: span_id: str trace_id: str org_id: str parent_span_id: str | None content: bytes @dataclass(frozen=True) class Tombstone: span_id: str trace_id: str org_id: str content_commitment: str # salted hash of unredacted content redaction_decision: str # e.g. "pii_detected", "sampled_out" signature: str # HMAC over (span_id, trace_id, org_id, commitment) def make_tombstone(span: Span, salt: bytes, org_key: bytes, decision: str) -> Tombstone: commitment = hashlib.sha256(salt + span.content).hexdigest() msg = f"{span.span_id}|{span.trace_id}|{span.org_id}|{commitment}".encode() sig = hmac.new(org_key, msg, hashlib.sha256).hexdigest() return Tombstone(span.span_id, span.trace_id, span.org_id, commitment, decision, sig) def export_with_tombstones( spans: list[Span], to_redact: set[str], salts: dict[str, bytes], org_keys: dict[str, bytes], decision: str = "pii_detected", ) -> tuple[list[Span], list[Tombstone]]: """Export spans, converting any redacted span into a signed tombstone so that cross-org children's parent_span_id references remain resolvable.""" exported = [s for s in spans if s.span_id not in to_redact] exported_ids = {s.span_id for s in exported} tombstones: list[Tombstone] = [] for s in spans: if s.span_id in to_redact: tombstones.append( make_tombstone(s, salts[s.org_id], org_keys[s.org_id], decision) ) tomb_ids = {t.span_id for t in tombstones} # Guardrail: every exported child's parent must resolve to a span or tombstone. for child in exported: p = child.parent_span_id if p is not None and p not in exported_ids and p not in tomb_ids: raise DanglingCausalReferenceError( f"span {child.span_id} (org {child.org_id}) references parent {p} " f"which is neither exported nor tombstoned; refusing to export a " f"dangling causal edge into the federated index" ) return exported, tombstones def verify_federated_trace( exported: list[Span], tombstones: list[Tombstone], org_keys: dict[str, bytes], ) -> None: """Replay verifier: assert the DAG invariant and tombstone authenticity.""" tomb_by_id = {t.span_id: t for t in tombstones} for t in tombstones: msg = f"{t.span_id}|{t.trace_id}|{t.org_id}|{t.content_commitment}".encode() expected = hmac.new(org_keys[t.org_id], msg, hashlib.sha256).hexdigest() if not hmac.compare_digest(expected, t.signature): raise TombstoneSignatureError( f"tombstone {t.span_id} from org {t.org_id} failed signature " f"verification; possible forgery or key mismatch" ) known = {s.span_id for s in exported} | set(tomb_by_id) for s in exported: p = s.parent_span_id if p is not None and p not in known: raise DanglingCausalReferenceError( f"replay: span {s.span_id} has unresolvable parent {p}; " f"causal chain broken and uncertifiable" ) ```