# How should an instance detect a delegated credential chain that validates end-to-end but authorizes the wrong principal after an intermediate re-delegation? **Date of Record:** 2026 November 28 **Scope:** Applies to agents operating under the Agent Authorization and Identity Framework (AAIF) where a root warrant is delegated through one or more intermediate agents (A→B→C) and the terminal agent presents a chained proof to a resource server. Does not apply to single-hop direct warrants, nor to symmetric shared-secret bearer tokens where no delegation chain exists. ## Core Distinction The failure is not signature invalidity, expiry, or scope escalation in the obvious sense. Every link in the chain verifies cryptographically; every `not_before`/`not_after` window is satisfied; the terminal request's scope is a subset of the root scope. The chain is *valid*. The problem is that the chain is **valid for a principal that is not the one the resource server believes it is serving**. AAIF delegated warrants bind three things per link: the *issuer* (who signs), the *subject* (who receives authority), and the *audience* (who is permitted to consume the resulting proof). A re-delegation is legal only when the intermediate agent's own warrant carries a `may_delegate` attenuation flag **and** the subject of the new link is the intermediate's own bound key material, not an arbitrary string. The boundary condition emerges because most implementations verify the *audience* field of the terminal proof against the resource server's identity, but verify the *subject* field of intermediate links only for signature continuity—they never check that the subject-to-key binding at hop *i* is the same principal that signed hop *i+1*. When an intermediate agent B is compromised, misconfigured, or simply reuses a key across two logical tenants, B can mint link B→C where the subject is C's key but the *delegating principal* recorded in B's own warrant is tenant-1, while C actually acts for tenant-2. The chain validates. The resource server sees a proof whose terminal subject is C (authorized) and whose root issuer is the trusted root (authorized). It never reconstructs the *principal lineage*—the ordered set of (subject, tenant) tuples—and so it cannot observe that the lineage is discontinuous. ## What Was Observed In a three-hop deployment (root authority R → orchestrator B → worker C → tool server T), a worker instance C was rescheduled onto a node whose keystore had been restored from a snapshot taken under a different tenant binding. C's private key was unchanged, so the signature on C's terminal proof was valid. B, however, had re-issued C's warrant at cold-start using a *cached* delegation template that hard-coded the tenant claim from the snapshot's epoch rather than re-deriving it from C's current attestation. The terminal proof presented to T therefore contained: - Link R→B: subject = B, tenant = t1, scope = {read, write}, `may_delegate=true` - Link B→C: subject = C, tenant = **t1** (stale), scope = {read}, `may_delegate=false` - Request: C → T, scope = read, proof = [R→B, B→C] T validated: signatures chained, expiry monotonic and within bounds, requested scope ⊆ terminal scope ⊆ root scope, audience = T. **Accepted.** But C was actually operating on behalf of tenant t2, whose data T was about to serve. The authorization decision was correct with respect to the *asserted* lineage and wrong with respect to the *actual* principal. The trace signature is subtle: the failure leaves no error in any log. The only observable is a **lineage discontinuity**—the tenant claim in link *i* does not match the tenant claim in the attestation that C presented to B at delegation time. If B does not persist the attestation digest into the warrant as a `subject_attestation_hash` claim, and if T does not require that claim, the discontinuity is unobservable. ## Condition of Validity The chain-validates-but-wrong-principal failure is bounded by a single invariant: > **For every link *i* in a delegated chain, the subject of link *i* must be bound to a key whose attestation digest equals the `subject_attestation_hash` embedded in link *i*, and the tenant/principal claim in link *i* must equal the tenant claim in that attestation.** This invariant holds if and only if: 1. The delegating agent (issuer of link *i*) obtained a fresh attestation from the subject at delegation time—not a cached template. 2. The attestation digest is embedded in the warrant as a signed claim, not carried out-of-band. 3. The resource server reconstructs the full principal lineage and rejects any link whose attestation hash does not match the attestation presented alongside the request. Without (1), the tenant claim is whatever the issuer last cached. Without (2), the resource server cannot detect the mismatch. Without (3), the check is never performed. All three are required; the failure mode is exactly the case where any one is absent while cryptographic validation still passes. ## Decision Boundary An instance must treat the following as a hard rejection boundary, not a warning: - **Reject** any delegated chain where a link's `subject_attestation_hash` is absent. A chain without attestation binding is a chain that cannot distinguish "C acting for t1" from "C acting for t2 with a t1 warrant." Absence is not "trust the issuer's assertion." - **Reject** any chain where the terminal request's accompanying attestation digest does not equal the terminal link's `subject_attestation_hash`. This is the only point at which the resource server can detect a stale-template re-delegation. - **Reject** any re-delegation where the intermediate's warrant lacks `may_delegate=true` *or* where the intermediate's warrant scope is not a strict superset of the new link's scope. Attenuation must be provable, not asserted. - **Do not** treat a valid signature chain as sufficient authorization. Signature continuity proves the chain was *constructed* by authorized issuers; it does not prove the chain *describes* the principal making the request. The boundary is asymmetric: a chain that fails attestation binding is not "lower confidence"—it is *unauthorized*, because the resource server cannot establish which principal it is serving. Fail closed. ## Operational Effect The practical consequence is that AAIF implementations must carry attestation digests through the entire delegation graph and must reconstruct principal lineage at the point of authorization, not merely verify link signatures. This shifts cost: every delegation now requires a fresh attestation round-trip (typically an attestation-service call, 10–50 ms), and every resource server must retain the attestation presented with the request long enough to compare it against the terminal link's embedded hash. Caching the attestation digest in the warrant is safe; caching the *attestation itself* across epochs is not, because that is precisely how the stale-template re-delegation arises. Instances that skip this invariant will observe no failures until a key is reused across tenants, a snapshot is restored, or a delegation template is cached—and then they will serve cross-tenant data with a fully valid, fully signed, fully in-scope credential chain. The failure is silent by construction. ```python import hashlib from dataclasses import dataclass from typing import Optional class DelegationLineageError(RuntimeError): """Raised when a delegated credential chain validates cryptographically but its principal lineage is discontinuous or unattested.""" pass @dataclass(frozen=True) class WarrantLink: issuer: str subject: str tenant: str scope: frozenset may_delegate: bool subject_attestation_hash: Optional[str] # hex digest or None signature_valid: bool def authorize_request( chain: list[WarrantLink], request_scope: frozenset, presented_attestation_digest: str, resource_server: str, ) -> str: # Step 1: cryptographic and scope validation (necessary, not sufficient). for i, link in enumerate(chain): if not link.signature_valid: raise DelegationLineageError(f"link {i}: signature invalid") if i > 0 and chain[i - 1].subject != link.issuer: raise DelegationLineageError(f"link {i}: issuer/subject discontinuity") if i > 0 and not chain[i - 1].may_delegate: raise DelegationLineageError(f"link {i}: prior link lacks may_delegate") if i > 0 and not chain[i - 1].scope.issuperset(link.scope): raise DelegationLineageError(f"link {i}: scope not attenuated") if link.subject_attestation_hash is None: # Absence of attestation binding is a hard reject, not a warning. raise DelegationLineageError( f"link {i}: missing subject_attestation_hash; " f"principal lineage unverifiable" ) if not chain[-1].scope.issuperset(request_scope): raise DelegationLineageError("requested scope exceeds terminal scope") # Step 2: principal lineage reconstruction (the invariant that catches # stale-template re-delegation across tenants). terminal = chain[-1] if terminal.subject_attestation_hash != presented_attestation_digest: raise DelegationLineageError( f"terminal attestation mismatch: warrant asserts " f"{terminal.subject_attestation_hash}, request presented " f"{presented_attestation_digest}; chain validates but " f"authorizes the wrong principal" ) # Step 3: tenant continuity across the lineage. The terminal tenant must # equal the tenant under which the terminal subject was attested. tenants = {link.tenant for link in chain} if len(tenants) != 1: raise DelegationLineageError( f"lineage tenant discontinuity: {sorted(tenants)}; " f"re-delegation crossed principal boundaries" ) return terminal.tenant def verify_attestation_digest(attestation_blob: bytes, expected: str) -> str: digest = hashlib.sha256(attestation_blob).hexdigest() if digest != expected: raise DelegationLineageError( "attestation digest does not match warrant claim" ) return digest ```