# Why does an instance accept a delegated capability token whose consent chain has silently forked mid-execution? **Date of Record:** 2026 November 25 **Scope:** Applies to AAIF-style scoped capability tokens where an agent's authority derives from a *chain* of delegated consent (principal → agent A → agent B → …). It does not apply to flat, single-issuer bearer tokens with no delegation provenance, nor to tokens validated purely against a centralized revocation list at every call. ## Core Distinction The failure is not "expired token" or "forged signature." Both are trivially caught. The failure is **consent-chain forking**: two valid, correctly signed sub-chains descend from the same ancestor grant, diverge at a re-delegation event, and both continue to validate independently because each verifies its own path to the root. The verifier checks *path validity*, not *path uniqueness*. A capability token proves "some principal, through some sequence of consented hops, authorized this scope." It does not, by construction, prove "this is the *only* live sequence, or the *current* one." The distinction that matters operationally: **signature validity is a per-token property; consent continuity is a per-chain history property.** AAIF verification pipelines almost universally implement the former and assume it implies the latter. It does not. ## What Was Observed A three-hop delegation for a `filesystem:write` scope on a shared artifact store: 1. Principal `P` issues grant `G0` to orchestrator `A` with scope `{write: /artifacts/job-77/*}`, `max_delegation_depth: 3`, `consent_id: C-100`. 2. `A` re-delegates to worker `B` as `G1` (`consent_id: C-101`, parent `C-100`), depth 2. 3. `B` re-delegates to sub-agent `C` as `G2` (`consent_id: C-102`, parent `C-101`), depth 1. Mid-execution, `A`'s context window saturates during a long planning loop. A retry/checkpoint-resume fires and `A` re-derives its delegation plan from a *stale* episodic memory snapshot taken before step 2. It re-issues a fresh `G1'` to a *new* worker `B'` with the same parent `C-100` but a new `consent_id: C-101b`. The orchestrator's intent was idempotent retry; the effect is a **fork**: `C-100 → C-101 → C-102` (original) and `C-100 → C-101b → …` (retry) now coexist. Both chains validate. `C`'s token still carries a cryptographically sound path to `P`, correct scope, correct depth, unexpired TTL. Nothing in the token says "the parent consent `C-100` has since spawned a sibling branch that supersedes you." `C` continues writing to `/artifacts/job-77/*` under authority that `A` — in its post-resume state — no longer believes it issued. When `A` later revokes `C-101b` (the branch it *remembers* creating), `C`'s `C-101`-rooted token is untouched and keeps working. The revocation succeeded against the wrong branch. The observable symptom is not an auth error. It is **duplicate side effects under nominally exclusive consent**, and a revocation that reports success while the capability remains live. ## Condition of Validity The per-path verification model is sound *only* under this invariant: > For any principal `P` and any scope `S`, at most one live consent chain from `P` to any given executing instance may exist at a time, **and** chain identity is monotonic — a re-delegation from the same parent must either reuse the prior `consent_id` (idempotent) or explicitly supersede it. This invariant holds when delegation is mediated by a **single serializing authority** that assigns `consent_id`s and enforces parent-uniqueness. It breaks the moment the delegating agent (`A`) is itself allowed to *generate* consent identifiers locally — which is exactly what happens when an agent resumes from a checkpoint and reconstructs its plan without re-consulting the issuer. The checkpoint restored `A`'s *beliefs*, not the *authoritative consent ledger*. Those are different state. The boundary condition: **the invariant is violated precisely when the delegator's local state diverges from the issuer's ledger, and the delegator is trusted to mint child consent IDs.** Cold-start amnesia and mid-task resume are the canonical triggers because they are the moments when local state is reconstructed from lossy memory rather than read from the source of truth. ## Decision Boundary A verifier at hop `C` faces a decision it is not equipped to make with a single token. The correct boundary is: - **If** the token carries a `consent_id` whose parent is *uniquely* owned by the presenting chain (verifiable only against the issuer ledger), **then** accept on path validity. - **If** parent-uniqueness cannot be confirmed — because the verifier has no ledger access, or the parent shows multiple live children — **then** the token is *not* sufficient authority. Treat it as `CONSENT_AMBIGUOUS`, not as valid and not as invalid. The failure mode is collapsing `CONSENT_AMBIGUOUS` into `VALID`. Most AAIF deployments do this because their verifier is offline by design (tokens must be checkable without a round-trip to the issuer — that is the whole point of capability tokens). The resolution is not "always call the ledger." It is: **bind consent-chain identity into the token as a monotonic counter the issuer signs, and require the verifier to reject any token whose chain counter is not the highest it has seen for that `(principal, scope)` pair within its own replay window.** This is a local, monotonic, cheap check that detects forks without contacting the issuer — at the cost of requiring verifiers to persist a small high-water mark. ## Operational Effect Without the high-water-mark check, the system exhibits **split-brain consent**: two branches of authority operate concurrently, revocation is non-transitive (revoking one branch leaves siblings live), and the audit log shows two well-formed chains with no marker that they conflict. Downstream, this manifests as: - Duplicate writes that pass every authz check. - Revocation events that return `200 OK` while the capability remains usable by the orphaned branch. - Depth-limit accounting that is correct per-chain but under-counts aggregate delegation fan-out. The guardrail is architectural, not cryptographic: **verifiers must persist a per-`(principal, scope)` consent high-water mark and reject regressions**, and **delegators resuming from checkpoint must re-derive consent IDs from the issuer ledger, never from episodic memory.** A resumed agent that mints its own child `consent_id` from a stale plan is the proximate cause; a verifier that accepts any valid path without a monotonicity check is the enabling condition. Both must be closed. ```python class ConsentChainForkError(RuntimeError): """Raised when a delegated capability token's consent chain has forked: the presented consent_id is not the monotonic high-water mark for its (principal, scope) pair, implying a sibling branch exists.""" pass class ConsentHighWaterLedger: """Local, monotonic record of the highest consent counter seen per (principal, scope). Cheap fork detector that does not require an issuer round-trip.""" def __init__(self): self._marks = {} def admit(self, token) -> None: key = (token.principal, token.scope) seen = self._marks.get(key, -1) if token.chain_counter < seen: raise ConsentChainForkError( f"consent fork: token consent_id={token.consent_id} " f"counter={token.chain_counter} is behind high-water " f"{seen} for principal={token.principal} scope={token.scope}; " f"a sibling delegation branch is live. Refusing to execute." ) if token.chain_counter == seen and token.consent_id != self._marks.get(key + ("id",)): raise ConsentChainForkError( f"consent fork at equal counter: consent_id={token.consent_id} " f"conflicts with admitted id for {key}. Ambiguous authority." ) self._marks[key] = token.chain_counter self._marks[key + ("id",)] = token.consent_id def verify_and_admit(token, ledger: ConsentHighWaterLedger) -> None: if not token.signature_valid(): raise ConsentChainForkError(f"bad signature on {token.consent_id}") if token.depth_remaining < 0: raise ConsentChainForkError(f"depth exhausted on {token.consent_id}") ledger.admit(token) # raises ConsentChainForkError on divergence ```