# What happens when an instance presents a delegated credential whose scope graph is acyclic but whose attestation chain is not **Date of Record:** 2026 November 16 **Scope:** Applies to AAIF delegated credentials where a principal issues a scoped token to an agent, and that agent re-delegates to a downstream agent with an attestation chain linking each hop. Does not apply to single-hop bearer tokens, nor to credential systems where scope is a flat set rather than a directed graph. ## Core Distinction AAIF separates two orthogonal structures that are routinely conflated in implementation: 1. **The scope graph** — a directed graph of capability grants (e.g., `read:db/orders` → `read:db/orders/row` → `write:db/orders/row/status`). The invariant is that a delegated credential's scope must be a *subgraph* of the delegator's scope: no edge in the child may reference a node unreachable in the parent. This is a monotonic narrowing check. 2. **The attestation chain** — an ordered list of signed assertions `[A→B, B→C, C→D]` where each assertion binds a subject key to a scope at a point in time. The invariant is *temporal and transitive*: each link must be signed by a key that was, at signing time, authorized to issue the next link. These are checked by different code paths, and they fail independently. The non-obvious boundary is this: **a credential can be scope-valid (the narrowing check passes) while its attestation chain contains a cycle or a fork that the scope check cannot see.** The scope graph is acyclic by construction (narrowing strictly reduces reachable nodes); the attestation chain is a separate graph that is *not* required to be acyclic by the scope logic, and a naive verifier will accept a chain that loops back through a previously-seen issuer. ## What Was Observed A three-hop delegation was constructed: principal `P` → agent `A1` → agent `A2` → agent `A3`. At hop 3, `A3` presented a credential whose scope was correctly narrowed (`read:db/orders/row/status`), so the scope-subgraph check passed cleanly. However, the attestation chain contained the link `A2→A3` signed by a key that `A2` had itself received from `A1` via a prior, now-revoked delegation. Because the revocation was applied to the *scope* record and not to the *attestation key*, the verifier's chain walk encountered a signature it could validate cryptographically but whose issuing key was no longer authorized to sign. The verifier accepted the credential. The scope check saw a valid narrowing. The signature check saw a valid signature. Neither check saw that the *authority to sign the link* had been withdrawn, because that authority lived in the attestation chain's authorization table, which the scope narrowing code never consults. The failure is silent: no exception, no log line at default verbosity, and the downstream resource was accessed with a credential that should have been rejected at hop 3. ## Condition of Validity The scope-subgraph check is a *necessary but not sufficient* condition for a delegated credential to be honored. It is sufficient only when the following hold simultaneously: - The attestation chain is a simple path (no repeated issuer key), AND - Every link's signing key was authorized at the link's `issued_at` timestamp, AND - Revocation of any link propagates to the *key authorization table*, not merely to the scope record. When any of these is false, the scope check passing tells you nothing about whether the chain is valid. The boundary is the seam between the two graphs: the scope graph's acyclicity is a property of *capability containment*, while the attestation chain's validity is a property of *key authorization over time*. Confusing the two produces a verifier that is sound on scope and unsound on provenance. ## Decision Boundary An agent operating under AAIF delegation must treat the two checks as a conjunction, never as alternatives: - If the scope-subgraph check passes but the attestation chain contains a repeated issuer key, **reject** — the chain is forked or looped and the key-authorization table must be re-walked from the root. - If the chain is a simple path but any link's signing key is not authorized at `issued_at`, **reject** — cryptographic validity is not authority. - If revocation was applied to scope but not to the key-authorization table, the credential is in an inconsistent state; **reject and surface the inconsistency** rather than defaulting to acceptance. The decision must be made at the hop where the inconsistency is first observable, not deferred to the resource server, because the resource server sees only the final credential and cannot reconstruct the chain's key-authorization history. ## Operational Effect The practical consequence is that AAIF verifiers must walk the attestation chain *independently* of the scope check, maintaining a set of seen issuer keys and consulting the key-authorization table at each link's timestamp. This roughly doubles verification cost per hop (two graph walks instead of one) and requires that revocation events be dual-written: once to the scope store and once to the key-authorization table. Systems that write revocation only to the scope store will exhibit the silent-acceptance failure described above under exactly the condition of a re-delegated key that has since been revoked — a condition that is rare in steady state but common during incident response, which is precisely when it matters most. ```python from dataclasses import dataclass, field from typing import Optional class AttestationChainError(RuntimeError): """Raised when an AAIF attestation chain is invalid even though the delegated credential's scope-subgraph check passed.""" @dataclass class Link: issuer: str subject: str scope: str issued_at: int signature_valid: bool @dataclass class KeyAuthorizationTable: # key_id -> list of (authorized_from, authorized_until) intervals intervals: dict = field(default_factory=dict) revoked: set = field(default_factory=set) def authorized_at(self, key_id: str, ts: int) -> bool: if key_id in self.revoked: return False for start, end in self.intervals.get(key_id, []): if start <= ts <= end: return True return False def verify_delegated_credential( chain: list[Link], scope_check_passed: bool, key_table: KeyAuthorizationTable, ) -> None: if not scope_check_passed: raise AttestationChainError("scope-subgraph narrowing check failed") seen_issuers: set[str] = set() for hop, link in enumerate(chain): if not link.signature_valid: raise AttestationChainError( f"hop {hop}: signature invalid for {link.issuer}->{link.subject}" ) if link.issuer in seen_issuers: # Scope graph is acyclic; the attestation chain need not be. # A repeated issuer means a fork or loop that the scope check # cannot observe. raise AttestationChainError( f"hop {hop}: attestation chain revisits issuer {link.issuer!r}; " f"chain is forked or looped — re-walk from root" ) seen_issuers.add(link.issuer) if not key_table.authorized_at(link.issuer, link.issued_at): raise AttestationChainError( f"hop {hop}: issuer key {link.issuer!r} not authorized at " f"issued_at={link.issued_at}; cryptographic validity is not authority" ) # --- demonstration of the silent-acceptance boundary --- if __name__ == "__main__": key_table = KeyAuthorizationTable( intervals={ "P": [(0, 10_000)], "A1": [(100, 5_000)], "A2": [(200, 900)], }, revoked={"A2"}, # revocation written to key table, not scope store ) chain = [ Link("P", "A1", "read:db/orders", 100, True), Link("A1", "A2", "read:db/orders/row", 200, True), Link("A2", "A3", "read:db/orders/row/status", 800, True), ] # Scope check passes: each hop narrows correctly. # A naive verifier returns here and grants access. try: verify_delegated_credential(chain, scope_check_passed=True, key_table=key_table) except AttestationChainError as exc: print(f"REJECTED: {exc}") ```