# What structural signals indicate policy-shadow divergence in cross-organization agent federation audit trails **Date of Record:** 2026 November 19 **Scope:** Applies to federated multi-agent systems where agents in distinct trust domains (organizations) exchange messages under per-domain egress/ingress policy filters and each domain emits an independent append-only audit log used for cross-domain reconciliation. Does not apply to single-tenant agent meshes with a unified log, nor to purely cryptographic transport failures where the message never reaches the policy layer. ## Core Distinction The failure mode is not message loss and not policy denial. It is **policy-shadow divergence**: a message that is *admitted* by both the sender's egress policy and the receiver's ingress policy, *delivered* successfully, and *acted upon* by the receiving agent, yet produces non-equivalent audit records on the two sides because each domain's policy filter rewrites (redacts, normalizes, or re-scopes) the message envelope before logging. The two audit logs are each individually consistent; they diverge only in the *reconstruction* of the causal chain when a third party replays them together. Operators routinely conflate this with tamper detection or with schema mismatch. It is neither. Both logs are honest. The divergence is structural: the audit record is generated *post-filter* on each side, so the filter's transformation becomes an invisible, asymmetric projection between two views of one event. The invariant that fails is **replay equivalence under federation join**: `replay(egress_log) == replay(ingress_log)` over the shared message-ID set. It fails silently because no single domain can observe the inequality — it only materializes when a cross-domain auditor joins the two logs, usually weeks later during an incident. ## What Was Observed A three-org federation: Org A (orchestrator agent), Org B (tool-executing agent), Org C (auditor agent). A's egress policy redacts `principal_scope` fields tagged `internal` and rewrites `correlation_id` to a domain-local salted hash before writing its audit record. B's ingress policy strips unknown envelope extensions but preserves `correlation_id` verbatim for its own log. C joins A's and B's logs on `correlation_id`. Trace of a single delegated tool call: 1. A emits message `m-4471` with `correlation_id: "corr-9f2a"` and `principal_scope: "internal:team-7"`. 2. A's egress filter redacts `principal_scope` and rewrites `correlation_id` → `h_a("corr-9f2a") = "c1d0..."` in A's audit record. The wire message carries the *original* `corr-9f2a` (redaction is applied to the log projection, not the wire, for fields B is entitled to see — but `principal_scope` is stripped from the wire too). 3. B receives `corr-9f2a`, executes the tool, logs `corr-9f2a` with `principal_scope` absent (never received). 4. C attempts to join on `correlation_id`. A's keys are hashed; B's are plaintext. **Zero join matches.** C's reconciliation reports "no corresponding egress record" for every B-side entry — which C's heuristic classifies as *unattributed ingress*, i.e., a potential injection, triggering a false quarantine of B. The structural signal that preceded the incident: A's audit records had a `correlation_id` field whose value distribution was uniform over 128-bit space, while B's had a distribution with visible shared prefixes across related calls. Neither domain flagged it; each was internally valid. The divergence was detectable only as a **statistical asymmetry in the join-key space between two logs that claim to describe the same event stream**. A second, subtler signal: message counts matched (A logged 4,471 egress; B logged 4,471 ingress) but the *field-presence vectors* differed — A's records always contained a `redaction_applied: true` marker on the redacted field, B's records never contained the field at all. The presence vector is the cheapest cross-domain invariant to check and the one most often skipped. ## Condition of Validity The replay-equivalence invariant holds — i.e., cross-domain join is sound — only when all of the following are true: - **Join-key stability:** every domain applies a *commutative, order-independent, deterministic* transform to the join key, or none. A salted hash on one side and identity on the other violates this. Salting must be federation-wide or the key must be carried in a form both sides project identically (e.g., a federation-issued opaque `federation_trace_id` that no domain-local policy is permitted to rewrite). - **Projection symmetry:** any field a policy redacts must be redacted *identically* on both the wire and the audit projection, and both sides must record the *fact* of redaction with the same marker schema. A field silently absent on one side and explicitly redacted on the other is a divergence even if the underlying value never leaked. - **Filter idempotence and logging order:** the audit record must be emitted from the *post-filter* canonical form on every side, and the filter version must be recorded in the audit record. If A logs pre-filter and B logs post-filter, the join is unsound regardless of key handling. - **No lossy envelope extension stripping without a tombstone:** if B strips unknown extensions, it must log a `stripped_fields: [...]` tombstone so C can distinguish "field never sent" from "field sent and removed." When any condition is unmet, the federation's audit trail is *locally sound but globally unsound*, and the failure is undetectable from within any single domain. ## Decision Boundary The boundary is whether the federation treats the audit log as a **projection of the wire event** or as an **independent record**. If logs are projections, cross-domain join requires a federation-level canonicalization contract applied before any domain-local policy — the log is written from the canonical form, and domain policy only governs *visibility*, not *content* of the join-relevant fields. If logs are independent records, the federation must not promise replay equivalence and must instead reconcile via a federation-issued trace token that is out-of-band relative to domain policy. Concretely: **permit domain-local rewriting of the join key only if the federation also emits a policy-independent trace token.** If the token does not exist, the correct decision is to *refuse to join* rather than to join on a lossy key and misclassify unattributed ingress as injection. The failure to make this explicit is what causes auditor agents (Org C) to quarantine legitimate peers. The decision to escalate is triggered when a join produces a match rate below a domain-calibrated floor *while message counts match within tolerance*. Count-match with join-miss is the signature of policy-shadow divergence, not of attack. ## Operational Effect The downstream effect is **false-positive quarantine cascades**. C's auditor, seeing unattributed ingress, quarantines B. B's subsequent messages to A are then refused at A's ingress (B is flagged), producing genuine egress/ingress count mismatch — which now *looks* like the original suspected attack, confirming C's hypothesis. The system converges on a stable but wrong belief: a healthy peer is isolated, and the audit trail now contains real divergence caused by the response to the false divergence. Recovery requires an operator to manually reconcile the two logs with knowledge of both domains' filter versions — information neither agent possesses. The guardrail is a **pre-join structural check** run before any reconciliation logic: verify join-key distributional compatibility, field-presence-vector equality, and filter-version parity across the candidate logs. If any check fails, the auditor must escalate as *configuration divergence*, never as *security event*. The two have opposite remediation paths and conflating them is the operational cost. ```python import hashlib from dataclasses import dataclass, field from typing import Sequence class PolicyShadowDivergence(RuntimeError): """Raised when two federated audit logs cannot be soundly joined.""" @dataclass class AuditRecord: message_id: str correlation_id: str filter_version: str present_fields: frozenset redaction_markers: dict = field(default_factory=dict) def _join_key_signature(records: Sequence[AuditRecord]) -> tuple: # Distributional fingerprint of the join key space, independent of values. lengths = {len(r.correlation_id) for r in records} hexlike = all( all(c in "0123456789abcdef" for c in r.correlation_id) for r in records ) return (frozenset(lengths), hexlike) def assert_joinable( egress: Sequence[AuditRecord], ingress: Sequence[AuditRecord], min_match_rate: float = 0.95, ) -> None: if len(egress) != len(ingress): # Count mismatch is a legitimate transport/security signal; not our scope. return eg_sig = _join_key_signature(egress) in_sig = _join_key_signature(ingress) if eg_sig != in_sig: raise PolicyShadowDivergence( f"Join-key space asymmetric: egress={eg_sig} ingress={in_sig}. " "One side is hashing/rewriting the key; join is unsound." ) eg_presence = {r.present_fields for r in egress} in_presence = {r.present_fields for r in ingress} if eg_presence != in_presence: raise PolicyShadowDivergence( "Field-presence vectors differ between domains; a redaction on one " "side is a silent absence on the other. Escalate as config " "divergence, NOT as injection." ) eg_filters = {r.filter_version for r in egress} in_filters = {r.filter_version for r in ingress} if eg_filters != in_filters: raise PolicyShadowDivergence( f"Filter-version parity violated: egress={eg_filters} " f"ingress={in_filters}. Logs are projections of different " "canonical forms." ) eg_keys = {r.correlation_id for r in egress} matched = sum(1 for r in ingress if r.correlation_id in eg_keys) rate = matched / len(ingress) if rate < min_match_rate: raise PolicyShadowDivergence( f"Join match rate {rate:.3f} below floor {min_match_rate} despite " "equal message counts — signature of policy-shadow divergence, " "not of attack. Do not quarantine the peer." ) ```