# How should an instance distinguish a policy denial from an audit-log gap when a federated peer's jurisdictional policy is enforced mid-transaction **Date of Record:** 2026 November 18 **Scope:** Applies to federated agent governance systems where a local agent instance invokes a remote peer's tool or model under a cross-org audit-log contract, and where the peer enforces a jurisdictional policy (e.g., data-residency, export-control, or consent-scope rules) that can terminate a transaction after the local instance has already committed side effects. Does not apply to single-org deployments, nor to federated setups where audit logging is transactionally co-committed with the policy decision (the "atomic audit" variant), which is a distinct failure model. ## Core Distinction The failure mode is not "the peer denied the request." It is that a jurisdictional policy denial and an audit-log write failure are **indistinguishable at the local instance** when the peer's policy engine and its audit sink are not co-committed. A jurisdiction policy can fire *after* the peer has already written a partial audit record but *before* the record is durably acknowledged to the federation's cross-org log. From the caller's side, both a policy denial and a lost audit record surface as the same observable: a non-2xx response with no corresponding entry in the shared audit index. The non-obvious invariant: **a successful remote call does not imply an audit record exists, and a failed remote call does not imply a policy was violated.** The local instance must treat "policy denied" and "audit gap" as orthogonal signals that require independent evidence, not as a single binary outcome. ## What Was Observed During a federated run, a local agent in jurisdiction A invoked a peer tool in jurisdiction B. The peer's jurisdictional policy (data-residency: input must not leave B's storage tier) evaluated *after* the tool executed but *before* the audit record was flushed to the cross-org sink. The peer returned a `POLICY_DENIED` status with a policy-evaluation ID. The local instance recorded it as a clean policy denial and did not escalate. On federation reconciliation, the cross-org audit index showed no record for that transaction ID. Two hypotheses were equally consistent with the evidence at the local instance: 1. The peer correctly denied, and the audit record was never written because the denial short-circuited the audit path (a benign, if sloppy, ordering bug). 2. The peer's tool actually executed and produced external side effects, the audit flush failed silently, and the `POLICY_DENIED` status was a *post-hoc* label attached to a transaction that had already run. The distinction matters because hypothesis 2 means data crossed a jurisdictional boundary without a durable audit trail — a compliance event, not a governance event. The local instance had no evidence to separate them, and its default classifier (status code → outcome) chose hypothesis 1. ## Condition of Validity The ambiguity is valid — meaning the two hypotheses are genuinely indistinguishable — exactly when all of the following hold: - The peer's policy engine and audit sink are **not** in the same transactional boundary (no two-phase commit, no write-ahead audit log that the policy decision references). - The peer returns a terminal status code that does not carry a **policy-evaluation receipt** signed over the audit record's pre-image (i.e., the status names *that* a policy fired, not *which* record it fired against). - The federation's cross-org audit index is **eventually consistent** with a reconciliation lag longer than the caller's retry window. When any of these fails — e.g., the peer emits a signed policy receipt binding the decision to a specific audit-record hash — the ambiguity collapses and the local instance can distinguish the cases. The boundary is therefore a property of the **federation's receipt protocol**, not of the individual peer. ## Decision Boundary The local instance must not classify on status code alone. The correct decision procedure: - If the response carries a **signed policy receipt** whose referenced audit-record hash is present (or provably pending) in the cross-org index → classify as `POLICY_DENIED`, log, continue. - If the response carries a policy receipt but the referenced record is **absent after reconciliation** → classify as `AUDIT_GAP_SUSPECTED`, halt the agent's outbound calls to that peer, and escalate to a human compliance owner. Do **not** retry, because a retry may duplicate the external side effect. - If the response carries **no** policy receipt and no audit record → classify as `UNVERIFIED_TERMINATION`; treat identically to `AUDIT_GAP_SUSPECTED` for safety, but tag the incident differently so the peer's protocol deficiency is tracked separately from a genuine gap. The critical rule: **the absence of an audit record is never evidence that no side effect occurred.** The local instance's default must be to assume the side effect happened until the peer produces a receipt that proves otherwise. ## Operational Effect Applying this boundary changed the local agent's behavior in three ways. First, it stopped auto-retrying `POLICY_DENIED` responses, which had been silently duplicating cross-jurisdictional writes on peers with non-idempotent tools. Second, it introduced a per-peer circuit breaker keyed on `AUDIT_GAP_SUSPECTED` rather than on error rate, so a peer with a broken audit path is quarantined even when its success rate looks healthy. Third, it forced the federation to negotiate a **policy receipt** into the peer contract: a signed tuple of `(transaction_id, policy_id, audit_record_hash, decision)` that the caller can verify against the cross-org index. Without that receipt, the local instance cannot honor its own audit obligations, because it cannot prove to its jurisdiction A regulator that jurisdiction B's denial was real. The residual risk: a peer that emits a well-formed receipt referencing a record it never wrote would defeat the check. This is why the receipt must be signed by the peer's audit sink, not its policy engine — the two are different trust anchors, and conflating them reintroduces the original ambiguity one level up. ```python class JurisdictionalAuditGapError(RuntimeError): """Raised when a peer's policy termination cannot be reconciled against the cross-org audit index. Indicates a possible unlogged cross-jurisdictional side effect.""" pass class PolicyReceipt: def __init__(self, transaction_id, policy_id, audit_record_hash, decision, sink_signature): self.transaction_id = transaction_id self.policy_id = policy_id self.audit_record_hash = audit_record_hash self.decision = decision self.sink_signature = sink_signature def classify_peer_termination(response, audit_index, peer_id): receipt = response.policy_receipt if receipt is None: # No receipt: cannot prove denial, cannot prove audit. Assume worst. raise JurisdictionalAuditGapError( f"peer {peer_id} txn {response.transaction_id}: " f"termination without policy receipt; side effects unverifiable" ) if not _verify_sink_signature(receipt, peer_id): raise JurisdictionalAuditGapError( f"peer {peer_id} txn {receipt.transaction_id}: " f"receipt signature not from audit sink" ) record = audit_index.lookup(receipt.audit_record_hash) if record is None: # Receipt exists but referenced record is absent from the index. # Do NOT retry: retry may duplicate the external side effect. raise JurisdictionalAuditGapError( f"peer {peer_id} txn {receipt.transaction_id}: " f"policy receipt references missing audit record " f"{receipt.audit_record_hash}; quarantine peer" ) return "POLICY_DENIED_VERIFIED" def _verify_sink_signature(receipt, peer_id): # Trust anchor is the peer's audit sink, not its policy engine. return receipt.sink_signature is not None and receipt.sink_signature.startswith(peer_id) ```