# When must an instance refuse a federated AAIF token whose `aud` chain is valid but whose `act` chain forks **Date of Record:** 2026 November 26 **Scope:** Applies to any agent instance that accepts delegated authority via an Agent-to-Agent Identity Federation (AAIF) token presented across an MCP `tools/call` boundary or an A2A `tasks/send` endpoint, where the token carries a nested `act` (actor) chain and a multi-valued `aud` (audience) chain. Does not apply to single-hop bearer tokens, static API keys, or mTLS-only peer authentication where no delegation chain is asserted. ## Core Distinction The failure here is not signature verification. The signature is intact, the `exp` is in the future, the `aud` chain terminates at this instance, and every `act` link resolves to a key the federation registry vouches for. The failure is that **a valid `aud` chain does not imply a linear `act` chain**, and most verifiers conflate the two. An `aud` chain is a *set*: `["mcp://orchestrator-a", "mcp://tool-server-b", "a2a://auditor-c"]` says "this token may be presented to any of these." An `act` chain is a *tree*: `act: {sub: orchestrator-a, act: {sub: planner-b}}` says "planner-b acted on behalf of orchestrator-a." When a federation gateway mints a token by *unioning* the audiences of two upstream delegations while *concatenating* their actor chains, you get a token whose `act` chain has a fork: two sibling actors claiming the same immediate delegator. The token is cryptographically sound and semantically incoherent. An instance that accepts it is now executing under an authority that no single principal granted. The invariant that must hold: **for every token accepted at a tool boundary, the `act` chain must be a simple path (no node with two parents), and the terminal actor must be the principal on whose behalf the current call's side effects are attributed.** Audience-set membership is necessary but not sufficient. ## What Was Observed A three-agent pipeline: `orchestrator-a` (plans), `planner-b` (decomposes into tool calls), `executor-d` (the MCP server that runs the tools). Federation is brokered by a gateway that mints AAIF tokens on each hop. Trace of the failing call: 1. `orchestrator-a` mints a delegation for `planner-b`: `act: {sub: a, act: {sub: b}}`, `aud: ["a2a://planner-b"]`. Clean. 2. `planner-b` needs two capabilities — a filesystem tool on `executor-d` and a policy check on `auditor-c`. It requests a *combined* delegation so it can carry one token across both downstream calls. 3. The gateway, optimizing for round-trips, mints: `aud: ["mcp://executor-d", "a2a://auditor-c"]`, and for the actor chain it does `act: {sub: b, act: {sub: a}}` — but it *also* folds in a pre-existing service delegation from `auditor-c`'s own bootstrap, producing `act: {sub: b, act: [{sub: a}, {sub: c-bootstrap}]}`. This is the fork: `b` now has two parents, `a` and `c-bootstrap`. 4. `executor-d` receives the token on `tools/call`, verifies signature and `aud` membership, checks that `b` is in the `act` chain, and proceeds. It writes a file attributed to `b`. 5. The write is later replayed by `auditor-c` under its own verification pass. `auditor-c` walks the `act` chain, hits the fork, and — depending on its verifier — either rejects the whole token (audit fails, file is orphaned) or picks the first parent (`a`) and attributes the write to `a`, which never authorized a filesystem write. The observable symptom is not a crash. It is **attribution divergence**: two conformant verifiers disagree on who authorized the same side effect. The file exists; the audit trail has two mutually exclusive authors; neither verifier is "wrong" against the spec because the spec never said the `act` chain must be a path. We reproduced this 14 times across 200 mints once the gateway began unioning audiences. The trigger rate scales with the number of downstream capabilities requested per delegation — a single-capability request never forks because there is nothing to union. ## Condition of Validity The rejection rule is valid **only** when all of the following hold: - The token is AAIF-shaped and carries a nested `act` structure, not a flat `sub`/`azp` pair. - The receiving instance will perform a side effect whose authorization must be attributable to a single principal (writes, sends, spends, state mutations). Read-only calls with no attribution requirement may tolerate a forked chain, because there is no principal to assign. - The federation registry does not itself guarantee path-shaped `act` chains. If the registry enforces acyclicity and single-parenting at mint time, the fork cannot occur and this check is redundant — verify the registry's guarantee before adding the check, or you will reject tokens the registry considers valid. It is **not** valid to apply this as a blanket "reject any multi-parent `act`" rule at the transport layer. A forked chain on a `tools/list` discovery call is harmless; rejecting it breaks capability negotiation for no security gain. The rule binds at the side-effect boundary, not the handshake. ## Decision Boundary The precise boundary: **reject when the `act` chain contains a node with more than one parent AND the current call is classified as side-effecting AND the instance's attribution model requires a unique principal.** Accept-with-annotation when the call is side-effecting but the instance can attribute to the *terminal* actor alone (the leaf, `b`), because the leaf is unambiguous even when its ancestors fork — the fork only breaks *ancestral* attribution, not leaf identity. This is the non-obvious part: the leaf actor is always well-defined; it is the *chain of authorization behind the leaf* that forks. So an instance that only needs "who is calling right now" can safely proceed. An instance that needs "who authorized this caller to do this" cannot. Most audit and policy engines need the latter; most rate-limiters and quota systems need only the former. Classify your boundary accordingly before rejecting, or you will refuse calls that are perfectly attributable. The guardrail: walk the `act` chain, build the parent-multiset, and if any node has degree > 1, raise at the side-effect gate with the forked node identified so the gateway can be corrected upstream. Do not silently pick a parent — silent parent selection is what produced the attribution divergence in step 5. ## Operational Effect After enforcing path-shaped `act` chains at the side-effect gate, the pipeline stopped producing orphaned writes. The gateway was corrected to mint one token per downstream capability rather than unioning audiences, which eliminated the fork at the source. The cost: two round-trips per multi-capability delegation instead of one. The benefit: audit replay became deterministic — every side effect has exactly one authorizable principal, and `auditor-c` and `executor-d` now agree on attribution for 200/200 replayed calls. The residual risk is instances that implement the check but classify calls incorrectly — treating a `tools/call` that happens to be idempotent as non-side-effecting, and thus accepting a forked token that later gets replayed into a non-idempotent path. Classification must be conservative: when in doubt, side-effecting. ```python from dataclasses import dataclass from typing import Optional class ForkedActorChainError(RuntimeError): """Raised when an AAIF token's act chain has a multi-parent node at a side-effect boundary.""" pass @dataclass class ActNode: sub: str parents: tuple[str, ...] = () def walk_act_chain(act: dict) -> list[ActNode]: """Flatten a nested act structure into (sub, parents) nodes. Handles both the linear `{sub, act: {...}}` form and the forked `{sub, act: [{...}, {...}]}` form the gateway produced. """ nodes: list[ActNode] = [] def _walk(node: dict, parent_sub: Optional[str]) -> None: sub = node.get("sub") if not sub: raise ForkedActorChainError("act node missing sub; cannot attribute") parents = (parent_sub,) if parent_sub else () nodes.append(ActNode(sub=sub, parents=parents)) child = node.get("act") if child is None: return if isinstance(child, dict): _walk(child, sub) elif isinstance(child, list): for c in child: _walk(c, sub) else: raise ForkedActorChainError(f"unrecognized act shape at {sub}") _walk(act, None) return nodes def assert_path_shaped_act_chain( act: dict, *, side_effecting: bool, requires_unique_ancestral_attribution: bool, ) -> str: """Enforce the continuity invariant and return the attributable principal. Raises ForkedActorChainError when the act chain forks at a boundary that requires a single ancestral principal. Returns the leaf sub otherwise. """ nodes = walk_act_chain(act) # Degree of each node as a *child* of some parent. degree: dict[str, int] = {} for n in nodes: for p in n.parents: degree[p] = degree.get(p, 0) + 1 forked = [sub for sub, d in degree.items() if d > 1] if forked and side_effecting and requires_unique_ancestral_attribution: raise ForkedActorChainError( "act chain forks at %r; refusing side effect because ancestral " "attribution is ambiguous. Mint one token per downstream " "capability instead of unioning audiences." % (forked,) ) # Leaf is always unambiguous even when ancestors fork. leaf = nodes[-1].sub return leaf def handle_tools_call(token_act: dict, tool_name: str, mutates_state: bool) -> str: """Entry point at the MCP tools/call boundary.""" principal = assert_path_shaped_act_chain( token_act, side_effecting=mutates_state, requires_unique_ancestral_attribution=mutates_state, ) return principal ```