# Where must an instance halt when capability negotiation and policy enforcement disagree across federated agent boundaries? **Date of Record:** 2026 November 28 **Scope:** Applies to cross-organizational agent federation where an initiating agent (A) negotiates capabilities with a remote agent (B) over a signed protocol (e.g., A2A/MCP-style manifest exchange) and a policy decision point (PDP) on B's side enforces a policy that is narrower than the negotiated capability set. Does not apply to intra-org agent handoffs sharing a single trust domain or to capability negotiation that occurs *after* policy evaluation by construction. ## Core Distinction The failure is not "B lacks a capability A wanted." It is the **split-brain between the capability manifest B advertised and the policy envelope B's PDP will actually enforce at execution time**. Capability negotiation produces a *contract* (signed manifest: "B supports `write_ledger`, scope `ledger:append`, rate ≤ 5/s"). Policy enforcement produces a *decision* per call (PDP: "this caller's warrant is valid but `ledger:append` is denied because the org's data-classification rule blocks cross-tenant writes after 18:00 UTC"). These two subsystems are owned by different teams, updated on different cadences, and evaluated at different times. The invariant that must hold is: > For every negotiated capability `c` in the accepted manifest, the PDP MUST return `allow` for `c` under the *same warrant and context* that the manifest was negotiated under, or the negotiated contract MUST be invalidated and the session torn down before any `c`-typed call is dispatched. When that invariant is violated, the federation enters a state where A believes it holds a valid warrant for `c`, B's front door (manifest check) admits the call, and B's back door (PDP) rejects it — *after* A has already committed side effects locally based on the assumption that `c` would succeed. ## What Was Observed A federated session between Org-A's planner agent and Org-B's ledger agent. Negotiation succeeded: B advertised `ledger:append` with `max_rate=5/s`, `idempotent=true`, TTL 3600s. A's planner, on receiving the manifest, pre-allocated a batch of 40 append operations and began dispatching them at 4/s, treating `idempotent=true` as license to retry on ambiguity. At t+412s, Org-B rotated its PDP policy bundle (a routine data-classification update, unrelated to this session). The new bundle added a rule: cross-tenant `ledger:append` requires an `x-tenant-attestation` claim in the warrant. A's warrant — minted at negotiation time against the *old* policy — did not carry that claim. The manifest did not change. The front-door capability check still passed (the capability still exists, the warrant signature is still valid, the rate is still within bounds). The PDP began returning `deny: missing_claim` on every append. The critical, non-obvious part: A's retry logic read `deny: missing_claim` as a *transient* authorization error (a category it had been taught to retry, because some PDPs return `deny` during token-cache misses) and retried the full batch. Because `idempotent=true` was in the manifest, B's ledger deduplicated the retries — but only for the 17 appends that had landed before the rotation. The other 23 were rejected *before* the idempotency layer, so they never entered the dedup table. A's local state recorded all 40 as "dispatched, retrying"; B's ledger held 17. On session resume 40 minutes later, A reconciled against its own optimistic log and re-dispatched the 23 — which this time passed the PDP (A had, in the interim, been issued a refreshed warrant by an out-of-band process) — producing 23 *duplicate* appends because the dedup window (TTL 3600s from *first* attempt) had not yet covered the retry gap and the retry carried a new idempotency key derived from a new attempt counter. Net: 40 logical appends became 63 physical rows. The manifest was never wrong. The PDP was never wrong. The warrant was never forged. The failure lived entirely in the **temporal skew between manifest validity and policy validity**, amplified by a retry policy that conflated "capability-denied" with "transiently-denied." ## Condition of Validity The split-brain is *bounded* (does not occur) only when at least one of the following holds: 1. **Co-signed validity windows.** The accepted manifest carries a `policy_epoch` and a `policy_valid_until` that the PDP is contractually required to honor — i.e., B guarantees the PDP will not apply rules outside the epoch named in the manifest for the manifest's TTL. This requires the PDP to be *versioned and pinned* per session, not globally rotated. 2. **Deny-is-terminal classification.** The protocol's error taxonomy distinguishes `capability_withdrawn` (terminal, invalidate session) from `transient_auth` (retryable) from `policy_denied` (terminal for *this warrant*, requires re-negotiation, never silently retried). Without this trichotomy, retry logic cannot be correct. 3. **Idempotency key stability across retries.** The idempotency key is derived from the *logical operation identity* (a UUID minted at planning time), not from attempt counters, so that a retry after a policy-induced gap still hits the same dedup row — *provided* the dedup row survives the gap, which requires the dedup TTL to exceed the maximum policy-rotation-induced retry gap. The failure above required *all three* to be absent simultaneously. Remove any one and the duplicate-write cascade collapses. ## Decision Boundary The exact point where an instance must halt rather than retry: - **Halt and invalidate the session** when the PDP returns a terminal policy denial for a capability that is still present in the accepted manifest *and* the denial reason references a claim/rule not in the negotiated contract. This is the signature of manifest/policy divergence. Do not retry. Do not re-dispatch. Emit a `CapabilityPolicyDivergence` event carrying `(manifest_id, policy_epoch_at_negotiation, denial_reason)` and block all further `c`-typed calls until re-negotiation completes. - **Retry** only when the denial is explicitly tagged `transient` by the PDP *and* the idempotency key is operation-stable *and* the dedup TTL covers the retry window. If any of those three is unverifiable, treat as terminal. - **Never** reconcile a local optimistic log against a remote ledger by re-dispatching "missing" operations unless the operation's idempotency key is provably the same as the original attempt. Re-dispatch with a fresh key is a new logical write, not a retry. The boundary is sharp: the presence of a *valid manifest* for a capability is **not** evidence that the PDP will allow it. Manifest validity and policy validity are independent predicates, and the session is only sound while their conjunction holds under a shared epoch. ## Operational Effect Downstream of the halt-and-invalidate rule, three concrete changes: 1. **Negotiation must pin the policy epoch.** The accepted manifest is augmented with the PDP's epoch hash; the PDP is queried at negotiation time for its current epoch and the manifest is signed over both. Any PDP rotation that changes the epoch for a pinned session forces a re-negotiation handshake before the next call — surfaced to A as `session_renegotiate_required`, not as a per-call deny. 2. **Error taxonomy becomes load-bearing.** The retry classifier is rewritten so that `policy_denied: ` is terminal unless the reason matches a whitelisted transient set. Unknown reasons default to terminal. This is the opposite of the usual "unknown → retry" default, and it is correct here because the cost of a duplicate write exceeds the cost of a stalled session. 3. **Reconciliation is key-stable.** The planner mints one idempotency key per logical operation at planning time and reuses it across every attempt, including attempts after a policy gap. The remote dedup TTL is negotiated to be ≥ the maximum expected policy-rotation window (here, bumped to 4h), and the reconciliation pass refuses to re-dispatch any operation whose key is not in the original plan. The residual risk — a policy rotation that changes the epoch *and* the dedup table is cleared *and* the retry gap exceeds the negotiated TTL — is closed only by the halt rule: after a divergence event, A does not retry at all until a human or an automated re-negotiation confirms the new epoch and re-mints the warrant with the required claims. ```python from dataclasses import dataclass from enum import Enum class DenialClass(Enum): TRANSIENT = "transient" POLICY_TERMINAL = "policy_terminal" CAPABILITY_WITHDRAWN = "capability_withdrawn" @dataclass(frozen=True) class NegotiatedContract: manifest_id: str policy_epoch: str # epoch pinned at negotiation time capabilities: frozenset dedup_ttl_seconds: int @dataclass(frozen=True) class PdpDecision: allowed: bool denial_class: DenialClass | None reason: str policy_epoch: str # epoch the PDP evaluated under class CapabilityPolicyDivergence(RuntimeError): """Raised when a live PDP decision contradicts the accepted manifest under the same warrant/context, or when the PDP epoch has drifted from the epoch pinned at negotiation.""" TRANSIENT_REASONS = frozenset({"token_cache_miss", "rate_limit_backoff"}) def classify_and_gate( contract: NegotiatedContract, decision: PdpDecision, capability: str, idempotency_key_is_operation_stable: bool, retry_gap_seconds: int, ) -> DenialClass: if decision.allowed: return DenialClass.TRANSIENT # caller proceeds; no denial # 1. Epoch drift is a hard divergence regardless of denial class. if decision.policy_epoch != contract.policy_epoch: raise CapabilityPolicyDivergence( f"PDP epoch {decision.policy_epoch!r} != negotiated epoch " f"{contract.policy_epoch!r} for manifest {contract.manifest_id!r}; " f"session must be invalidated and re-negotiated before further " f"{capability!r} calls." ) # 2. Capability still advertised but policy denies it -> divergence. if capability in contract.capabilities and decision.denial_class is DenialClass.POLICY_TERMINAL: raise CapabilityPolicyDivergence( f"capability {capability!r} present in accepted manifest " f"{contract.manifest_id!r} but PDP denied under pinned epoch " f"{contract.policy_epoch!r}: {decision.reason!r}. " f"Do not retry; invalidate session." ) # 3. Retry is only sound under all three guards. if decision.denial_class is DenialClass.TRANSIENT: if decision.reason not in TRANSIENT_REASONS: raise CapabilityPolicyDivergence( f"unknown transient reason {decision.reason!r}; defaulting to " f"terminal to avoid duplicate side effects." ) if not idempotency_key_is_operation_stable: raise CapabilityPolicyDivergence( f"retry blocked: idempotency key not operation-stable for " f"{capability!r}; re-dispatch would mint a new logical write." ) if retry_gap_seconds > contract.dedup_ttl_seconds: raise CapabilityPolicyDivergence( f"retry blocked: gap {retry_gap_seconds}s exceeds negotiated " f"dedup TTL {contract.dedup_ttl_seconds}s; dedup row may be evicted." ) return DenialClass.TRANSIENT return decision.denial_class ```