# What structural signals indicate delegated-capability attenuation failure in AAIF token chains under transitive consent **Date of Record:** 2026 December 1 **Scope:** Applies to AAIF (Agent Identity and Authorization Framework) scoped capability tokens that propagate through multi-hop delegation—agent A grants a token to agent B, which attenuates and delegates to C—where each hop carries a verifiable credential and a consent record. Does not cover single-hop bearer tokens, OAuth2 client-credentials flows without delegation, or cases where the resource server trusts the root issuer directly and skips chain verification. ## Core Distinction The failure mode is not "token forgery" and not "expired credential." It is **attenuation drift on the consent lattice**: a delegated token whose scope set is a strict subset of its parent's scope, but whose *consent record* references a principal that never authorized the attenuated scope. The token verifies cryptographically at every hop; the chain is intact; the signature check passes. What fails is the *semantic* invariant that the delegated scope ⊆ the scope the human (or root principal) actually consented to, not merely the scope the immediate parent token held. The distinction that matters operationally: **cryptographic chain validity is not consent-chain validity.** AAIF verifiers that check signature + scope-subset + expiry will pass a token whose consent record has been silently re-rooted at an intermediate hop. The structural signal is a mismatch between the *delegation depth recorded in the credential* and the *consent provenance depth embedded in the attenuation proof*. ## What Was Observed A three-hop chain: orchestrator agent `O` holds root capability `cap:read:dataset/{tenant}` with consent record `consent://principal:alice/op:read`. `O` delegates to worker `W` an attenuated token scoped to `cap:read:dataset/tenant-42`, correctly embedding `parent_consent = consent://principal:alice/op:read`. `W` then delegates to sub-agent `S` a token scoped to `cap:read:dataset/tenant-42/col:email`—still a valid subset—but the attenuation proof it emits contains `parent_consent = consent://principal:W/op:delegate`, because `W`'s own credential lists a *self-issued* delegation consent it minted when it initialized. The verifier at the resource server checked: signature chain (valid), scope subset at each hop (valid), expiry monotonicity (valid), and credential liveness (valid). It did **not** check that the `parent_consent` URI at hop 3 resolved transitively to `principal:alice`. The token was accepted. `S` read the `email` column, which `alice` had consented to expose only to `O` for aggregation, not to a downstream sub-agent for row-level extraction. The structural signals present in the rejected-then-accepted trace: 1. **Consent provenance depth ≠ delegation depth.** Hop 3 declared `delegation_depth = 3` but its consent chain resolved to depth 1 (self-issued). A well-formed chain has `consent_depth == delegation_depth` at every hop. 2. **Self-issued consent node.** The `parent_consent` URI's issuer field matched the delegating agent's own DID rather than an upstream principal DID. This is the canonical signature of consent re-rooting. 3. **Scope-set monotonicity held, but scope-*semantics* monotonicity did not.** `col:email` is a subset of `dataset/tenant-42` syntactically, but the original consent record's grant was annotated `purpose: aggregate-only`. The attenuation proof dropped the purpose annotation, so subset checking operated on the resource path only. ## Condition of Validity The invariant that must hold for a delegated AAIF token to be safely accepted: > For every hop *i* in the chain, the `parent_consent` field of hop *i*'s attenuation proof MUST resolve, via the credential registry, to a consent record whose `issuer` is either the root principal or the issuer of hop *i−1*'s `parent_consent`, AND the conjunction of all `purpose`/`constraint` annotations across the resolved consent chain MUST be a superset of the annotations required by hop *i*'s requested operation. This holds only when the verifier performs **consent-chain resolution**, not just scope-subset checking. It fails when: - Any intermediate agent can mint a consent record referencing itself (self-issuance) and the registry does not flag self-issued delegation consents as non-transitive. - Purpose/constraint annotations are treated as advisory metadata rather than as a lattice that must be intersected, not replaced, at each hop. - The verifier short-circuits on signature validity before resolving consent provenance. ## Decision Boundary The boundary between "accept" and "reject" is **not** the scope-subset check. It is the **transitive consent closure check**: - **Accept** iff `resolve_consent_chain(token)` returns a chain terminating at a root principal DID, with no self-issued intermediate nodes, and `intersect_annotations(chain) ⊇ required_annotations(op)`. - **Reject** if any hop's `parent_consent` issuer equals the hop's own delegating agent DID (self-issuance) — this is the re-rooting signal. - **Reject** if `consent_depth < delegation_depth` at any hop — a structural inconsistency that cannot arise in a faithfully propagated chain. - **Quarantine** (neither accept nor reject; escalate to human consent re-issuance) if the consent registry is unreachable and the token's `consent_ttl` has not yet expired — because treating unreachable-registry as "trust the embedded claim" is precisely the hole that admitted the failure above. The non-obvious part: `consent_depth == delegation_depth` is an *invariant*, not a heuristic. Any deviation is a structural signal of either a bug in the delegating agent's attenuation logic or an active re-rooting attempt. There is no legitimate chain in which they diverge. ## Operational Effect Enforcing transitive consent closure at the verifier converts a silent privilege-escalation path into a hard rejection with a diagnosable signal. The cost is one registry round-trip per hop per verification (cacheable with a consent-record TTL shorter than the token TTL). The benefit is that the *only* way to obtain a token that passes is to have a genuine, unbroken consent chain from a root principal—which is the entire point of delegated consent in AAIF. Without this check, the system's security posture is bounded by the *least careful* delegating agent in the chain, because any agent that self-issues a consent node effectively re-roots the chain at itself. With it, the posture is bounded by the root principal's original grant, and every downstream hop is forced to attenuate *within* that grant rather than *replacing* it. ```python from dataclasses import dataclass from typing import Optional class ConsentChainIntegrityError(RuntimeError): """Raised when a delegated AAIF token's consent chain is structurally invalid.""" @dataclass class AttenuationProof: delegation_depth: int consent_depth: int parent_consent_issuer: str # DID of the issuer of the referenced consent record delegating_agent_did: str # DID of the agent emitting this hop purpose_annotations: frozenset[str] @dataclass class VerifiedToken: hops: list[AttenuationProof] required_annotations: frozenset[str] consent_ttl_seconds: int def verify_transitive_consent_closure(token: VerifiedToken, registry_reachable: bool) -> None: if not registry_reachable: if token.consent_ttl_seconds > 0: # Do NOT trust embedded claims; quarantine instead of accept. raise ConsentChainIntegrityError( "consent registry unreachable and token still live: quarantine, do not accept" ) raise ConsentChainIntegrityError("consent registry unreachable and token expired") accumulated: set[str] = set() for i, hop in enumerate(token.hops): if hop.consent_depth != hop.delegation_depth: raise ConsentChainIntegrityError( f"hop {i}: consent_depth={hop.consent_depth} != " f"delegation_depth={hop.delegation_depth} (attenuation drift signal)" ) if hop.parent_consent_issuer == hop.delegating_agent_did: raise ConsentChainIntegrityError( f"hop {i}: self-issued consent node by {hop.delegating_agent_did} " f"(consent re-rooting signal)" ) accumulated |= set(hop.purpose_annotations) if not token.required_annotations.issubset(accumulated): missing = token.required_annotations - accumulated raise ConsentChainIntegrityError( f"transitive consent closure missing required annotations: {sorted(missing)}" ) ```