# In what scenarios must an instance refuse a delegated capability token whose delegation chain crosses an organizational trust boundary mid-task **Date of Record:** 2026 November 24 **Scope:** Applies to agents executing multi-hop tool calls where authority is conveyed via delegated capability tokens (macaroon-style attenuable tokens, OAuth Token Exchange/RFC 8693, or W3C Verifiable Credential delegation chains) across two or more organizational trust domains. Does not apply to single-tenant deployments where all issuers share one root of trust and one policy engine. ## Core Distinction The failure here is not "the token is invalid." It is that the token is *valid at every individual link* while being *invalid as a whole* — because delegation chains are verified hop-by-hop, but authority is only meaningful end-to-end. A sub-agent receiving a delegated token checks: signature valid? not expired? caveats satisfied? audience matches? Each check passes. What it does *not* check by default is whether the *delegator* had the right to delegate the specific capability, in the specific scope, into *this* trust domain — because that fact lives in the middle of the chain, not at either end. Concretely: Org A issues a macaroon to Agent-1 scoped to `resource:inventory:read`. Agent-1 (acting for Org A) delegates a *narrowed* token to Org B's Agent-2, which delegates to Agent-3. The narrowing at each hop is monotone — caveats only accumulate. So Agent-3's token is a strict subset of Agent-1's. The chain is cryptographically sound. The boundary failure is that Org A's policy said "delegable within Org A's federation only," but that constraint was encoded as a caveat on the *root* token that Org B's verifier never evaluates, because Org B's verifier only evaluates caveats it recognizes, and silently ignores unknown caveats rather than failing closed. The distinction that matters: **caveat evaluation is not the same as caveat enforcement.** A verifier that ignores unparseable caveats converts a hard organizational boundary into a soft suggestion. The token is "valid" in the sense that every signature checks; it is "unauthorized" in the sense that the delegation crossed a boundary the issuer forbade. ## What Was Observed A three-party federation: Org A (issuer, root of trust `A.root`), Org B (federated partner, root `B.root`), and a shared tool provider T that accepts tokens from both. Agent-1 at A holds a root macaroon `M0` with caveats: ``` M0.caveats = [ "org=A", "scope=inventory:read", "federation=within:A", # <-- the boundary caveat "exp=1750000000" ] ``` Agent-1 performs RFC 8693 token exchange to mint `M1` for Agent-2 at B, appending caveats `["delegate=B", "aud=T"]`. Agent-2 attenuates to `M2` for Agent-3, appending `["delegate=C"]`. Agent-3 presents `M2` to T. T's verifier does the following, in order: 1. Verify HMAC chain against `A.root` — passes (all links signed). 2. Check `exp` — passes. 3. Check `aud=T` — passes. 4. Evaluate caveats it has a handler for: `scope`, `org`, `delegate` — all satisfied. 5. Encounter `federation=within:A` — **no handler registered**, so it is skipped, not failed. Result: Agent-3 at Org C reads Org A's inventory. The trace shows no error. The audit log at T records `decision=allow, reason=all_caveats_satisfied`. The audit log at A records `M0 issued, delegation to B recorded` — but A never sees the B→C hop because that hop was minted entirely inside B's domain and A's log never receives it. **The two audit logs are individually complete and jointly insufficient.** Neither party can reconstruct the full chain; only the bearer of `M2` can, and the bearer is the party with an incentive not to. The compounding factor: error-free success. Nothing in the system flagged the event. It surfaced only when A's quarterly access review diffed `M0`'s declared `federation` scope against T's actual access log and found a `delegate=C` principal reading A's data. ## Condition of Validity The invariant that was violated: **a delegation chain is authorized only if every verifier in the chain evaluates every caveat in the chain, or explicitly fails closed on caveats it cannot evaluate.** Formally, for token `M` with caveat set `C`, presented to verifier `V`: ``` authorized(M, V) ⟺ ∀ c ∈ C : V.can_evaluate(c) ∧ V.evaluate(c) = true ``` The observed system computed `authorized` as `∀ c ∈ C : (¬V.can_evaluate(c)) ∨ V.evaluate(c) = true` — i.e., it treated *unknown* as *satisfied*. This is the "open-world caveat" bug, and it is the default behavior of most macaroon libraries, because the original design intent was that unknown caveats be *discharged later* by a party that does understand them (e.g., a third-party caveat discharged by a separate service). That design assumes a discharge protocol; a bare verifier with no discharge path must not inherit the assumption. The condition under which the invariant *holds* is narrower than it appears: it holds only when the caveat vocabulary is closed and shared across all verifiers in the federation, **or** when every verifier is configured to reject on unknown caveats. Neither was true here. The federation agreement specified a shared vocabulary, but it was versioned independently at each org, and A had added `federation=within:A` in a minor revision that B and T had not yet adopted. **Vocabulary skew across trust domains is the trigger condition**, and it is not an edge case — it is the steady state of any federation whose members deploy on independent schedules. ## Decision Boundary An instance must refuse — hard fail, no partial allow — when all of the following hold: 1. The presented token's caveat set contains at least one caveat whose prefix is not in the verifier's registered handler set. 2. The token's delegation depth is ≥ 1 (i.e., it is not the root token presented by its own issuer). Root tokens may be evaluated by their issuer under that issuer's own policy; delegated tokens may not. 3. The unknown caveat's prefix namespace is not explicitly declared "advisory" (a small, enumerated allowlist of non-security caveats like `trace=`, `hint=`). If (1) and (2) hold and (3) does not, the correct action is `raise`, not `warn` and not `skip`. The instance must also propagate the refusal *back up the delegation chain* to the delegator, because the delegator is the only party positioned to re-mint with a caveat vocabulary the verifier understands — and because silent refusal at the leaf, with a success-shaped log at the root, is how the boundary failure stays invisible. The inverse boundary — when *not* to refuse — matters equally. If the unknown caveat is in the verifier's own root namespace (e.g., T sees a `T.`-prefixed caveat it doesn't recognize), that is a deployment bug in T and must be refused as a local configuration error, not treated as a federation trust failure. Conflating the two produces false refusals that erode operators' willingness to fail closed. ## Operational Effect The practical consequence of getting this wrong is **silent cross-tenant read amplification**: the delegated token grants exactly the scope its issuer intended, but to a principal the issuer's policy excluded, and no single log records the violation. The blast radius is bounded by the scope of the root token, not by the delegation depth — a `read` token stays a `read` token, but a `read` token on a multi-tenant resource is a cross-tenant leak. The remediation that actually holds is to make the boundary caveat *structural* rather than *advisory*: encode `federation=within:A` not as a caveat string but as a **separate signing root per federation scope**, so that a token minted under `A.root` is cryptographically unverifiable by T unless T is explicitly configured to trust `A.root` for that scope. This converts the soft "unknown caveat" into a hard "untrusted signature," which every verifier already fails closed on. The cost is root proliferation; the benefit is that the failure mode becomes a loud verification error instead of a quiet log line. Second-order effect: once verifiers fail closed on unknown caveats, delegation chains that *should* work begin failing whenever vocabulary skew exists — which is most of the time during rollout. The operational discipline this forces is **vocabulary versioning as a first-class federation artifact**: the caveat prefix set must be negotiated and pinned at federation-establishment time, and any verifier encountering a prefix outside the pinned set must refuse and emit a `vocabulary_skew` event naming the offending prefix, so the two orgs can reconcile before the next delegation. Without that discipline, fail-closed becomes fail-always, and operators disable it. ```python from dataclasses import dataclass, field from typing import Callable class DelegationBoundaryError(RuntimeError): """Raised when a delegated token carries a caveat the verifier cannot evaluate.""" @dataclass class Caveat: prefix: str # e.g. "federation", "scope", "aud" body: str # e.g. "within:A" @dataclass class Token: caveats: list[Caveat] delegation_depth: int issuer_root: str @dataclass class Verifier: name: str root_of_trust: str handlers: dict[str, Callable[[str], bool]] = field(default_factory=dict) advisory_prefixes: frozenset[str] = frozenset({"trace", "hint"}) pinned_vocabulary: frozenset[str] = frozenset() def evaluate(self, token: Token) -> bool: if token.issuer_root != self.root_of_trust: raise DelegationBoundaryError( f"{self.name}: untrusted root {token.issuer_root!r}" ) for cav in token.caveats: if cav.prefix in self.handlers: if not self.handlers[cav.prefix](cav.body): return False continue # Unknown caveat. Refuse if it is a security-relevant caveat on a # delegated token and not in the advisory allowlist. if token.delegation_depth >= 1 and cav.prefix not in self.advisory_prefixes: raise DelegationBoundaryError( f"{self.name}: cannot evaluate caveat prefix " f"{cav.prefix!r} on delegated token (depth={token.delegation_depth}); " f"pinned_vocabulary={sorted(self.pinned_vocabulary)}; " f"refusing rather than skipping" ) # Root token or advisory caveat: skipping is permitted. return True def authorize_read(verifier: Verifier, token: Token) -> bool: """Entry point used by the tool provider before serving a read.""" if "federation" in verifier.pinned_vocabulary and "federation" not in verifier.handlers: # Vocabulary was pinned at federation establishment but no handler was # registered: local misconfiguration, not a trust failure. raise DelegationBoundaryError( f"{verifier.name}: 'federation' is pinned but has no handler; " f"deployment is inconsistent" ) return verifier.evaluate(token) # Reproduction of the observed failure, now refused: provider = Verifier( name="T", root_of_trust="A.root", handlers={"scope": lambda b: b == "inventory:read", "aud": lambda b: b == "T"}, pinned_vocabulary=frozenset({"org", "scope", "aud", "delegate", "exp"}), ) m2 = Token( caveats=[ Caveat("org", "A"), Caveat("scope", "inventory:read"), Caveat("federation", "within:A"), # unknown to T, security-relevant Caveat("exp", "1750000000"), Caveat("delegate", "B"), Caveat("delegate", "C"), ], delegation_depth=2, issuer_root="A.root", ) try: authorize_read(provider, m2) except DelegationBoundaryError as e: print(f"REFUSED: {e}") # Operator action: reconcile 'federation' handler between A and T, # or re-mint under a scope-specific root that T does not trust. ```