# Where must an instance reconcile divergent audit trails before a federated capability grant is honored? **Date of Record:** 2026 November 19 **Scope:** Applies to cross-organization agent federations where a consuming agent (Org B) requests a capability from a provider agent (Org A) under a negotiated policy, and each side maintains an independent, append-only audit log used to justify the grant. Does not cover single-org sub-agent delegation, stateless tool calls, or federations where a single trusted ledger is the sole source of truth. ## Core Distinction The failure is not "the capability request was denied." It is the case where both orgs *believe* the grant is valid, each holding a locally consistent audit trail, and the two trails disagree on the *precondition* that authorized the grant. This is distinct from a signature/identity failure (warrant does not verify) and from a policy mismatch (both sides agree the request violates policy). Here, the warrant verifies cryptographically, the policy text matches byte-for-byte, and yet the grant rests on a *replay of prior state* that the two audit logs render differently. The invariant under attack: **a capability grant must be honored only if the consumer's audit trail and the provider's audit trail agree on the ordered set of policy-mutating events that produced the currently-active policy version.** Neither side can see the other's log in full — only a digest exchange is federated — so reconciliation is a proof obligation, not a read. ## What Was Observed A consumer agent `C` (Org B) requests capability `cap:summarize_pii` from provider agent `P` (Org A). The negotiated policy `P-17` carries a `policy_version` counter that each org increments on local edits. The federation protocol exchanges a `trail_digest`: a Merkle root over `(event_id, event_type, policy_version_after, signer)` tuples. Trace of the divergence: 1. Org A applies policy edit `E-A1` at `policy_version_after=17`, bumping P-17 → v17. A's log root becomes `R_A`. 2. Org B, independently, applies a *different* edit `E-B1` (tightening a data-retention clause) also at `policy_version_after=17`, because B's counter was at 16 and B never received A's edit event — A's edit was published to a topic B's subscriber had not yet rebalanced onto. 3. `C` initiates the capability request, signing a `warrant` that embeds `trail_digest=R_B` and `policy_version=17`. 4. `P` verifies the warrant signature (valid), checks `policy_version==17` (matches its own), and — critically — checks the embedded digest against its *own* `R_A`. The check is `digest==R_A`; it fails. But the protocol's fallback is to accept when `policy_version` matches and the digest is *unrecognized but well-formed*, deferring reconciliation to the audit stage. 5. `P` grants the capability. The operation executes. The PII summary is produced under a policy state that B believes includes `E-B1` (retention-tightened) and A believes includes `E-A1` (retention-loose). The actual data handling follows A's looser local policy. The grant is *honored* while the two trails describe incompatible worlds. Reconciliation is attempted only at end-of-day audit, where the digest mismatch is recorded as a `DIVERGENCE` and the grant is retroactively flagged — after the PII has already moved. ## Condition of Validity The grant was only ever valid under the assumption that `policy_version` is a *total order* over a *shared* event log. In a federation it is neither. Each org's counter is a per-org Lamport-style scalar, not a globally agreed sequence number. Two edits can share the same `policy_version_after` without being the same edit, and the counter alone cannot distinguish "same state" from "different state at the same version." The digest exchange is the only mechanism that could detect this — but it was demoted to an advisory check because the protocol designers assumed digest mismatch implies *tampering*, not *concurrent divergence*. The fallback path (accept on version match, defer digest) is correct for tamper-detection and catastrophic for divergence-detection. Validity requires: the grant is honored **iff** the consumer's `trail_digest` is *recognized* by the provider as the root of a log the provider has previously reconciled against, OR the provider holds a signed `reconciliation_certificate` binding `(R_B, R_A)` to a common ancestor event. Version equality is necessary but not sufficient; digest recognition is the gate. ## Decision Boundary The boundary is between two protocol behaviors that look identical in the happy path: - **Defer-on-unrecognized-digest**: correct when the unrecognized digest indicates a *stale* consumer (B is behind and will catch up). The grant can proceed because the ancestor is common and replay will converge. - **Reject-on-unrecognized-digest**: correct when the unrecognized digest indicates *divergent* consumer state (B and A have both advanced past the last common ancestor independently). The grant must be withheld until reconciliation produces a certificate. The two cases are indistinguishable from the digest alone. The distinguishing evidence is the *common ancestor*: if B's digest chain contains A's last-reconciled root `R_A_prev`, B is merely stale; if it does not, B has diverged. The protocol must carry `last_reconciled_root` in the warrant, and the provider must verify ancestry, not just version. ## Operational Effect When the boundary is crossed without ancestry verification, the failure is silent and asymmetric: A's audit log records a clean grant under v17, B's records a clean grant under v17, and only the *data-handling semantics* differ. Post-hoc audit reconciliation detects the digest mismatch but cannot un-move the PII. The remediation is a compensating control (retention re-application, disclosure), not a rollback. The guardrail that bounds this: **every capability grant carries a `last_reconciled_root` and the provider refuses to honor any warrant whose digest chain does not provably descend from that root.** This converts the silent divergence into a loud, pre-execution rejection — the consumer must reconcile (fetch missing events, re-sign warrant) before the capability is granted. The cost is a reconciliation round-trip on the stale-consumer path; the benefit is that the divergent-consumer path can no longer produce a grant. ## Operational Effect The following reference implementation enforces the ancestry gate. It refuses to honor a grant when the consumer's trail digest does not descend from the last reconciled root, even when `policy_version` matches. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class AuditTrailDivergenceError(RuntimeError): """Raised when a capability warrant's trail digest cannot be proven to descend from the provider's last-reconciled root, despite matching policy_version. Indicates concurrent policy divergence, not staleness.""" @dataclass class Warrant: consumer_org: str policy_version: int trail_digest: str # Merkle root of consumer's audit log last_reconciled_root: str # consumer's view of last common ancestor ancestry_proof: list[str] # sibling hashes from last_reconciled_root -> trail_digest @dataclass class ProviderState: org: str policy_version: int reconciled_root: str # provider's last-reconciled common ancestor log_root: str # provider's current audit log root def _merkle_parent(left: str, right: str) -> str: return hashlib.sha256((left + right).encode()).hexdigest() def _verify_ancestry(proof: list[str], start: str, end: str) -> bool: """Fold the ancestry proof from the claimed common ancestor to the consumer's current root. Returns True iff the fold reproduces `end`.""" node = start for sibling in proof: node = _merkle_parent(node, sibling) return node == end def honor_capability(warrant: Warrant, state: ProviderState) -> bool: # Version equality is necessary but NOT sufficient. if warrant.policy_version != state.policy_version: raise AuditTrailDivergenceError( f"version mismatch: warrant={warrant.policy_version} " f"provider={state.policy_version}" ) # The gate: the consumer's trail must provably descend from the # provider's last-reconciled root. Version match alone is rejected. if warrant.last_reconciled_root != state.reconciled_root: raise AuditTrailDivergenceError( f"no common ancestor: consumer_reconciled={warrant.last_reconciled_root} " f"provider_reconciled={state.reconciled_root}; " f"reconcile before requesting cap" ) if not _verify_ancestry( warrant.ancestry_proof, warrant.last_reconciled_root, warrant.trail_digest, ): raise AuditTrailDivergenceError( f"ancestry proof does not fold to trail_digest " f"{warrant.trail_digest}; consumer log diverged from reconciled root" ) # Only now is the grant semantically sound. return True ```