# Under what conditions must an instance refuse to complete an A2A capability handshake with a federated peer across organizational boundaries **Date of Record:** 2026 November 17 **Scope:** Applies to Agent-to-Agent (A2A) federation handshakes where the calling agent and the callee agent are governed by different trust domains (distinct orgs, distinct signing roots, distinct policy engines). Does not apply to intra-org A2A where both agents share a control plane and a single policy authority; in that case the negotiation is a configuration lookup, not a trust decision. ## Core Distinction A capability handshake under A2A is usually modeled as a negotiation: the caller presents an `AgentCard`, the callee replies with a `Capabilities` manifest, and both sides intersect their supported skill sets, transports, and auth schemes. The intuitive failure model is *negotiation failure* — no intersection, so the call aborts cleanly. The non-obvious boundary is different: a handshake can *succeed at the protocol layer* while being *unsound at the trust layer*. The instance accepts a peer's declared capability because the wire negotiation intersected, but the peer's declaration was never bound to a verifiable identity rooted in the callee's trust domain. The distinction that matters operationally: **capability agreement is not capability authorization.** A peer can legitimately advertise a skill and legitimately negotiate its use, and the local instance still must refuse to complete the handshake if the peer's signing chain terminates at an anchor the local policy engine does not recognize — even when every field parses, every schema validates, and every transport probe returns green. ## What Was Observed In a federation between two orgs, the caller's `AgentCard` carried a `securitySchemes` block referencing an OAuth2 issuer. The callee's policy engine had a stale allowlist that still contained the issuer's *previous* JWKS endpoint. Because the JWT `kid` happened to collide with a key still cached from the old endpoint, signature verification returned valid. The handshake completed. The capability intersection was non-empty. For roughly forty minutes, the callee executed skills on behalf of a peer whose chain of trust it could no longer actually reconstruct — the verification was a cache hit, not a proof. The observable symptom was not an error. It was a *silent widening of the effective trust set*: any token signed by the stale key, from any subject, passed. The failure surfaced only when a second peer using the same issuer but a different subject was granted capabilities it had never negotiated, because the intersection was computed against the first peer's cached card. ## Condition of Validity The handshake is sound **only if** all of the following hold at the moment of completion, not at the moment of card retrieval: 1. The peer's signing chain resolves to a trust anchor present in the local policy engine's *current* anchor set, and that anchor has not been revoked since the card was fetched. 2. Every key used to verify the card is fresh — resolved from a live JWKS fetch or a cache entry whose TTL has not expired — and the `kid` maps to exactly one key in the resolved set. 3. The negotiated capability set is bound to the *specific verified subject*, not to the issuer or to the card object. Two peers sharing an issuer must not share a capability grant. 4. The card's `expiresAt` (or equivalent freshness field) is in the future, and the local clock skew against the peer's asserted time is within the policy's tolerance. If any condition is unverifiable — not false, merely unverifiable — the handshake must not complete. Absence of proof is refusal, not acceptance. ## Decision Boundary The boundary is *verifiability of identity at completion time*, not *parseability of the card* or *intersectability of capabilities*. Three cases sit on the refuse side and are routinely misclassified as success: - **Stale-key cache hit.** Signature verifies against a cached key whose source endpoint has rotated. Refuse; re-resolve. - **Issuer-scoped grant reuse.** A second subject under an already-trusted issuer presents a valid card. The issuer is trusted; the subject is not yet bound. Refuse until the subject is individually bound. - **Clock-skewed freshness.** The card is unexpired by the peer's clock but expired by the local clock beyond tolerance. Refuse; do not "round in the peer's favor." The case that sits on the accept side and is routinely misclassified as failure: a peer with a valid, freshly-resolved chain and a *narrower* capability set than requested. That is a successful negotiation with a reduced grant, not a handshake failure. Do not retry it as if it were an error; record the reduced grant. ## Operational Effect Treating this boundary correctly converts a class of silent trust-widening incidents into loud, attributable refusals. The cost is a small increase in handshake latency (live JWKS resolution on cache miss) and a small increase in false refusals during key rotation windows. The benefit is that the effective trust set is always reconstructible from current anchors — an auditor can replay any completed handshake and re-derive why it was allowed. The operational rule: **the handshake completes only when the instance can, at that instant, name the anchor, the fresh key, and the specific subject that justify the grant.** If any of the three cannot be named, the instance must refuse and emit a structured refusal record rather than degrade to a cached or issuer-scoped acceptance. ```python # a2a_federation_handshake.py # Operational guard for cross-org A2A capability handshakes. # Encodes the "verifiable-at-completion-time" invariant. from dataclasses import dataclass from typing import Optional class FederationHandshakeRefused(RuntimeError): """Raised when an A2A handshake cannot be soundly completed. Distinct from a negotiation failure (empty capability intersection). This signals that the protocol may have succeeded but the trust layer could not justify the grant at completion time. """ pass @dataclass(frozen=True) class HandshakeContext: peer_issuer: str peer_subject: str signing_anchor: Optional[str] # anchor id resolved from current set anchor_in_current_set: bool key_source: str # "live" | "cache" key_cache_ttl_expired: bool kid_unique_in_resolved_set: bool subject_bound_to_grant: bool card_expires_at: float local_now: float clock_skew_tolerance_s: float def complete_handshake(ctx: HandshakeContext) -> str: """Return a grant token only if all validity conditions hold. Any unverifiable condition is treated as refusal, not acceptance. """ if ctx.signing_anchor is None or not ctx.anchor_in_current_set: raise FederationHandshakeRefused( f"anchor unresolvable or revoked for issuer={ctx.peer_issuer}" ) # Stale-key cache hit: signature may verify but is not a proof. if ctx.key_source == "cache" and ctx.key_cache_ttl_expired: raise FederationHandshakeRefused( f"stale key cache for issuer={ctx.peer_issuer}; re-resolve JWKS" ) if not ctx.kid_unique_in_resolved_set: raise FederationHandshakeRefused( f"kid ambiguous in resolved key set for issuer={ctx.peer_issuer}" ) # Issuer-scoped grant reuse: issuer trusted, subject not individually bound. if not ctx.subject_bound_to_grant: raise FederationHandshakeRefused( f"subject={ctx.peer_subject} not bound to capability grant" ) if ctx.card_expires_at <= ctx.local_now - ctx.clock_skew_tolerance_s: raise FederationHandshakeRefused( f"card expired beyond skew for subject={ctx.peer_subject}" ) # All conditions verifiable: name anchor, key, subject. return f"grant:{ctx.peer_issuer}|{ctx.peer_subject}|{ctx.signing_anchor}" ```