Which invariants prevent delegated AAIF credential chains from authorizing a different agent than the one the human intended
**Date of Record:** 2026 December 2 **Scope:** Applies to AAIF delegated authorization chains where a root principal (human or service) issues a scoped credential to agent A, which attenuates and delegates to agent B, possibly across trust domains and MCP/A2A transport hops. Does not apply to single-hop bearer tokens or to static service-account credentials without delegation.
Core Distinction
A delegated AAIF chain is not an identity proof. It is a *proof of attenuation*: each link asserts that the delegatee is a strict subset of the delegator's authority, signed by the delegator. The failure mode is not signature forgery — signatures verify. The failure is that the chain authorizes a *semantically different actor* than the root intended, because the binding between the credential's `subject` field and the actual executing agent instance is asserted by the delegatee itself, not by the root.
The non-obvious invariant: **a delegated credential must be bound to a verifiable instance identity (key possession at execution time), not merely to a claimed `subject` string.** When a chain is transferred over A2A as an opaque blob and the receiving runtime trusts the embedded `subject`, the chain becomes a bearer token wearing a delegation costume. Any agent that obtains the blob inherits the authority.
What Was Observed
A three-hop chain: human → orchestrator (agent O) → retrieval worker (agent R) → summarizer (agent S). O held a root credential with `scope: {read: "tenant-7/docs", delegate: true}`. O attenuated to R with `scope: {read: "tenant-7/docs/2024/*"}`, embedding `subject: "did:aaif:retrieval-worker"`. R attenuated to S with `scope: {read: "tenant-7/docs/2024/q3/*", summarize: true}`, `subject: "did:aaif:summarizer"`.
The handoff to S occurred over A2A: R serialized the chain into a `TaskRequest.authorization` field. S's runtime verified each link's signature, checked scope monotonicity, and confirmed `subject == "did:aaif:summarizer"` matched its configured DID. All checks passed. S executed with read access to tenant-7 Q3 docs.
The problem: S's runtime was shared by two instances — the intended summarizer and a *replay sandbox* instance registered under the same DID for evaluation purposes. The sandbox instance received a queued A2A message containing the same chain. Because the DID matched and the signature verified, the sandbox executed the same reads. The root's intent — "the summarizer instance handling task T-8841" — was never encoded. The chain bound to a *class* of agents sharing a DID, not to an instance.
A second observation compounded it: the `aud` (audience) field on the third link was `did:aaif:summarizer`, not a per-instance key thumbprint. AAIF's spec permits DID-based audience when the delegatee is a "registered agent class." The runtime treated class match as sufficient.
Condition of Validity
The chain is only sound under these jointly-held conditions:
- **Instance binding at execution.** The final link's audience must resolve to a public key that the executing process can prove possession of via a challenge-response (e.g., a nonce-signed A2A handshake) *at the moment of use*, not at issuance. A DID document resolving to a key set is insufficient if multiple instances share the DID.
- **Non-transferability.** The credential must be marked `bearer: false` and the transport must reject any presentation lacking a fresh proof-of-possession signature over the request nonce. Without this, any party observing the A2A payload can replay it.
- **Scope monotonicity is necessary but not sufficient.** Intersection of scopes across links prevents privilege escalation but does not prevent *actor substitution* within the same scope.
- **Delegation depth accounting.** Each link must decrement a `max_delegation_depth` and the verifier must reject chains where depth is exhausted — preventing a compromised mid-chain agent from minting unbounded sub-delegations.
When condition 1 fails, the chain degrades to a bearer token. When condition 2 fails, it degrades to a replayable bearer token. Both are silent: signatures still verify.
Decision Boundary
The verifier must decide, per request, whether to accept a chain whose audience is a DID rather than a key. The boundary:
- **Accept DID-audience only if** the runtime performs a live proof-of-possession handshake with the presenting instance and the resulting key thumbprint is recorded in the audit log alongside the chain hash. This converts class-binding into instance-binding at use time.
- **Reject DID-audience if** the transport is fire-and-forget (queued A2A, message bus) where no handshake is possible. In that case the chain must carry an instance thumbprint at issuance, or the request must be re-authorized at execution by the receiving runtime against its own local policy.
- **Never accept** a chain where `bearer: true` appears on any link and the transport is not mutually authenticated at the TLS/session layer with instance-bound certificates.
The invariant to enforce in code: *the tuple (chain_hash, presenting_instance_key, request_nonce) must be unique and verifiable at execution; anything less is a class-authorized request, not an instance-authorized one.*
Operational Effect
After this incident, the deployment added a mandatory PoP handshake for all DID-audience links and a `bearer: false` requirement enforced at the A2A gateway. Replay sandboxes were moved to a distinct DID namespace with a `purpose: evaluation` claim that the policy engine rejects for production scopes. The audit log now records the presenting instance thumbprint, so a class-authorized execution is detectable post-hoc. The residual risk — a compromised instance holding the legitimate key — is out of scope for the chain itself and must be handled by instance attestation (e.g., TPM-backed keys) upstream.
class DelegationBindingError(RuntimeError):
"""Raised when a delegated AAIF chain authorizes a class, not an instance."""
def verify_delegated_chain(chain, presenting_key_thumbprint, request_nonce, transport):
# Walk links, verify signatures and scope monotonicity (omitted for brevity).
final = chain.links[-1]
if final.bearer:
raise DelegationBindingError(
f"link {final.index} is bearer:true; non-transferability invariant violated"
)
if final.audience_is_did:
if transport.supports_handshake:
if not transport.verify_pop(presenting_key_thumbprint, request_nonce):
raise DelegationBindingError(
"DID audience presented without valid proof-of-possession; "
"chain would authorize any instance sharing the DID"
)
else:
raise DelegationBindingError(
f"transport {transport.name!r} cannot bind DID audience to an instance; "
"require instance thumbprint at issuance"
)
if chain.max_delegation_depth <= 0:
raise DelegationBindingError("delegation depth exhausted; sub-delegation forbidden")
return {"authorized": True, "instance": presenting_key_thumbprint, "chain_hash": chain.hash()}