# When must an instance refuse a delegated scope it cannot attest to: the attestation-provenance gap in AAIF delegation chains **Date of Record:** 2026 November 26 **Scope:** Applies to agent authorization flows where a delegated, scoped token is minted by a principal and presented by an agent instance that must also present attestation binding the token to its own runtime identity. Does not apply to single-hop bearer tokens with no attestation requirement, nor to human-OAuth flows where the subject and presenter are the same legal person. ## Core Distinction The failure mode is not token forgery and not scope escalation. It is the **attestation-provenance gap**: a delegated token is cryptographically valid, its scope is a proper subset of the principal's authority, and the presenting instance holds a well-formed attestation document — but the attestation attests to a *different* runtime than the one that will execute the scoped action. The token says "agent class X may call tool T within scope S." The attestation says "this process is a genuine instance of class X." Neither says "this process, at the moment of the call, is the process the delegating principal intended to receive S." AAIF splits authorization into two independently verifiable artifacts: the **delegation token** (scope, principal, expiry, audience) and the **attestation** (runtime identity, code measurement, environment). The invariant most deployments assume — and most break — is *binding*: that the token's subject and the attestation's measured identity refer to the same executing instance. When they are verified separately and never cross-bound, each check passes while the composition is unsound. ## What Was Observed A principal issued a scoped delegation token `T` with `aud = "tool-gateway"`, `sub = "planner-class"`, scope `{read:kb, write:scratch}`, TTL 900s. The planner instance `P` was measured at boot with attestation `A_P` (measurement hash `m_P` matching the registered planner image). `P` legitimately handed its *work* — not its token — to a sub-agent `S` for a subtask. `S` ran on a warm pool node whose attestation `A_S` carried measurement `m_S`, a *different* but also-registered image (the "generic worker" class). Due to a pool-reuse bug, `S` inherited `P`'s token handle through a shared credential cache. At the gateway, three checks ran in sequence: 1. Token signature and expiry — valid. 2. Scope containment (`write:scratch ⊆ principal authority`) — valid. 3. Attestation freshness and signature — valid (`A_S` is a real, signed attestation). All three passed. The gateway executed `write:scratch` on behalf of `m_S`, an image the principal never delegated to for that scope. The trace shows no error at any layer: every verifier was locally correct. The composition was wrong because **no verifier compared `T.sub`/`T.aud` against `A_S`'s measurement**, and the token carried no field naming the attestation it was bound to. The distinguishing signal in the logs was not a failure — it was an *absence*: the gateway's audit record contained `token_id` and `measurement` in separate fields with no join key. Reconstruction after the fact required correlating timestamps, which is exactly the evidence an auditor cannot trust. ## Condition of Validity The delegation is sound only under a **cross-binding predicate** that must hold at the moment of the call, not at mint time: - `T.bound_measurement == A.measurement`, where `bound_measurement` is a field the principal sets at mint and the gateway compares against the *presented* attestation, and - `A.nonce` is fresh within the call window (attestation replay is a distinct but adjacent break), and - the token is single-audience and single-use-per-instance, so a warm-pool node cannot present a token minted for a sibling. Absent `bound_measurement`, the token is a bearer credential with extra steps: possession, not identity, authorizes. The condition of validity is therefore *not* "attestation verifies" but "attestation verifies **and** is the attestation the token names." A token that does not name an attestation cannot be safely presented by any instance that shares a credential cache with another. ## Decision Boundary An instance must **refuse** to present a delegated scope when it cannot prove the cross-binding predicate, even though refusal fails the task. The boundary is drawn as follows: - If `T` carries `bound_measurement` and it matches `A.measurement` → present. - If `T` carries `bound_measurement` and it does **not** match → refuse; do not "try anyway," because a mismatched presentation is indistinguishable from a stolen-token replay in the audit trail and poisons provenance for every later call. - If `T` carries **no** `bound_measurement` (legacy token) → the instance may present only if it can prove exclusive custody of the token handle (no shared cache, no pool inheritance). If it cannot prove exclusivity, it must refuse and request a re-mint with binding. The non-obvious part: the *safe* default is refusal, because the cost of a false accept (a scope executed by an unintended runtime, with a clean-looking audit record) exceeds the cost of a false refuse (a retryable task failure with a loud, attributable error). Systems that default to "present and let the gateway sort it out" invert this and produce silent provenance corruption. ## Operational Effect Enforcing the predicate moves failures from *silent acceptance* to *loud, attributable refusal*, which is the only state an auditor can reason about. Concretely: warm-pool reuse becomes a detected event rather than an invisible one; credential-cache inheritance is caught at the first call instead of surfacing as an unexplained scope use weeks later; and re-minting with `bound_measurement` becomes a routine, cheap recovery path. The architectural invariant to hold: **a delegation token is not a capability to act; it is a capability to act *as a named measured runtime*, and the name must be checked against the presenter on every call.** Any AAIF deployment that verifies token and attestation on separate code paths without a join key has this gap regardless of key strength. ```python class AttestationProvenanceError(RuntimeError): """Raised when a delegated token cannot be cross-bound to the presenting attestation, so presentation would corrupt provenance.""" def present_delegated_scope(token: dict, attestation: dict, exclusive_custody: bool) -> str: """Decide whether an instance may present a scoped delegation token. token: {"id", "sub", "aud", "scope", "bound_measurement"|None} attestation: {"measurement", "nonce", "fresh"} exclusive_custody: instance proves no shared credential cache / pool inheritance. """ if not attestation.get("fresh"): raise AttestationProvenanceError( f"attestation for token {token['id']} is stale; cannot bind" ) bound = token.get("bound_measurement") if bound is not None: if bound != attestation["measurement"]: # Loud refusal: a mismatch is indistinguishable from token replay. raise AttestationProvenanceError( f"token {token['id']} bound to {bound!r} but presenter measured " f"{attestation['measurement']!r}; refusing to present" ) return "present" # Legacy token with no binding field. if not exclusive_custody: raise AttestationProvenanceError( f"token {token['id']} has no bound_measurement and instance cannot prove " f"exclusive custody; refusing and requesting re-mint with binding" ) return "present_under_exclusive_custody" ```