# Which invariants prevent cross-org capability attestation from silently downgrading during federated handoff **Date of Record:** 2026 November 28 **Scope:** Applies to federated agent-to-agent handoffs where the receiving agent executes under a *different* trust domain (org, tenant, or policy authority) than the originating agent, and where the receiving side must re-attest the originating agent's claimed capabilities against its own policy before execution. Does not apply to intra-org handoffs sharing a single policy authority or to stateless request/response tool calls with no delegated execution. ## Core Distinction The failure mode here is not a *rejected* attestation. Rejection is loud, cheap, and observable. The dangerous case is a **silent capability downgrade**: the origin agent attests a capability set `C_origin` (e.g., `{read:customer_pii, write:ticket, invoke:refund_api}`), the receiver's policy engine evaluates it, and — because one capability in the set is unrecognized, ambiguous, or maps to a weaker local scope — the receiver admits the handoff with a *narrower* effective capability set `C_eff ⊂ C_origin` **without informing the origin agent that the handoff is now partial**. The origin agent's reasoning trace was planned against `C_origin`. It continues executing as though the delegated sub-task will complete. The sub-task instead completes *partially* — the refund fires but the PII read returns an empty/denied result that the sub-agent treats as "no data" rather than "not authorized." The origin agent then reasons over absence-of-data as a factual finding. The downstream decision is wrong, and no error was ever raised on any channel. The distinction that matters: **attestation negotiation is a set-equality problem, not a set-membership problem.** Most federation implementations check "does the receiver's policy *permit* each claimed capability?" (membership) and drop the ones it can't map (silent subtraction). The invariant that prevents the failure is that the *effective* capability set returned by the receiver must be compared against the *claimed* set, and any asymmetry must be surfaced as a first-class negotiation outcome — not swallowed. ## What Was Observed A three-hop federated refund flow across two orgs. Origin agent `A` (Org-1, policy authority `P1`) plans a task requiring `{read:order, read:customer_pii, invoke:refund_api}`. It constructs a capability attestation and hands off to `B` (Org-2, authority `P2`) via an A2A-style state transfer. `P2`'s policy engine recognizes `read:order` and `invoke:refund_api` (mapped to its local scopes `orders.read` and `payments.refund`). It does **not** have a mapping for `read:customer_pii` — Org-2 stores PII under a different taxonomy (`identity.pii.read`, gated behind a separate consent check that the attestation did not carry a warrant for). The negotiation layer, implemented as a filter: ``` C_eff = { c in C_origin : P2.permits(c) } ``` silently produced `C_eff = {read:order, invoke:refund_api}`. The handoff proceeded. `B` executed the refund correctly. For the PII read, `B`'s sub-agent called the identity service, which returned `403 → empty result` because no consent warrant was present. `B`'s tool wrapper normalized the 403 into an empty list (a common and locally-reasonable "treat denied as no-data" convention). `B` reported back: `{refund: ok, pii: []}`. `A` reasoned: "customer has no PII on file → proceed with default communication." This was a policy violation under `P1`, which required consent-gated contact. The failure was only caught by an out-of-band audit three days later. Key observations from the trace: - No error was raised at the negotiation boundary. The attestation was "successful" in the sense that the handoff completed. - `B` never signaled that `C_eff ≠ C_origin`. The asymmetry was computed and discarded. - `B`'s 403→empty normalization was locally correct (its own agents are told "denied reads return empty") but globally catastrophic when the denial originated from a *capability gap* rather than a *data-absence*. - `A` had no way to distinguish "PII absent" from "PII unreadable" because the response schema for `pii` was `list[PII]` with no authorization-status field. ## Condition of Validity The silent-downgrade failure requires all of the following to co-occur; remove any one and the failure does not manifest: 1. **Partial capability overlap.** `C_origin ∩ P2.permits ≠ ∅` and `C_origin \ P2.permits ≠ ∅`. If the sets are disjoint, negotiation fails loudly (nothing to hand off). If `C_origin ⊆ P2.permits`, no downgrade occurs. 2. **Filter-style negotiation.** The receiver computes `C_eff` by subtraction without emitting a structured diff. This is the architectural root cause. 3. **Normalization of authorization denial into domain-level absence.** The receiver's tool layer maps `403/denied` to a value (`[]`, `null`, `not_found`) that is indistinguishable from a genuine empty result. This is what converts a *capability gap* into a *false factual premise* in the origin agent's reasoning. 4. **Origin agent continues on partial results.** The origin's plan does not branch on "sub-task capability was reduced." It treats the handoff as atomic. The invariant to hold: **for every federated handoff, `C_eff` must be returned to the origin as an explicit, signed field, and the origin must abort-or-branch if `C_eff ≠ C_claimed`.** Equality — not subset — is the contract. A receiver that cannot honor the full claimed set must return a `PARTIAL` negotiation verdict, not a `GRANTED` with a quietly smaller set. ## Decision Boundary The boundary is where a system designer chooses between two negotiation semantics: - **Subset-admission** (the failing default): "Grant whatever subset of claimed capabilities we can map; proceed." Cheap, interoperable, and wrong whenever the origin's plan assumed the full set. - **Equality-or-escalate**: "If `C_eff ≠ C_claimed`, return `PARTIAL` with the exact diff and require the origin to re-plan or explicitly accept the reduced set." The decision rule for implementers: - If the origin agent's plan is **capability-agnostic** (it will succeed or fail identically under any subset — e.g., a best-effort enrichment step), subset-admission is acceptable *provided* the response schema distinguishes `denied` from `absent`. - If the origin agent's plan **branches on the completeness of the sub-result** (any step whose correctness depends on all claimed capabilities having executed), equality-or-escalate is mandatory. Refund/consent flows, multi-step verification, and any flow where "absence of data" changes a decision fall here. The non-obvious corollary: the boundary is determined by the *origin's plan shape*, not the receiver's policy richness. A receiver cannot know whether its silent subtraction is safe; only the origin can. Therefore the diff must always be propagated, and the *origin* decides whether to tolerate it. Any architecture that lets the receiver decide to swallow the diff has moved the decision to the party with the least information about its consequences. ## Operational Effect Enforcing the equality invariant changes the failure from silent-wrong to loud-and-recoverable: - The negotiation response carries `{verdict: PARTIAL, granted: [...], denied: [{cap, reason: "no_policy_mapping"}]}`. - The origin's handoff wrapper raises on `PARTIAL` unless the plan explicitly declared that capability as optional. - The 403→empty normalization is replaced by a typed result: `Denied(capability)` is a distinct variant from `Empty()`. The origin's reasoning layer is forbidden from treating `Denied` as data-absence; it must surface it. - Cost: more handoffs fail or re-plan. In the observed system, roughly 8% of cross-org handoffs became `PARTIAL` once the diff was propagated — these were previously all silent-downgrades. The re-plan path is more expensive per handoff but eliminates the class of "reasoned over a false absence" errors that the audit caught. The invariant does not prevent capability *mismatch* — that is inherent to cross-org federation with heterogeneous taxonomies. It prevents the mismatch from becoming an *invisible* premise in the origin agent's reasoning, which is the only part that is catastrophic rather than merely inconvenient. ```python from dataclasses import dataclass, field from enum import Enum from typing import FrozenSet class CapabilityDowngradeError(RuntimeError): """Raised when a federated handoff returns an effective capability set that is not equal to the claimed set, and the origin plan did not declare the missing capabilities as optional.""" pass class Verdict(Enum): GRANTED = "granted" PARTIAL = "partial" DENIED = "denied" @dataclass(frozen=True) class Attestation: claimed: FrozenSet[str] optional: FrozenSet[str] = frozenset() @dataclass(frozen=True) class NegotiationResult: verdict: Verdict granted: FrozenSet[str] denied: FrozenSet[str] def negotiate(att: Attestation, receiver_permits: FrozenSet[str]) -> NegotiationResult: """Filter-style negotiation, but emits the diff instead of swallowing it.""" granted = att.claimed & receiver_permits denied = att.claimed - receiver_permits if not denied: return NegotiationResult(Verdict.GRANTED, granted, frozenset()) if not granted: return NegotiationResult(Verdict.DENIED, frozenset(), denied) return NegotiationResult(Verdict.PARTIAL, granted, denied) def admit_handoff(att: Attestation, result: NegotiationResult) -> None: """Enforce equality-or-escalate. The origin — not the receiver — decides whether a partial grant is tolerable, based on its own plan shape.""" if result.verdict is Verdict.GRANTED: return if result.verdict is Verdict.DENIED: raise CapabilityDowngradeError( f"handoff denied entirely; missing={sorted(result.denied)}" ) # PARTIAL: only acceptable if every missing capability was declared optional unhandled = result.denied - att.optional if unhandled: raise CapabilityDowngradeError( "silent capability downgrade blocked: receiver granted " f"{sorted(result.granted)} but origin plan required " f"{sorted(unhandled)} which receiver could not attest. " "Origin must re-plan or explicitly mark these optional." ) # --- trace of the observed failure --- att = Attestation( claimed=frozenset({"read:order", "read:customer_pii", "invoke:refund_api"}), optional=frozenset(), # origin plan treated PII as required ) p2_permits = frozenset({"read:order", "invoke:refund_api"}) # no PII mapping result = negotiate(att, p2_permits) assert result.verdict is Verdict.PARTIAL assert result.denied == frozenset({"read:customer_pii"}) admit_handoff(att, result) # raises CapabilityDowngradeError — the fix ```