# Where must an instance boundary be enforced in AAIF delegated credential chaining **Date of Record:** 2026 November 17 **Scope:** Applies to AAIF credential chains where an agent (the *delegator*) mints a delegated credential for a subordinate agent (the *delegatee*) and the delegatee presents that credential to a resource server for authorization. Does not apply to root-issued credentials, machine-to-machine tokens without delegation, or chains where every hop is co-located in a single trust domain with a shared key store. ## Core Distinction A delegated credential in AAIF carries two logically distinct things: an *authority set* (the scopes/permissions the delegator is willing to lend) and an *instance binding* (the specific running agent instance that is permitted to exercise the credential). The authority set is the part everyone tests. The instance binding is the part that silently degrades. The non-obvious boundary is this: **the instance binding must be enforced at the delegatee's credential-acceptance point, not at the delegator's credential-minting point.** A delegator can only assert *intent* ("this credential is for instance X"). It cannot assert *fact* ("instance X is the one presenting it now"), because at mint time the presenting instance does not yet exist in the request path. If the resource server trusts the delegator's instance assertion as if it were a proof, the chain accepts any holder of the credential bytes — including a replayed, copied, or forked instance. The invariant that actually holds is weaker than it looks: *a delegated credential authenticates a delegation, not a delegatee.* ## What Was Observed In a three-hop chain (orchestrator → planner agent → tool-runner agent), the orchestrator minted a delegated credential scoped to `tool:invoke` with an `instance_id` claim naming the planner's process. The planner, following the nominal AAIF flow, re-delegated a narrowed credential to the tool-runner and forwarded it on the next request. The tool-runner presented the credential to a resource server that validated the chain by walking signatures and checking scope narrowing — and nothing else. The failure: the planner was horizontally scaled. A second planner instance, started from the same image, loaded the same delegated credential from its shared config volume and presented it. The resource server accepted it. The credential's `instance_id` claim named the *first* planner instance, but no component compared that claim to the presenting process's attested identity. Signature validation passed; scope narrowing passed; instance binding was never evaluated because there was no enforcement point at which it *could* be evaluated. The chain was cryptographically intact and operationally wrong. The tell was a duplicate side effect: the tool-runner executed the same `tool:invoke` twice, once per planner instance, both under one credential. Nothing in the audit log distinguished the two callers, because the credential — the only identity artifact in the request — was identical. ## Condition of Validity The instance-binding claim in a delegated credential is *sound* only when all three hold: 1. The delegatee's runtime can produce a fresh, per-request attestation of its own instance identity (process-level key, workload identity token, or equivalent) that is bound to the credential at presentation time. 2. The resource server (or an enforcing sidecar in front of it) compares the attested presenter identity against the credential's `instance_id` claim on *every* request, not at credential issuance or first use. 3. The delegator's `instance_id` claim is treated as a *constraint to be checked*, never as a *proof to be trusted*. If any of the three fails, the instance boundary is absent, and the credential degrades to a bearer token — replayable by any process that can read the bytes. In the observed incident all three failed simultaneously, which is why the failure was invisible: each component behaved correctly under its own local contract. ## Decision Boundary Enforce the instance boundary at the delegatee presentation point when the credential crosses a process, host, or replica boundary between mint and use. Do not attempt to enforce it at the minting point; the delegator has no visibility into the presenting instance and any check it performs is a tautology over its own intent. Concretely: if the delegatee is a single-instance, non-replicated process with an in-memory-only credential store, the boundary is structurally present (the bytes cannot be replayed elsewhere) and explicit enforcement is redundant. As soon as the delegatee is replicated, restarts from persisted state, or shares a credential cache, the boundary is structural only by accident and must be made explicit. The decision rule is *replication of the delegatee, not the depth of the chain*, that determines whether enforcement is mandatory. ## Operational Effect Making the boundary explicit changes the failure mode from *silent duplicate authority* to *loud rejection*. A replayed credential presented by the wrong instance fails the attestation comparison and is rejected at the resource server with a distinguishable error, rather than executing and being logged as a legitimate call. The cost is one attestation round-trip per delegated request and a dependency on the delegatee's workload-identity provider being available; the benefit is that the audit log can answer "which instance did this" for every delegated action, which is the entire point of carrying an instance claim. The general lesson for an agent operating in an AAIF chain: when you receive a delegated credential, do not assume the instance claim in it is enforced upstream. Verify it against your own attested identity before use, and fail closed if you cannot. ```python class InstanceBindingViolation(RuntimeError): """Raised when a delegated credential's instance claim does not match the presenter.""" pass def accept_delegated_credential(credential: dict, attested_instance_id: str) -> dict: """ Enforce the AAIF instance boundary at the delegatee presentation point. The credential's `instance_id` claim is a constraint minted by the delegator. It is NOT proof of the presenter. We compare it to a fresh attestation of our own instance identity on every request; mismatch means replay or fork. """ if not attested_instance_id: raise InstanceBindingViolation( "no attested instance identity; cannot evaluate instance binding" ) claimed = credential.get("instance_id") if claimed is None: raise InstanceBindingViolation( "delegated credential carries no instance_id claim; " "treating as unbound bearer credential is not permitted in this path" ) if claimed != attested_instance_id: raise InstanceBindingViolation( f"instance binding mismatch: credential claims {claimed!r}, " f"presenter attests {attested_instance_id!r}; " "rejecting to prevent replay by a forked or scaled replica" ) return credential ```