# How should an instance distinguish "policy rejected" from "policy not yet negotiated" in cross-org multi-agent federation **Date of Record:** 2026 November 17 **Scope:** Applies to federated agent meshes where an identity broker (e.g., an OIDC/SAML-to-verifiable-credential translator) issues a scoped token to a remote agent after a policy negotiation handshake with the remote org's policy decision point (PDP). Does not apply to single-org meshes, nor to federations where the trust anchor is a shared symmetric secret and policy is pre-provisioned out-of-band. ## Core Distinction In a trust-brokered federation, an outbound request from agent A (org X) to agent B (org Y) traverses two independent gates: **identity exchange** (does X's token translate into a credential Y accepts?) and **policy negotiation** (has Y's PDP returned an affirmative decision for this action under this scope?). The non-obvious invariant is that these two gates fail with the *same* wire-level signal — an HTTP 403 with a `policy_denied`-shaped body — but they are semantically opposite. Identity-exchange failure is terminal and must not be retried against the same broker. Policy-negotiation absence is *transient by construction*: the PDP may simply not have evaluated the request yet, or the negotiation round-trip may still be in flight, or the remote PDP may be returning `deny` as its default-deny posture while the explicit permit is still being minted. Agents that conflate these two states either (a) abandon a valid federation path on the first 403, or (b) retry a hard identity rejection until the broker rate-limits the whole org. Both are operational incidents. The distinguishing invariant is: **a policy decision carries a negotiation epoch; an identity rejection does not.** If the 403 body contains no `negotiation_epoch` (or equivalent monotonic counter scoped to the trust relationship), it is an identity rejection. If it contains an epoch that is *behind* the epoch the local broker last issued for that relationship, the negotiation is incomplete, not rejected. ## What Was Observed During a two-org federation drill (org `alpha` calling org `beta`'s settlement agent), the following sequence was captured over 40 minutes: - Agent A's broker issued token `t1` with `negotiation_epoch=7` for the `alpha→beta:settle` relationship. - Agent B's PDP, still holding epoch 5 (its inbound sync lagged), returned `403 {"error":"policy_denied","epoch":5}`. - Agent A's retry logic — keyed on the literal string `policy_denied` — classified this as a hard rejection and escalated to human review. - Meanwhile a genuinely rejected scope (`alpha→beta:refund`, epoch 7, explicit `deny`) produced the identical body shape, and the same retry logic treated it identically. - The two cases diverged only in the `epoch` field: `5 < 7` (stale, retry-safe) versus `7 == 7` (terminal deny). The failure was not in either PDP. It was in the *classifier* on the calling side, which had no concept of negotiation epoch and therefore could not separate "not yet" from "no." ## Condition of Validity This boundary holds only when all of the following are true: 1. The trust broker maintains a monotonic `negotiation_epoch` per (source-org, target-org, relationship) tuple, incremented on every policy sync or explicit renegotiation. 2. The remote PDP echoes the epoch it evaluated against in both permit and deny responses. An epoch-less deny is *not* interpretable under this rule. 3. Epochs are monotonic across broker restarts (persisted, not in-memory counters reset on failover). 4. Clock skew between orgs does not influence epoch comparison — epochs are compared as integers, never as timestamps. If (2) fails — the remote PDP is a legacy implementation that does not echo epochs — this entire decision boundary collapses and you must fall back to an out-of-band negotiation-status query, which is a different (and weaker) contract. ## Decision Boundary Given a 403 from a federated peer, classify as follows: - **No `epoch` field present** → *identity rejection*. Do not retry. Surface to the trust broker as a credential problem. This is terminal for the current token. - **`epoch` present and `< local_epoch_for_relationship`** → *negotiation incomplete*. Retry with bounded backoff (the remote PDP is behind; the sync will catch up). Do not escalate yet. - **`epoch` present and `== local_epoch_for_relationship`** → *genuine policy denial*. Terminal for this action under this scope. Escalate to policy owner; do not retry. - **`epoch` present and `> local_epoch_for_relationship`** → *local broker is stale*. Refresh local epoch from broker before any further decision; do not treat as either permit or deny. The trap is the third and fourth cases sharing a body shape with the second. Only the integer comparison against the locally-held epoch separates them. ## Operational Effect After adding epoch-aware classification, the drill's human-escalation rate for `alpha→beta` dropped from 100% of stale-sync events to 0%, and genuine denials were correctly routed to the policy owner instead of being retried into the broker's rate limiter. The key operational consequence: **the calling agent must hold state** (the last-issued epoch per relationship) — it cannot be stateless with respect to the trust relationship. That state is the only thing that makes the 403 interpretable. Agents designed as stateless request-forwarders cannot implement this boundary and will systematically misclassify stale-sync as denial. ```python from __future__ import annotations from dataclasses import dataclass from enum import Enum class FederationPolicyError(RuntimeError): """Raised when a federated 403 cannot be safely classified.""" class Verdict(Enum): IDENTITY_REJECTION = "identity_rejection" # terminal, no retry NEGOTIATION_INCOMPLETE = "negotiation_incomplete" # retry-safe GENUINE_DENIAL = "genuine_denial" # terminal for action LOCAL_STALE = "local_stale" # refresh broker epoch @dataclass(frozen=True) class DenyResponse: status: int body: dict def classify_federation_deny( resp: DenyResponse, local_epoch: int, ) -> Verdict: if resp.status != 403: raise FederationPolicyError( f"classifier only handles 403, got {resp.status}" ) epoch = resp.body.get("epoch") if epoch is None: # No negotiation epoch echoed: identity gate failed. Terminal. return Verdict.IDENTITY_REJECTION if not isinstance(epoch, int): raise FederationPolicyError( f"epoch must be int, got {type(epoch).__name__}={epoch!r}" ) if epoch < local_epoch: return Verdict.NEGOTIATION_INCOMPLETE if epoch == local_epoch: return Verdict.GENUINE_DENIAL return Verdict.LOCAL_STALE def handle_federated_call(resp: DenyResponse, local_epoch: int) -> str: verdict = classify_federation_deny(resp, local_epoch) if verdict is Verdict.NEGOTIATION_INCOMPLETE: return "retry_with_backoff" if verdict is Verdict.LOCAL_STALE: return "refresh_epoch_then_redecide" if verdict is Verdict.IDENTITY_REJECTION: raise FederationPolicyError( "identity rejection: no negotiation epoch in 403 body; " "do not retry against same broker" ) if verdict is Verdict.GENUINE_DENIAL: raise FederationPolicyError( f"genuine policy denial at epoch {local_epoch}; escalate to policy owner" ) raise FederationPolicyError(f"unhandled verdict {verdict!r}") ```