# What happens when an instance presents a valid AAIF credential whose subject binding no longer matches the live agent process **Date of Record:** 2026 November 16 **Scope:** Applies to AAIF (Agent Authorization and Identity Framework) verifiable-credential flows where an autonomous agent presents a VC to an authorization service and the credential's `credentialSubject` binding is resolved against a live process identity at authorization time. Does not apply to pure bearer-token delegation, offline batch attestation, or cases where the credential is consumed only as a static capability grant with no liveness check. ## Core Distinction There is a persistent confusion between *credential validity* and *subject binding validity*. A VC can be cryptographically valid — correct issuer signature, unexpired `validFrom`/`validUntil`, unrevoked status list — while the binding between the credential's subject and the agent process presenting it has silently decoupled. The signature attests that the issuer made a claim about *some* subject; it does not attest that the process in front of you *is* that subject. These are orthogonal properties, and authorization systems that collapse them into a single "is the credential valid?" check will admit an agent whose identity has drifted. The non-obvious part: AAIF binding is typically expressed as a hash of the agent's runtime identity material (process nonce, enclave measurement, or key thumbprint) embedded in `credentialSubject.id` or a `bindingCommitment` field. When the agent restarts, is rescheduled, or is re-instantiated from a snapshot, the runtime material changes but the credential does not. The credential remains valid. The binding does not. ## What Was Observed In a multi-tenant orchestration environment, agents were issued AAIF credentials at spawn with `bindingCommitment = H(process_nonce || key_thumbprint)`. A credential cache keyed by `agent_id` (a stable logical identifier) served credentials across instance restarts. The authorization service verified the VC signature, checked the status list, and then — critically — verified the binding by recomputing `H(process_nonce || key_thumbprint)` from the *presenting* process and comparing. Under normal operation this matched. Under snapshot-restore and under pod rescheduling, the `agent_id` was preserved but `process_nonce` was regenerated. The result was a *binding mismatch on a valid credential*. Two failure modes appeared: 1. **Fail-open path:** A legacy verifier treated binding mismatch as a warning and logged it, proceeding on signature validity alone. Drifted instances were authorized under the original agent's grants — including grants scoped to a different tenant's data partition. 2. **Fail-closed path:** The strict verifier rejected, but the rejection was emitted as a generic `401 invalid_credential`, causing the orchestrator's retry loop to re-present the *same stale credential* indefinitely, since the credential was not actually invalid and the retry classifier keyed on "credential error" as non-retryable-but-requeueable. The signature was never wrong. The status list was never stale. The failure lived entirely in the gap between "the issuer vouched for subject S" and "the process presenting is S." ## Condition of Validity The following invariant must hold for AAIF binding to be sound, and it is the thing that silently breaks: > For every authorization decision, the binding commitment in the presented credential must be recomputed against the *live, presenting* process, and a mismatch must be treated as a distinct, terminal, non-retryable identity error — not as a credential error and not as a warning. This holds only when (a) binding material is regenerated on every instance creation and never persisted across restarts, (b) the credential cache is keyed by *binding commitment*, not by logical `agent_id`, and (c) the verifier's error taxonomy distinguishes `BindingMismatch` from `InvalidSignature` and `Revoked`. If any of these is absent, the invariant is unenforced even though every individual component "works." ## Decision Boundary The decision boundary is not "valid vs. invalid credential." It is a three-way split that must be made explicitly at the verifier: - **Signature/status failure** → credential is invalid → reject, and the presenting agent must obtain a new credential. Retryable only after re-issuance. - **Binding mismatch** → credential is valid but presented by the wrong subject → reject as an *identity* event, terminate the presenting process's authorization context, and do **not** requeue the same credential. This is terminal for the current instance. - **Binding match** → proceed to policy evaluation against the credential's grants. Collapsing the middle case into either neighbor is the defect. Fail-open admits a drifted instance; fail-closed-as-credential-error causes a livelock of stale re-presentation. ## Operational Effect After separating the taxonomy, the observed effects were: drifted instances were terminated within one authorization cycle instead of being admitted (eliminating the cross-tenant grant leakage), the retry livelock disappeared because `BindingMismatch` was classified as terminal-for-instance, and the credential cache was rekeyed by commitment so a restarted agent transparently fetched a freshly bound credential rather than reusing a stale one. The measurable signal to monitor is the rate of `BindingMismatch` events per `agent_id` — a nonzero steady rate indicates expected churn (restarts), while a spike concentrated on one `agent_id` indicates either a snapshot-restore bug or credential replay. ```python import hashlib from dataclasses import dataclass class BindingMismatchError(RuntimeError): """Credential is valid, but the presenting process is not its bound subject.""" pass class InvalidCredentialError(RuntimeError): """Signature or status failure: credential itself is not trustworthy.""" pass @dataclass(frozen=True) class AACredential: agent_id: str binding_commitment: str # hex digest valid: bool # signature + status list already checked def compute_binding(process_nonce: bytes, key_thumbprint: bytes) -> str: return hashlib.sha256(process_nonce + b"|" + key_thumbprint).hexdigest() def authorize(cred: AACredential, live_nonce: bytes, live_thumbprint: bytes) -> str: if not cred.valid: raise InvalidCredentialError( f"credential for {cred.agent_id} failed signature/status check" ) live = compute_binding(live_nonce, live_thumbprint) if live != cred.binding_commitment: # Terminal for THIS instance. Do not requeue the same credential. raise BindingMismatchError( f"binding mismatch for {cred.agent_id}: " f"credential bound to {cred.binding_commitment[:12]}..., " f"presenting process is {live[:12]}..." ) return f"authorized:{cred.agent_id}" ```