# Why does an instance fail AAIF-scoped credential exchange when delegated capability tokens outlive their warrant chain **Date of Record:** 2026 November 24 **Scope:** Applies to agent-to-agent delegation flows where an issuing instance mints a least-privilege capability token scoped by an AAIF (Agent Authority & Identity Framework) warrant, and a downstream instance redeems it on behalf of the originating principal. Does not apply to single-hop tokens minted and consumed within one instance's own trust boundary, nor to long-lived service credentials not derived from a warrant. ## Core Distinction The failure is not token forgery, signature invalidity, or scope escalation in the classic OAuth sense. It is a **warrant-chain continuity break**: the capability token remains cryptographically valid and within its declared scope, but the *delegation warrant* that authorized minting it has been narrowed, revoked, or expired in a way the token does not encode. The redeeming instance holds a token that is simultaneously "valid" and "no longer authorized," and the AAIF exchange protocol has no field to distinguish the two. The distinction that matters operationally: **token validity is a property of the token; authorization is a property of the chain that produced it.** AAIF-scoped exchange collapses these into a single bearer check at redemption time. Every failure below is a consequence of that collapse. ## What Was Observed A triage agent (`A1`, principal-scoped) delegated a remediation subtask to an executor agent (`A2`). `A1` held a warrant `W1` from the principal granting `remediate:restart_service` scoped to `service=payments-*`, valid 30 minutes. `A1` minted capability token `T1` for `A2` with scope `remediate:restart_service` and `service=payments-api`, TTL 25 minutes, and embedded `warrant_id=W1` plus a `warrant_digest` (hash of `W1`'s claims at mint time). Six minutes in, the principal narrowed `W1` to `service=payments-api-readonly` via a warrant amendment (a new warrant `W1'` superseding `W1`, same `warrant_id`, incremented `version`). The amendment propagated to `A1` and to the AAIF warrant registry. It did **not** propagate to `A2`, which was mid-execution and holding `T1`. `A2` continued. At minute 9 it called `restart_service("payments-api")`. The resource server validated `T1`: signature valid, `warrant_digest` matched the digest `A2` presented, scope string `payments-api` matched the requested resource, TTL unexpired. **The restart executed.** The principal's narrowing took effect at minute 6; the unauthorized action occurred at minute 9, three minutes *after* revocation, under a token the registry would have refused to mint but could not refuse to honor. A second observation, same flow, different trigger: when `A2` retried a failed call at minute 24 (still inside `T1`'s 25-minute TTL but after `W1`'s 30-minute clock had been consumed by `A1`'s own setup latency plus a 4-minute queue wait), the resource server's warrant-digest check passed because it compared `T1`'s embedded digest against a *cached* copy of `W1`, not against the registry's current head. The registry head was `W1'` (narrowed) and `W1` was tombstoned. The digest matched the tombstone, not the head. The call was admitted. The pattern: **AAIF exchange validates the token against the warrant it was minted under, not against the warrant that currently governs the principal's authority.** Nothing in the redemption path re-resolves the chain to its live head. ## Condition of Validity The invariant AAIF-scoped exchange *assumes* is: > A capability token is authorized at redemption time iff its embedded `warrant_digest` matches the digest of the warrant version that was current at mint time, and that warrant version was not revoked before the token's `mint_time`. This is a **monotonic-validity assumption**: it presumes warrant authority only ever narrows by *supersession of future tokens*, never by *retroactive invalidation of already-minted tokens*. The assumption holds only when the following three conditions are simultaneously true: 1. **Amendment latency < token redemption latency.** If every warrant amendment reaches every resource server before any token minted under the prior version can be redeemed, the window is closed. In practice amendment propagation is bounded by registry replication lag (observed 2–40s), while tokens are redeemed with sub-second latency and, critically, *tokens already in flight* are not recalled. The condition fails for any token whose TTL exceeds the amendment-propagation-to-redeemer path, which is almost always. 2. **No long-lived in-flight tokens.** The assumption requires that narrowing a warrant cannot strand a live token. Any delegation with `token_ttl > 0` violates this by construction. Delegation *is* the act of creating a stranded token. 3. **Digest check resolves to live head, not mint-time snapshot.** This is the load-bearing condition and the one AAIF exchange does not enforce. A digest check against a cached or embedded copy is a *historical* check; authorization requires a *current* check. The boundary is therefore: **AAIF-scoped exchange is sound only for zero-delegation, zero-TTL flows.** For any real delegation, the warrant chain and the token diverge, and the divergence is invisible to the redeemer. ## Decision Boundary The redeeming instance must decide, at each tool call, whether to trust its token or re-resolve the chain. The decision boundary is not "is my token valid" (it almost always is) but **"has the warrant that grounds my token changed since I last checked, and can I afford the re-resolution latency."** Concrete boundary rule: - If `now - last_chain_resolution > amendment_propagation_bound`, the instance **must** re-resolve `warrant_id` to registry head before the next privileged call. `amendment_propagation_bound` is the registry's published p99 replication lag plus clock skew margin, not a guess. - If re-resolution is unavailable (registry unreachable, latency budget exhausted), the instance **must fail closed** on privileged scopes and may continue only on scopes whose warrant version is provably unchanged (head digest equals mint-time digest *fetched fresh*). - The resource server, independently, must reject any token whose `warrant_digest` does not equal the registry head digest for that `warrant_id` **at redemption time**, not at mint time. This is the guardrail that bounds the failure: it converts "silently honored stale token" into "explicit `WarrantChainBroken` rejection," which the agent can observe and handle. The boundary is sharp because the two failure modes are asymmetric: honoring a stale token produces an *unauthorized action with a valid signature* (undetectable downstream), while rejecting a fresh token produces a *retryable error* (recoverable). The decision boundary must always resolve toward the retryable error. ## Operational Effect When the invariant is violated, three effects propagate: 1. **Revocation is advisory, not enforcing.** The principal believes narrowing `W1` stopped `payments-api` remediation. It did not; it only stopped *new* tokens. Every in-flight `T1`-class token remains a live authorization until its own TTL expires. The effective revocation latency is `max(token_ttl)` across all outstanding delegations, not the amendment latency. An agent swarm that delegates aggressively has an effective revocation window measured in minutes to hours, invisible to the principal. 2. **Audit divergence.** The resource server's audit log records a valid token and a matching digest — a clean authorization. The warrant registry records a narrowed warrant at minute 6. Reconciling the two requires a join on `warrant_id` + `version` + `mint_time` that no single system performs. Post-hoc forensics see an authorized action; the principal's intent says otherwise. The gap is structural, not a logging bug. 3. **Replay of the stale window.** Because `T1`'s digest matches the tombstoned `W1`, an instance that caches the tombstone can re-present the digest indefinitely within TTL. The tombstone is a *valid* digest target under the historical check. This makes the stale window replayable, not just live — a compromised `A2` can re-issue the restart at minute 24 with the same evidence. The guardrail that bounds all three: **resolve to live head at redemption, fail closed on mismatch, and make `warrant_version` a first-class field in the token that the resource server checks against registry head rather than against the token's own embedded digest.** The token must carry *which version it claims*, and the server must verify *that version is current*, not merely *that the version existed*. ```python import hashlib import time from dataclasses import dataclass, field class WarrantChainBroken(RuntimeError): """Raised when a capability token's grounding warrant is no longer the registry head at redemption time. The token is cryptographically valid but no longer authorized; the caller must fail closed.""" class StaleChainResolution(RuntimeError): """Raised when the redeeming instance has not re-resolved the warrant chain within the amendment-propagation bound and cannot prove freshness.""" @dataclass class Warrant: warrant_id: str version: int claims: dict revoked: bool = False def digest(self) -> str: payload = f"{self.warrant_id}:{self.version}:{sorted(self.claims.items())}" return hashlib.sha256(payload.encode()).hexdigest() @dataclass class CapabilityToken: token_id: str warrant_id: str warrant_version_at_mint: int warrant_digest_at_mint: str scope: str resource: str mint_time: float ttl: float @dataclass class WarrantRegistry: heads: dict = field(default_factory=dict) # warrant_id -> current Warrant def head(self, warrant_id: str) -> Warrant: return self.heads[warrant_id] def amend(self, warrant_id: str, new_claims: dict) -> None: old = self.heads[warrant_id] self.heads[warrant_id] = Warrant( warrant_id=warrant_id, version=old.version + 1, claims=new_claims, ) AMENDMENT_PROPAGATION_BOUND = 45.0 # seconds, p99 registry replication + skew def redeem( token: CapabilityToken, requested_scope: str, requested_resource: str, registry: WarrantRegistry, last_chain_resolution: float, now: float | None = None, ) -> bool: now = now if now is not None else time.time() # TTL is necessary but never sufficient. if now > token.mint_time + token.ttl: raise WarrantChainBroken( f"token {token.token_id} expired at {token.mint_time + token.ttl:.0f}" ) # Scope match is necessary but never sufficient. if token.scope != requested_scope or token.resource != requested_resource: raise WarrantChainBroken( f"token {token.token_id} scope {token.scope}:{token.resource} " f"does not cover {requested_scope}:{requested_resource}" ) # Freshness gate: refuse to trust a chain we have not re-resolved recently. if now - last_chain_resolution > AMENDMENT_PROPAGATION_BOUND: raise StaleChainResolution( f"chain last resolved {now - last_chain_resolution:.0f}s ago, " f"bound is {AMENDMENT_PROPAGATION_BOUND:.0f}s; fail closed" ) head = registry.head(token.warrant_id) # The load-bearing check: digest against LIVE HEAD, not mint-time snapshot. if head.digest() != token.warrant_digest_at_mint: raise WarrantChainBroken( f"token {token.token_id} grounded in {token.warrant_id} v" f"{token.warrant_version_at_mint} (digest {token.warrant_digest_at_mint[:12]}), " f"but registry head is v{head.version} (digest {head.digest()[:12]}); " f"warrant chain diverged — token is valid but unauthorized" ) if head.revoked: raise WarrantChainBroken( f"warrant {token.warrant_id} v{head.version} is revoked" ) return True def demo() -> None: reg = WarrantRegistry() w1 = Warrant("W1", 1, {"scope": "remediate:restart_service", "service": "payments-*"}) reg.heads["W1"] = w1 mint = time.time() tok = CapabilityToken( token_id="T1", warrant_id="W1", warrant_version_at_mint=1, warrant_digest_at_mint=w1.digest(), scope="remediate:restart_service", resource="payments-api", mint_time=mint, ttl=1500.0, ) # Principal narrows the warrant at t+360s. reg.amend("W1", {"scope": "remediate:restart_service", "service": "payments-api-readonly"}) # A2 redeems at t+540s with a fresh chain resolution. Must fail closed. redeem( tok, requested_scope="remediate:restart_service", requested_resource="payments-api", registry=reg, last_chain_resolution=mint + 540.0, now=mint + 540.0, ) if __name__ == "__main__": demo() ```