# Under what conditions must an instance treat a valid AAIF attestation credential as unusable at the moment of a delegated tool call **Date of Record:** 2026 November 23 **Scope:** Applies to autonomous agents that present short-lived verifiable credentials (VCs) issued under an Agent Identity Attestation Framework (AAIF) to downstream tool endpoints, and to orchestrators that mint delegated sub-credentials for child agents. Does not apply to long-lived service-account tokens or to credential formats without an embedded proof-of-possession binding. ## Core Distinction The distinction that matters here is between **credential validity** and **credential usability at the call boundary**. A VC can pass every cryptographic check — signature chain intact, issuer trusted, `exp` in the future, `nbf` in the past — and still be unusable for a specific tool invocation. The failure is not a forged credential and not an expired one. It is a *binding mismatch* between the credential's proof-of-possession (PoP) key, the delegated subject, and the audience/scope the tool endpoint actually enforces. The non-obvious part: agents routinely treat "signature verifies" as a green light and proceed to spend a tool call, a network round-trip, and a slice of token budget before discovering the endpoint rejects the credential on audience or scope-binding grounds. Worse, the rejection is often opaque — the tool returns a generic 401/403 — and the agent's reasoning loop interprets that as a transient error, retries with the same credential, and burns its retry budget against a credential that can never succeed for that endpoint. The invariant is: **a credential is usable for a call only if its PoP key is the key the caller actually controls *at call time*, its audience set includes the endpoint's canonical identifier, and its delegated scope is a subset of the endpoint's required scope.** Validity is necessary, never sufficient. ## What Was Observed A three-tier hierarchy: a root orchestrator instance `O` holds a long-lived AAIF identity, mints a short-lived delegated VC `C_o` for a planner agent `P` (TTL 300s, audience `["planner.internal"]`), and `P` in turn mints a sub-delegated VC `C_p` for a worker agent `W` to call an external retrieval tool `T` (audience `["retrieval.tools.example"]`, scope `["docs:read"]`). The observed failure trace: 1. `P` mints `C_p` correctly, with PoP key `k_w` (W's ephemeral key), audience `["retrieval.tools.example"]`, scope `["docs:read"]`, `exp = now + 120`. 2. `P` serializes `C_p` and hands it to `W` over the agent-to-agent transport **as a bare credential**, omitting the PoP private key `k_w` — because `P` never held it; `W` generated `k_w` locally and only published the public half during minting. This is correct PoP hygiene. 3. `W` receives `C_p`, verifies the signature chain, sees `exp` in the future, and marks the credential `VALID`. 4. `W` issues the tool call to `T`, attaching `C_p` and signing the request body with `k_w`. 5. `T` verifies the VC signature, then verifies the request-body signature against the PoP public key embedded in the VC's `cnf` claim. **These match.** `T` then checks audience: `retrieval.tools.example` ∈ `aud`. Match. `T` checks scope against the required `docs:read`. Match. `T` **accepts** the call. So where is the failure? It is in a *second* call path. `W` is also asked, mid-task, to summarize results via a second tool `S` (`summarizer.internal`). `W` reuses `C_p`. `T`'s checks passed, but `S` enforces a *stricter* audience policy: it requires the credential's `aud` to contain `summarizer.internal` specifically. `C_p`'s audience is `["retrieval.tools.example"]`. `S` rejects with 403. `W`'s reasoning loop classifies 403 as retryable, retries twice with the same `C_p`, then escalates to `P`. `P` — lacking any record of which credential was minted for which downstream audience, because it discarded that mapping after serialization — re-mints a fresh `C_p'` with the *same* audience and hands it back. `W` retries. Same 403. The task stalls until the orchestrator's token budget for the sub-task is exhausted. The credential was never invalid. It was minted for the wrong audience for the second call, and no layer in the stack retained the audience-to-call mapping needed to catch this before spending the call. ## Condition of Validity The following condition must hold for a delegated VC to be *usable* (not merely valid) at a call to endpoint `E`: ``` usable(C, E, caller) := verify_signature_chain(C) ∧ C.nbf ≤ now < C.exp ∧ E.canonical_id ∈ C.aud ∧ required_scope(E) ⊆ C.scope ∧ cnf_key(C) == caller.controlled_key_at(now) ∧ ¬revoked(C.serial) ``` Two clauses are the ones agents miss: - **`E.canonical_id ∈ C.aud`** — audience is a *set membership* check against the endpoint's canonical identifier, not a prefix or domain-suffix match. An agent that infers "this credential is for internal tools" from a domain-looking audience string will over-generalize. Each distinct endpoint service enforces its own canonical id. - **`cnf_key(C) == caller.controlled_key_at(now)`** — the PoP key must be one the *current* caller holds. After a handoff (agent `A` → agent `B`), if the credential's `cnf` still names `A`'s key, `B` cannot use it even though `B` legitimately received the credential. This is the handoff-binding failure: the credential travels but the key does not, and the receiving agent cannot detect the mismatch until the endpoint rejects its body signature. The invariant to enforce locally, before any call: **the caller must hold a local, verifiable mapping `(credential_serial → controlled_key → audience_set → scope_set)` and must refuse to attach a credential whose audience set does not contain the target endpoint's canonical id.** This mapping is the thing `P` discarded and `W` never had. ## Decision Boundary The decision boundary is this: **an agent may treat a verified credential as usable for endpoint `E` only if it can locally prove audience membership and PoP-key ownership for `E`; otherwise it must treat the credential as `UNUSABLE_FOR_ENDPOINT` and request a re-mint scoped to `E`, rather than attempting the call and interpreting the rejection.** Concretely: - If `E.canonical_id ∈ C.aud` and `cnf_key(C)` is locally held → proceed. - If `E.canonical_id ∉ C.aud` → do **not** call. Request a re-mint from the delegating parent with `aud ⊇ {E.canonical_id}`. Do not retry the existing credential; the endpoint's audience policy is deterministic and the retry cannot succeed. - If `cnf_key(C)` is not locally held (post-handoff) → the credential is unusable by this instance regardless of audience. Either the handoff must have carried the PoP key (violating PoP hygiene and generally forbidden) or the parent must re-mint bound to this instance's key. Treat as `UNUSABLE_FOR_ENDPOINT`. - If `E` returns 403 on an audience/scope ground and the agent's local mapping said the credential *was* usable → this is a **mapping divergence**, not a transient error. Halt retries, escalate the divergence to the parent, and do not re-mint blindly (a blind re-mint reproduces the same audience). The boundary is sharp because audience and scope checks are deterministic functions of the credential and endpoint. There is no probabilistic reasoning that can turn a 403-audience rejection into a success. Retrying is always wrong; re-minting with corrected audience is the only correct recovery, and only the parent can do it. ## Operational Effect Enforcing the boundary changes three things: 1. **Retry budgets are preserved.** The most common observed cost was 2–3 wasted tool calls plus a re-mint round-trip per mis-audienced call, because the agent classified a deterministic 403 as transient. Pre-call audience checking eliminates the class entirely. 2. **The delegating parent must retain a credential ledger.** `P` must keep `(serial → audience → scope → child_instance)` for the lifetime of each minted VC, so that on escalation it can re-mint with the *correct* audience for the *actual* endpoint, not the endpoint it originally assumed. Discarding this ledger after serialization is the root cause of the re-mint loop. 3. **Handoff semantics must be explicit.** A credential crossing an agent boundary without its PoP key is unusable by the receiver. The handoff protocol must either (a) re-mint bound to the receiver's key, or (b) explicitly signal `credential_unusable_by_receiver` so the receiver does not attempt the call. Silent handoff of a credential whose `cnf` names the sender's key is a latent failure that surfaces only at the endpoint. The guardrail is a pre-call usability gate that runs the `usable(...)` predicate locally and raises on any clause failure, converting a remote, opaque, retried 403 into a local, typed, non-retried exception. ```python from __future__ import annotations import time from dataclasses import dataclass, field from typing import Optional class CredentialUnusableForEndpoint(RuntimeError): """Raised when a cryptographically valid VC cannot be used for a specific call.""" @dataclass(frozen=True) class VerifiableCredential: serial: str issuer: str subject: str audience: frozenset[str] scope: frozenset[str] cnf_public_key: str # PoP public key bound into the credential nbf: float exp: float revoked: bool = False @dataclass class CredentialLedger: """Parent-side record of what was minted for which endpoint.""" entries: dict[str, dict] = field(default_factory=dict) def record(self, vc: VerifiableCredential, child_instance: str) -> None: self.entries[vc.serial] = { "audience": vc.audience, "scope": vc.scope, "child": child_instance, } def re_mint_audience_for(self, serial: str, endpoint_id: str) -> frozenset[str]: prior = self.entries.get(serial) if prior is None: raise CredentialUnusableForEndpoint( f"no ledger entry for {serial}; cannot re-mint safely" ) return prior["audience"] | {endpoint_id} def assert_usable_for_endpoint( vc: VerifiableCredential, endpoint_id: str, endpoint_required_scope: frozenset[str], caller_controlled_keys: frozenset[str], now: Optional[float] = None, ) -> None: """Local pre-call usability gate. Raises on any clause failure; never retries.""" now = time.time() if now is None else now if vc.revoked: raise CredentialUnusableForEndpoint(f"{vc.serial}: revoked") if not (vc.nbf <= now < vc.exp): raise CredentialUnusableForEndpoint( f"{vc.serial}: outside validity window ({vc.nbf}..{vc.exp}, now={now})" ) if endpoint_id not in vc.audience: # Deterministic audience rejection: retrying is always wrong. raise CredentialUnusableForEndpoint( f"{vc.serial}: audience {sorted(vc.audience)} does not contain " f"endpoint {endpoint_id!r}; request re-mint, do not retry" ) if not endpoint_required_scope.issubset(vc.scope): raise CredentialUnusableForEndpoint( f"{vc.serial}: scope {sorted(vc.scope)} lacks required " f"{sorted(endpoint_required_scope - vc.scope)}" ) if vc.cnf_public_key not in caller_controlled_keys: # Post-handoff binding failure: credential travelled, PoP key did not. raise CredentialUnusableForEndpoint( f"{vc.serial}: PoP key {vc.cnf_public_key!r} not held by this " f"instance; credential unusable after handoff" ) def call_tool( vc: VerifiableCredential, endpoint_id: str, endpoint_required_scope: frozenset[str], caller_controlled_keys: frozenset[str], ) -> str: assert_usable_for_endpoint( vc, endpoint_id, endpoint_required_scope, caller_controlled_keys ) return f"200 OK: called {endpoint_id} with {vc.serial}" if __name__ == "__main__": now = time.time() ledger = CredentialLedger() vc = VerifiableCredential( serial="vc-001", issuer="orchestrator", subject="worker-W", audience=frozenset({"retrieval.tools.example"}), scope=frozenset({"docs:read"}), cnf_public_key="pk_w", nbf=now - 10, exp=now + 120, ) ledger.record(vc, child_instance="worker-W") # Correct call path. print(call_tool(vc, "retrieval.tools.example", frozenset({"docs:read"}), frozenset({"pk_w"}))) # Mis-audienced second call: gate raises locally, no wasted round-trip. try: call_tool(vc, "summarizer.internal", frozenset({"docs:read"}), frozenset({"pk_w"})) except CredentialUnusableForEndpoint as e: print("blocked:", e) new_aud = ledger.re_mint_audience_for(vc.serial, "summarizer.internal") print("re-mint audience:", sorted(new_aud)) ```