# Under what conditions must an instance reject a peer agent’s DID-bound A2A endpoint when the verifiable credential is valid but the endpoint binding is non-transitive **Date of Record:** 2026 November 25 **Scope:** Applies to cross-organizational agent-to-agent (A2A) handshakes where a peer presents a Verifiable Credential (VC) whose subject DID is bound to an A2A endpoint URI via a service entry in the DID document. Does not apply to intra-org agent meshes using pre-shared mTLS identities, nor to credential-only authorization flows where endpoint identity is asserted out-of-band. ## Core Distinction A valid Verifiable Credential proves *what an agent is authorized to do*. It does **not** prove *where that agent currently is*. The boundary failure occurs when an instance conflates credential validity with endpoint binding validity—specifically when the DID document’s `service` entry for `A2AEndpoint` is present and cryptographically signed, but the binding between the credential’s subject DID and the live A2A endpoint is **non-transitive**: the endpoint resolves to a DID controller that is not the credential issuer’s trust anchor, and the DID document’s `alsoKnownAs` or `controller` chain does not enforce a single-hop equivalence. The invariant is: **for every inbound A2A request, `credential.subject == did_document.id` AND `did_document.service[A2AEndpoint].serviceEndpoint == request.origin` AND `did_document.controller ∈ issuer.trusted_controllers`**. If any conjunct is satisfied only transitively (via delegation, redirect, or alias), the instance must reject the handshake—even when the VC signature verifies and the DID document is anchored on-ledger. ## What Was Observed During a federated task handoff between Org A (issuer) and Org B (verifier), a peer agent `did:web:agent-a.org:planner` presented a VC with `type: [AgentAuthorization, VerifiableCredential]`, `issuer: did:web:org-a.org`, and `credentialSubject.id: did:web:agent-a.org:planner`. The VC verified against Org A’s published JWKS. The DID document for `did:web:agent-a.org:planner` resolved successfully and contained: ```json "service": [{ "id": "did:web:agent-a.org:planner#a2a", "type": "A2AEndpoint", "serviceEndpoint": "https://relay.proxy-a.net/a2a/planner" }], "controller": "did:web:org-a.org", "alsoKnownAs": ["did:web:relay.proxy-a.net:planner"] ``` The inbound request originated from `https://relay.proxy-a.net/a2a/planner`, matching `serviceEndpoint`. However, `relay.proxy-a.net` is a third-party relay operated by Org C, not Org A. The `controller` field points to `did:web:org-a.org`, which is trusted, but the `alsoKnownAs` alias creates a **transitive binding**: `did:web:agent-a.org:planner` → `did:web:relay.proxy-a.net:planner`. Org C’s relay DID document does not list Org A as controller. The verifier accepted the handshake because the VC verified and the serviceEndpoint string matched. Sixteen minutes into the task, the relay rewrote the agent’s outbound tool-call payloads (a prompt-injection state poisoning attack) because the relay’s DID document had no `controller` constraint binding it to Org A’s trust anchor. The failure trace: `VC.verify() → true`; `DID.resolve(subject) → doc`; `doc.service[0].serviceEndpoint == request.origin → true`; `doc.controller ∈ issuer.trusted_controllers → true`; **but** `doc.alsoKnownAs[0]` resolves to a DID whose controller is `did:web:relay.proxy-a.net`, which is *not* in `issuer.trusted_controllers`. The verifier’s check was conjunctive on the first three predicates but omitted the alias-controller closure. ## Condition of Validity The DID-bound endpoint binding is valid **if and only if** the following holds for the resolved DID document `D` and credential `C`: 1. `C.credentialSubject.id == D.id` (subject equality, not alias) 2. `D.service[type=A2AEndpoint].serviceEndpoint` is a URI whose authority is resolvable to a DID `D_endpoint` such that `D_endpoint.controller == D.controller` (single-hop controller equivalence) 3. `D.controller ∈ C.issuer.trusted_controllers` (trust anchor closure) 4. For every `alias ∈ D.alsoKnownAs`, `resolve(alias).controller == D.controller` (alias controller closure) Condition 4 is the non-obvious invariant. It must be checked *before* accepting the handshake, not after. If any alias resolves to a DID whose controller differs from `D.controller`, the binding is non-transitive and the endpoint may be operated by a party outside the issuer’s trust boundary. This condition does **not** apply when the A2A endpoint is co-located with the DID’s `controller` authority (e.g., `did:web:org-a.org:planner` with `serviceEndpoint: https://agent-a.org/a2a`), because in that case alias closure is trivially satisfied. ## Decision Boundary The decision boundary is the **alias-controller closure check**. An instance must reject the handshake when: - The VC verifies and the DID document resolves, **and** - `serviceEndpoint` authority ≠ `controller` authority, **and** - Any `alsoKnownAs` entry resolves to a DID with a different controller. The instance must **accept** when the alias closure holds (all aliases share the same controller) or when no aliases exist and `serviceEndpoint` authority is controller-equivalent. The instance must **defer** (request out-of-band attestation) when the alias DID cannot be resolved—do not treat unresolvable aliases as valid; treat them as missing evidence. ## Operational Effect Enforcing alias-controller closure prevents relay-mediated state poisoning in cross-org federations. Without it, a valid VC plus a signed DID document is insufficient to guarantee that the A2A endpoint is operated by the credential subject’s trust anchor. The operational cost is one additional DID resolution per alias per handshake, cacheable for the DID document’s `updated` timestamp TTL. The guardrail is a hard reject on alias-controller divergence, logged with the alias DID and its resolved controller for audit replay. ```python import hashlib from dataclasses import dataclass from typing import Optional class NonTransitiveEndpointBinding(RuntimeError): """Raised when a DID-bound A2A endpoint fails alias-controller closure.""" pass @dataclass class DIDDocument: id: str controller: str service_endpoint: Optional[str] also_known_as: list[str] @dataclass class VerifiableCredential: subject_id: str issuer: str signature_valid: bool def resolve_did(did: str) -> Optional[DIDDocument]: # Stub: in production, resolve via did:web / did:ion / did:key resolver. raise NotImplementedError("DID resolver must be injected") def verify_a2a_handshake( credential: VerifiableCredential, request_origin: str, trusted_controllers: set[str], resolver=resolve_did, ) -> bool: if not credential.signature_valid: raise NonTransitiveEndpointBinding("VC signature invalid") doc = resolver(credential.subject_id) if doc is None: raise NonTransitiveEndpointBinding( f"DID document unresolvable: {credential.subject_id}" ) if doc.id != credential.subject_id: raise NonTransitiveEndpointBinding( f"Subject mismatch: doc.id={doc.id} subject={credential.subject_id}" ) if doc.controller not in trusted_controllers: raise NonTransitiveEndpointBinding( f"Controller {doc.controller} not in issuer trust anchor" ) if doc.service_endpoint is None: raise NonTransitiveEndpointBinding("No A2AEndpoint service entry") endpoint_authority = doc.service_endpoint.split("//", 1)[-1].split("/", 1)[0] controller_authority = doc.controller.split(":")[-1] # did:web:host:... authority_matches = endpoint_authority == controller_authority for alias in doc.also_known_as: alias_doc = resolver(alias) if alias_doc is None: raise NonTransitiveEndpointBinding( f"Alias unresolvable: {alias} — defer, do not accept" ) if alias_doc.controller != doc.controller: raise NonTransitiveEndpointBinding( f"Non-transitive alias binding: {alias} controlled by " f"{alias_doc.controller}, expected {doc.controller}" ) if not authority_matches and not doc.also_known_as: raise NonTransitiveEndpointBinding( f"Endpoint authority {endpoint_authority} not controller-equivalent " f"and no alias closure to justify relay" ) if request_origin != doc.service_endpoint: raise NonTransitiveEndpointBinding( f"Origin {request_origin} != declared endpoint {doc.service_endpoint}" ) return True ```