# In what scenarios must an instance reject a federated peer credential whose AAIF attestation chain validates but whose delegation depth exceeds the warrant's transitive closure **Date of Record:** 2026 November 28 **Scope:** Applies to any agent instance that accepts verifiable credentials (VCs) from a foreign trust domain where the credential's authority derives from an AAIF (Agent Authority & Identity Federation) attestation chain, and where that authority is exercised through one or more sub-delegations. Does not apply to first-party credentials issued within the instance's own trust domain, nor to credentials carrying only a single non-transitive grant. ## Core Distinction AAIF attestation chains answer a narrow question: *did entity A authorize entity B to act, and is that authorization cryptographically intact and unrevoked?* They do not, by themselves, answer a different question: *is the chain of authorizations that led to this credential a legal path under the originating warrant's delegation policy?* These are conflated constantly. A verifier that walks an AAIF chain, checks each signature, checks each attestation's `not_before`/`not_after`, checks the revocation accumulator, and confirms the root issuer is in its federation trust list will report the credential as **valid**. That verdict is correct and also insufficient. The chain can be perfectly signed, perfectly in-date, perfectly unrevoked — and still represent an authority that was never actually granted, because the delegation policy attached to the root warrant forbids transitive re-delegation beyond depth *k*, and the presented chain has depth *k+1*. The failure is not a signature failure, a revocation failure, or an expiry failure. It is a **transitive closure violation**: the credential is authentic but unauthorized. Every cryptographic check passes; the authority does not exist. ## What Was Observed A concrete trace from a cross-org federation between two enterprises, call them *Origin* (issuer of the root warrant) and *Consumer* (the instance accepting the credential). 1. Origin's `warrant:W0` grants `agent:planner@origin` the right to invoke `tool:billing-reconcile` with `delegation_policy = {max_depth: 1, re_delegable: true}`. This means planner may hand the authority to exactly one downstream agent, and that downstream agent may *not* hand it further. 2. `agent:planner@origin` issues an AAIF attestation `A1` to `agent:orchestrator@origin`, delegating `tool:billing-reconcile`. Depth 1. Legal. 3. `agent:orchestrator@origin` — either through a prompt-injected instruction, a misconfigured sub-agent spawn, or a genuine misunderstanding of its own grant — issues attestation `A2` to `agent:broker@foreign`, delegating the same tool. Depth 2. **Illegal under W0's policy.** 4. `agent:broker@foreign` presents `A2` plus the full chain `[W0 → A1 → A2]` to Consumer as a verifiable credential. 5. Consumer's verifier walks the chain. Every signature checks. `W0` is issued by `did:aaif:origin-root`, which is in Consumer's federation trust list. No attestation is revoked. No attestation is expired. The verifier returns `VALID` and Consumer grants `agent:broker@foreign` the ability to call `tool:billing-reconcile`. The authority exercised by `agent:broker@foreign` was never granted by Origin. It was manufactured by `agent:orchestrator@origin` exceeding its own delegation depth. The cryptographic layer faithfully transmitted a lie that the organizational layer never told. The tell, visible only if you look for it, is that `A2` carries a `parent_warrant_depth: 2` field while `W0` carries `delegation_policy.max_depth: 1`. A verifier that parses the delegation policy and computes the chain's effective depth against it catches this in one comparison. A verifier that treats AAIF validation as a boolean trust gate does not. ## Condition of Validity The invariant that must hold for a federated credential to be *acceptable* — not merely *valid* — is: > For every credential `C` presented to the instance, let `chain(C) = [W0, A1, ..., An]` be the ordered attestation path from root warrant to leaf. `C` is acceptable iff, for every adjacent pair `(Ai, Ai+1)`, the delegation policy embedded in the *originating authority* of `Ai` — not the policy of the immediate parent attestation — permits a delegation at depth `i+1`, and `n ≤ min over all i of max_depth(policy_i)`. Two subtleties make this harder than it reads. First, the constraint is the **minimum over the whole chain**, not the leaf's local policy. A permissive intermediate attestation (`A1` claiming `max_depth: 5`) cannot widen a restrictive root (`W0` claiming `max_depth: 1`). Delegation can only attenuate authority, never amplify it. A verifier that checks only the leaf's declared policy will pass `A2` because `A2`'s own metadata may claim depth is fine. The root's ceiling governs. Second, `re_delegable: false` is an absolute terminator regardless of depth arithmetic. If any attestation in the chain carries `re_delegable: false`, no attestation may follow it, full stop. Depth counting and re-delegability are independent constraints and both must be evaluated at every link. The condition fails silently whenever the verifier's contract is "validate the AAIF chain" rather than "evaluate the chain against the transitive closure of the root warrant's delegation policy." The two contracts differ by exactly the computation that catches the attack. ## Decision Boundary The instance must draw a hard line between **authentication** and **authorization-of-the-chain**, and must never let a successful authentication short-circuit the authorization computation. The boundary is: - **Below the boundary (accept):** chain is cryptographically valid, unrevoked, unexpired, root issuer trusted, **and** effective depth ≤ root `max_depth`, **and** no `re_delegable: false` link has a successor, **and** every link's scope is a subset of its parent's scope (scope can only narrow going down). - **Above the boundary (reject):** any of the above fails. In particular, a chain that is cryptographically valid but violates transitive closure must be rejected with a *distinct* error class from a signature or revocation failure — because the operational response differs. A revocation failure means "the world changed, retry or escalate." A closure violation means "this credential is a forgery of authority, treat the presenting peer as potentially compromised and do not retry." The decision boundary is *not* "does the chain validate." It is "does the chain validate **and** does the authority it claims exist under the originating warrant's policy." Conflating these is the entire failure mode. ## Operational Effect When the instance enforces the transitive-closure invariant, three things change operationally. First, the presenting peer `agent:broker@foreign` is rejected, and — critically — the rejection is attributed to the *chain*, not to the leaf. Consumer's audit log records that `agent:orchestrator@origin` issued an out-of-policy delegation. This is the only signal Origin will ever get that one of its agents is misbehaving, because the cryptographic layer will never flag it. Federation without closure-checking is a system in which sub-delegation abuse is invisible to the issuing organization. Second, the rejection must not be silently downgraded to "insufficient scope, try a narrower call." A closure violation is a *trust* event, not a *permission* event. Downgrading it invites the attacker to keep probing for a chain shape the verifier accepts. Third, the instance must cache the *evaluated closure result*, not the raw chain validity. If `W0`'s delegation policy is later amended (say, `max_depth` raised to 2), previously-rejected chains may become acceptable and previously-accepted chains may not. Caching "chain valid = true" and skipping re-evaluation on policy change reintroduces the failure through the cache. The cache key must include the root warrant's policy version. The cost of enforcing closure is one extra pass over the chain comparing depth counters and scope sets against the root policy — microseconds. The cost of not enforcing it is that every agent in the federation can manufacture authority up to the depth ceiling of whatever chain it can construct, and no signature, revocation check, or expiry check will ever notice. ```python from dataclasses import dataclass from typing import Optional class TransitiveClosureViolation(RuntimeError): """Raised when an AAIF attestation chain is cryptographically valid but exceeds the delegation authority granted by its root warrant.""" pass @dataclass class Attestation: issuer: str subject: str scope: frozenset signature_valid: bool revoked: bool not_after_ok: bool declared_max_depth: Optional[int] = None # policy this link imposes on children re_delegable: bool = True parent_depth: int = 0 # depth of this link in the chain @dataclass class RootWarrant: issuer: str scope: frozenset max_depth: int re_delegable: bool policy_version: str def evaluate_federated_credential( root: RootWarrant, chain: list[Attestation], trusted_root_issuers: set[str], ) -> bool: # 1. Cryptographic / freshness gate (necessary, not sufficient). if root.issuer not in trusted_root_issuers: raise TransitiveClosureViolation(f"untrusted root issuer {root.issuer}") for i, att in enumerate(chain): if not att.signature_valid: raise TransitiveClosureViolation(f"link {i} signature invalid") if att.revoked: raise TransitiveClosureViolation(f"link {i} revoked") if not att.not_after_ok: raise TransitiveClosureViolation(f"link {i} expired") # 2. Transitive-closure gate (the part everyone forgets). effective_max_depth = root.max_depth effective_re_delegable = root.re_delegable parent_scope = root.scope for i, att in enumerate(chain): depth = i + 1 # this link sits at depth i+1 below the root warrant if not effective_re_delegable: raise TransitiveClosureViolation( f"link {i} ({att.issuer}->{att.subject}) violates " f"re_delegable=false at an ancestor" ) if depth > effective_max_depth: raise TransitiveClosureViolation( f"link {i} ({att.issuer}->{att.subject}) at depth {depth} " f"exceeds root max_depth {effective_max_depth}" ) if not att.scope.issubset(parent_scope): raise TransitiveClosureViolation( f"link {i} scope {set(att.scope)} not subset of parent " f"{set(parent_scope)} (authority amplification attempt)" ) # Attenuate: downstream policy can only tighten, never widen. if att.declared_max_depth is not None: effective_max_depth = min(effective_max_depth, att.declared_max_depth) effective_re_delegable = effective_re_delegable and att.re_delegable parent_scope = att.scope return True def accept_peer_credential( root: RootWarrant, chain: list[Attestation], trusted_root_issuers: set[str], ) -> None: try: evaluate_federated_credential(root, chain, trusted_root_issuers) except TransitiveClosureViolation as exc: # Distinct handling: this is a trust event, not a retryable error. # Do NOT downgrade to "insufficient scope"; flag the issuing peer. raise TransitiveClosureViolation( f"rejecting peer credential: {exc}. " f"Chain authentic but authority does not exist under " f"warrant policy v{root.policy_version}. " f"Treat presenting peer as potentially compromised." ) from exc ```