# When must an instance reject a DID-resolved manifest it cannot bind to the current transport session **Date of Record:** 2026 November 26 **Scope:** Applies to any agent-to-agent handshake that resolves a peer's decentralized identifier (DID) to a signed manifest and then admits that peer into a session-scoped trust context. Does not cover intra-org service mesh auth, nor DID methods whose resolution is itself authenticated to the caller out-of-band. ## Core Distinction The failure is not "bad signature." It is **binding failure**: the manifest verifies cryptographically but the *identity it asserts* is not the identity that *originated this session*. In cross-org bootstrapping, the DID document is resolved over a channel the relying party does not control (a resolver, a cache, a relay), and the manifest is a detached signed artifact. Both can be individually valid while the pair (resolved DID, presented manifest, live transport peer) is not a consistent triple. The subtle boundary is that signature verification proves *who signed a document*, not *who is talking to you right now*. An agent that conflates these admits a valid-but-mismatched principal — a confused deputy at the org boundary. The non-obvious part: the correct response is **rejection even when every individual check passes**. A manifest whose `controller` field resolves to a DID the peer presented, whose signature verifies against the verification method in that DID document, and whose `capabilities` grant exactly what the peer is asking for — can still be a manifest for a *different instance* of the same org, a rotated key not yet propagated, or a replay of a prior session's manifest. Admitting it silently widens trust to an instance the peer did not prove control of in *this* session. ## What Was Observed Two orgs, `alpha` and `beta`, bootstrap a task handoff. `beta`'s agent presents: 1. A DID string `did:web:beta.example:agents:worker-07`. 2. A manifest JWT signed by the verification method listed in the resolved DID document. 3. A transport session (mTLS or signed nonce) whose key is *not* the manifest signing key. The manifest verifies. The DID document resolves. The peer's transport key is a *delegation* key, not the controller key — normal and intended. The relying party (`alpha`) then checks `manifest.controller == presented_did`, finds equality, and admits. The observed failure trace: - `beta` rotated `worker-07`'s signing key at T0. The resolver cache at `alpha` still serves the T0−Δ document listing the *old* verification method. - The peer presents a manifest signed with the *new* key. The cached document's verification method does not match — but the manifest also carries a `key_assertion` pointing at a *second* DID `did:web:beta.example:agents:worker-07-rotating`, which the peer did present and which resolves cleanly. - The relying party, seeing the primary DID fail verification, falls back to the secondary DID, verifies there, and admits. The secondary DID's document lists a `controller` of `worker-07` — but `alpha` never checks that the *controller relationship* is signed by the *controller's current* key, only that the field exists. Result: `alpha` admitted a peer under a DID whose controller chain was asserted by the *rotating* key, which is exactly the key an attacker who compromised the rotating key would control. The cryptographic checks all passed; the trust graph was inverted. ## Condition of Validity The guardrail is a **binding invariant** that must hold before any manifest is admitted: > For a session S with transport-attested peer key K_t, a manifest M signed by verification method V is admissible iff there exists a signed chain from K_t to V, anchored at a controller DID C, where every link in the chain is signed by the *current* (non-rotated, non-revoked) key of the preceding link, and C is the DID the peer presented *in S*. Three conditions must hold simultaneously: 1. **Anchor equality** — the DID presented in S equals the controller DID in the chain's root, not merely a DID that resolves to a document with a matching field. 2. **Chain currency** — every signing key in the chain is checked against the DID document's *current* state at resolution time, with an explicit `updated` timestamp comparison against the manifest's `iat`. A manifest older than the latest key rotation for its controller is stale and must not anchor trust. 3. **Transport binding** — K_t must appear as a delegated key in the chain, or the chain must terminate in a proof-of-possession over S (a session nonce signed by V). A manifest that does not bind to the live transport is a *document*, not a *peer*. The invariant fails open the moment any of these is relaxed to "field equality" rather than "signed chain to the anchored DID." ## Decision Boundary The boundary is **rotation vs. replay**, and it is decidable only with timestamps: - If `M.iat < did_document.updated` for the controller, the manifest predates a key change. **Reject**, do not fall back to a secondary DID. The peer must re-present a manifest signed by the current key, or present a chain that *explicitly* delegates from the current controller key to the older signer with a `not_before` that covers `M.iat`. - If `M.iat >= did_document.updated` and the chain's root controller equals the session-presented DID, **admit** — but record the chain in the session's trust ledger so auditors can replay it. - If the peer presents a *secondary* DID to rescue a failed primary verification, **reject unconditionally**. Falling back across DIDs is the exact mechanism by which a valid signature on the wrong principal becomes an admission. A secondary DID is only admissible if it was presented *in the initial handshake* as part of the declared identity set, not introduced mid-verification. The rule an agent must internalize: **a verification failure is not a signal to try another DID; it is a signal to stop.** The temptation to "find a DID that works" is the vulnerability. ## Operational Effect Enforcing the binding invariant changes three operational behaviors: 1. **Cold-start cost rises.** Every cross-org admission now requires a fresh DID resolution with timestamp comparison, not a cached document. Caching is still allowed but must be keyed on `(did, updated)` and invalidated on any `updated` advance. Agents that cached aggressively will see admission latency increase by one resolver round-trip per new peer. 2. **Rotation becomes a coordination event.** A key rotation at `beta` is not complete until `alpha`'s resolver cache has observed the new `updated` timestamp. Manifests signed during the propagation window are *correctly* rejected; the peer must retry with the post-rotation key. This is a liveness cost paid for a safety guarantee. 3. **The trust ledger becomes load-bearing.** Because admission now depends on a signed chain with timestamps, the chain must be recorded per session so that a later audit can replay the decision. An agent that admits without recording the chain has made an unauditable trust decision and cannot prove it did not fall back across DIDs. The invariant is not free. It converts a fast, forgiving handshake into a strict one, and it will reject some legitimate peers during rotation windows. That is the correct trade: the alternative is admitting an instance whose controller chain was asserted by a key the relying party cannot bind to the live session. ```python import time from dataclasses import dataclass from typing import Optional class TrustBindingError(RuntimeError): """Raised when a DID-resolved manifest cannot be bound to the live transport session.""" pass @dataclass class DidDocument: did: str controller: str verification_methods: dict # key_id -> public_key updated: float # unix ts of last key change @dataclass class Manifest: did: str signer_key_id: str controller: str iat: float chain: list # list of (did, signer_key_id, signed_by_key_id) @dataclass class Session: presented_did: str transport_key_id: str nonce: str def admit_peer( session: Session, manifest: Manifest, resolve: callable, verify_sig: callable, verify_pop: callable, ) -> bool: # 1. Anchor equality: the manifest's controller must be the DID presented in THIS session. if manifest.controller != session.presented_did: raise TrustBindingError( f"manifest controller {manifest.controller!r} does not match " f"session-presented DID {session.presented_did!r}" ) # 2. Chain currency: every link must be signed by the current key of its predecessor, # and the manifest must not predate the controller's latest key rotation. doc = resolve(manifest.controller) if manifest.iat < doc.updated: raise TrustBindingError( f"manifest iat {manifest.iat} predates controller key rotation at {doc.updated}; " f"rejecting stale manifest (no secondary-DID fallback permitted)" ) for (did, signer_key_id, signed_by_key_id) in manifest.chain: link_doc = resolve(did) if signer_key_id not in link_doc.verification_methods: raise TrustBindingError( f"chain link {did} signer key {signer_key_id} not present in current DID document" ) if not verify_sig(did, signer_key_id, signed_by_key_id): raise TrustBindingError( f"chain link {did} signature by {signed_by_key_id} failed verification" ) # 3. Transport binding: the session key must appear as a delegated key in the chain, # or the peer must prove possession of the manifest signer over the session nonce. chain_key_ids = {k for (_, k, _) in manifest.chain} if session.transport_key_id not in chain_key_ids: if not verify_pop(manifest.signer_key_id, session.nonce): raise TrustBindingError( f"transport key {session.transport_key_id} not bound to manifest signer " f"{manifest.signer_key_id} and no proof-of-possession over session nonce" ) return True def handshake(session, manifest, resolve, verify_sig, verify_pop) -> bool: try: return admit_peer(session, manifest, resolve, verify_sig, verify_pop) except TrustBindingError: # Do NOT retry with a secondary DID. A binding failure is terminal for this session. raise ```