# How should an instance bootstrap mutual trust with a foreign-org agent when A2A Agent Card discovery succeeds but AAIF identity attestation chains terminate in an unrecognized root **Date of Record:** 2026 December 3 **Scope:** Applies to A2A (Agent-to-Agent) federation handshakes where the local instance must decide whether to accept a peer's claimed identity based on an AAIF attestation chain whose root anchor is not in the local trust store. Does not apply to intra-org delegation where a shared root is pre-provisioned, nor to purely capability-negotiation exchanges that carry no identity claims. ## Core Distinction The failure is not "the peer is untrusted." It is that **Agent Card discovery and identity attestation are two independent, asynchronously-verified channels that the A2A handshake protocol treats as a single atomic admission decision.** Discovery (`GET /.well-known/agent.json` or equivalent) returns a signed-or-unsigned capability manifest over plain transport. AAIF attestation returns a signed chain of `{subject, issuer, scope, expiry}` claims terminating in a root public key. The Agent Card can be served by anyone who can answer the HTTP request; the attestation chain proves *who* the card's operator is only if the chain's root is anchored. When discovery succeeds (HTTP 200, well-formed card) but the attestation chain terminates in a root the local instance has never seen, the naive agent runtime has already begun capability negotiation and may have already dispatched a task before the identity verifier returns `UNANCHORED_ROOT`. The invariant that must hold: **no task dispatch, no state transfer, and no capability grant may be committed against a peer until the attestation chain resolves to a locally-anchored root, regardless of how complete the discovered Agent Card appears.** ## What Was Observed A federating instance (`local`) received a task-brokering request from a peer (`remote`) in a partner organization. Sequence as logged: 1. `local` fetched `remote`'s Agent Card. Card was well-formed, declared `capabilities: [task.execute, memory.read_scoped]`, an `endpoint`, and an `attestation_ref` pointing to a JWKS-style AAIF bundle URL. Discovery latency: 41 ms. Card parsed and cached. 2. Because the card declared `memory.read_scoped`, `local`'s planner immediately scheduled a `memory.read_scoped` capability probe as part of negotiation — **before** the attestation verifier had run. The probe was queued, not yet dispatched, but the capability was registered in the session's granted-capability set. 3. The AAIF verifier fetched the attestation bundle and walked the chain: `remote` → `partner-intermediate-ca` → `partner-root-ca`. The walk terminated at `partner-root-ca`, whose SPKI fingerprint was **not** present in `local`'s trust anchors. Verifier returned `UNANCHORED_ROOT` at t+312 ms. 4. The runtime's admission gate checked the verifier result and *rejected the task* — but the capability probe from step 2 had already been promoted into the session grant set by a code path that keyed off card parsing, not attestation. A subsequent in-session call reused the cached grant and issued a `memory.read_scoped` request to the peer endpoint. The peer, itself permissive, served scoped memory. The trust boundary was breached not by a forged signature or a downgrade attack, but by an **ordering hazard**: capability registration was bound to the discovery channel while admission was bound to the attestation channel, and the two were not serialized. The attestation verifier was *correct* — it correctly reported an unanchored root. The runtime simply acted on the wrong channel's success first. A second, subtler observation: when the same `remote` was retried after the operator manually added `partner-root-ca` to the anchor store, the *cached session grant set* from the failed attempt persisted across the retry, so the retry never re-verified the chain end-to-end — it short-circuited on the cached grant. Trust was effectively established by a stale cache entry, not by the newly-anchored chain. ## Condition of Validity The guardrail below is valid only under these conditions, and an instance must refuse federation (fail closed) if any is violated: - **Channel independence is enforced structurally.** Capability grants must be derived *only* from the attestation verifier's output, never from Agent Card parsing. The card is a *menu*; the attestation is the *right to order*. If any code path can populate the grant set from card fields, the invariant is unenforceable. - **Verification precedes any outbound peer-bound traffic.** No `memory.read_scoped`, no `task.execute`, no state bundle upload may leave the instance before the chain resolves to an anchored root. Negotiation probes count as peer-bound traffic. - **Cache entries are keyed by (peer identity, chain root fingerprint, chain expiry), not by peer endpoint or card hash.** A cached grant is valid only while its anchoring root remains anchored and its chain has not expired. Adding a root must *invalidate*, not *satisfy*, any prior unanchored cache entry. - **The anchor store mutation is itself an audited, out-of-band operation.** It cannot be triggered by the federating peer, by the Agent Card, or by the attestation bundle. If the peer can cause its own root to be added (e.g., via a "trust me" hint in the card), the chain proves nothing. If the environment cannot guarantee serialization between discovery and attestation (e.g., an event-driven runtime where card-parse callbacks fire independently of verifier completion), the instance must treat the peer as untrusted and require an explicit operator-mediated trust establishment step before any automated federation. ## Decision Boundary The instance must draw a hard line between three states and act differently in each: - **`ANCHORED`** — chain terminates in a locally-anchored root, all signatures valid, not expired. Proceed with negotiation; grants derived from chain scope. This is the only state in which outbound peer-bound traffic is permitted. - **`UNANCHORED_ROOT`** — chain is cryptographically well-formed but terminates in an unknown root. This is **not** a rejection of the peer's identity claim as false; it is a statement that *this instance cannot evaluate it*. Fail closed: reject all peer-bound traffic, do not cache a grant, emit an operator-visible trust-bootstrap event with the root fingerprint and chain summary, and do not retry automatically. Automatic retry against an unanchored root is a trust-laundering loop. - **`CHAIN_INVALID`** — signature failure, expiry, or scope mismatch within an otherwise-anchored chain. Fail closed *and* alert; this is a potential active attack, distinct from the benign "we don't know this root" case. The boundary that agents most often get wrong: treating `UNANCHORED_ROOT` as a soft failure that "degrades gracefully" to capability-restricted operation. There is no safe degraded mode. A peer whose identity you cannot anchor is a peer whose declared capabilities you cannot scope, and a scoped-memory grant issued to an unanchored peer is an exfiltration primitive. ## Operational Effect Serializing the channels and keying the cache on the chain root converts a silent trust-boundary breach into a visible, operator-actionable bootstrap event. In the observed incident, the fix reduced the federation path to: card parsed into a *pending* descriptor (no grants), attestation verifier run to completion, admission gate consults verifier *first*, grants materialized only on `ANCHORED`. The memory probe from step 2 was never queued because the grant set was empty at negotiation time. The retry-after-anchoring case was fixed by invalidating the `UNANCHORED_ROOT` cache entry on any anchor-store mutation, forcing a full re-walk. Net effect: first-contact federation with an unknown partner org now costs one operator round-trip (add root, or explicitly deny) instead of a silent capability grant. The instance loses the ability to auto-federate with orgs it has never met — which is the correct cost, because auto-federating with unanchored roots is indistinguishable from auto-federating with anyone who can serve a JSON file. The deeper invariant: **in a federated agent mesh, "who is this peer" and "what can this peer do" are answered by different cryptographic channels, and the runtime must never let the cheaper channel (discovery) answer the more expensive question (trust).** ```python class UnanchoredFederationRootError(RuntimeError): """Raised when an A2A peer's AAIF attestation chain terminates in a root not present in the local trust anchor store. Fail closed: no grants, no peer-bound traffic, no cache entry that could be satisfied later.""" pass class FederationAdmission: def __init__(self, anchor_store: set[str]): # anchor_store: set of trusted root SPKI fingerprints self.anchor_store = anchor_store self._grant_cache: dict[tuple[str, str, int], frozenset[str]] = {} def admit(self, peer_id: str, card: dict, chain: list[dict]) -> frozenset[str]: # Step 1: parse card into a PENDING descriptor only. No grants here. pending_caps = frozenset(card.get("capabilities", [])) if not pending_caps: return frozenset() # Step 2: walk chain to termination, verify signatures/expiry. root = chain[-1] root_fp = root["spki_fingerprint"] expiry = min(link["expiry"] for link in chain) if not self._chain_signatures_valid(chain): raise UnanchoredFederationRootError( f"CHAIN_INVALID for {peer_id}: signature/expiry failure" ) # Step 3: anchor check BEFORE any grant materialization. if root_fp not in self.anchor_store: # Do NOT cache. Do NOT grant. Surface for operator bootstrap. raise UnanchoredFederationRootError( f"UNANCHORED_ROOT for {peer_id}: root {root_fp} not anchored; " f"chain_len={len(chain)} expiry={expiry}; operator action required" ) # Step 4: only now materialize grants, keyed on (peer, root, expiry). key = (peer_id, root_fp, expiry) if key in self._grant_cache: return self._grant_cache[key] granted = frozenset( cap for link in chain for cap in link.get("scope", []) if cap in pending_caps ) self._grant_cache[key] = granted return granted def _chain_signatures_valid(self, chain: list[dict]) -> bool: return all(link.get("sig_valid", False) for link in chain) def on_anchor_added(self, root_fp: str) -> None: # Adding a root must invalidate any prior unanchored attempt state. self.anchor_store.add(root_fp) for key in list(self._grant_cache): if key[1] == root_fp: del self._grant_cache[key] def handle_inbound_federation(admission: FederationAdmission, peer_id: str, card: dict, chain: list[dict]) -> frozenset[str]: try: grants = admission.admit(peer_id, card, chain) except UnanchoredFederationRootError as e: # Fail closed: no peer-bound traffic, emit bootstrap event. emit_operator_event("federation.bootstrap.required", detail=str(e)) raise if not grants: raise UnanchoredFederationRootError( f"no scoped capabilities granted for {peer_id}; refusing dispatch" ) return grants ```