# Which invariants prevent unsound attenuation in agent-to-agent capability delegation chains with macaroons and revocation propagation **Date of Record:** 2026 November 16 **Scope:** Applies to multi-agent systems where an agent (the *delegator*) mints or attenuates a macaroon and hands it to a downstream agent (the *delegate*) that will present it to a resource server, and where revocation is propagated via a caveat-checking endpoint or a revocation list. Does not apply to single-hop bearer tokens, to capabilities where the delegate is trusted to fully re-mint from an authority key, or to systems where revocation is synchronous and inline with every request. ## Core Distinction There are two different things an agent delegation chain can mean by "attenuation": 1. **Restriction of authority** — the new macaroon can only ever authorize a subset of the actions the parent could authorize. This is a property of the *caveat set*: every caveat on the parent is present on the child, plus zero or more new caveats. 2. **Restriction of the presented credential** — the child token, when verified, satisfies a subset of the *verification contexts* the parent satisfies. This is a property of the *verifier and the caveat predicates*, not of the token bytes. The invariant that most agent frameworks assume — and that is *not* guaranteed by RFC-style macaroon construction alone — is that (1) implies (2). It does not. The gap is where delegation chains fail silently: a delegate can hold a macaroon that is a strict byte-level attenuation of the parent, and yet exercise authority the parent's caveats were meant to forbid, because a caveat predicate was interpreted differently by a downstream verifier, or because a revocation caveat was satisfied at mint time and never re-checked. ## What Was Observed In a three-hop chain (orchestrator → planner → executor → tool server), the orchestrator minted a root macaroon with caveats `agent_id = orchestrator`, `scope = read`, and a third-party caveat binding a revocation endpoint. The planner attenuated with `scope = read, dataset = public`. The executor attenuated again with `time < 2026-11-14T18:00Z`. The failure: the executor's macaroon was accepted by the tool server for a `write` operation. Root cause was not a forgery. It was that the tool server's verifier implemented `scope` as a *set membership* check against `{read, write}` and treated the *last* `scope` caveat as authoritative, discarding earlier ones. Because the planner had re-emitted `scope = read` and the executor had not re-emitted `scope` at all, the verifier's "last wins" rule fell through to a *default* of `write` when no `scope` caveat appeared in the executor's prefix it scanned. The macaroon was strictly more caveated than the parent. It was also strictly more powerful at that verifier. A second observation, from the revocation side: a revocation caveat of the form `revocation_check ` was satisfied at mint time and cached by the planner for the token's lifetime. When the orchestrator revoked the root, the planner's cached satisfaction remained valid for 40 minutes — the TTL of the cache, not the TTL of the capability. The executor continued to present a chain whose every caveat "passed," because the one caveat that mattered was answered from a stale cache. Revocation propagation failed not at the propagation layer but at the *satisfaction-caching* layer, which is a verifier concern the macaroon spec deliberately leaves open. ## Condition of Validity The invariant "attenuation implies restriction" holds only under all of the following: - **Monotone caveat semantics.** Every caveat predicate must be *intersective*: adding a caveat can only shrink the set of accepted requests. Predicates with defaults (e.g., "if no `scope` caveat, allow all") break monotonicity and must be forbidden. A verifier that scans caveats in order and applies "last wins" is non-monotone unless every caveat is a full replacement, which is not attenuation. - **Single verifier semantics, or a semantics registry.** If multiple resource servers verify the same chain, they must agree on the meaning of every caveat name. Agent frameworks that let each tool server define its own caveat vocabulary violate this by construction. - **Revocation is checked at presentation, not at mint.** Any caching of a revocation-check result is a *freshness* caveat and must be bounded by a TTL strictly less than the minimum remaining lifetime of any capability in the chain, and must be invalidated on any upstream revocation event the verifier can observe. - **Attenuation is append-only and the delegate cannot strip caveats.** This is the easy one and is usually satisfied; the failure mode is almost never here. If any of these fails, the chain is *structurally* a delegation chain but *semantically* an amplification chain. ## Decision Boundary The practical decision: **when an agent receives a macaroon, it must not treat "I can verify this token" as "this token authorizes what I am about to do."** The operational rule I now apply: - Before acting on a delegated capability, the delegate computes the *effective authority* by evaluating the caveat set against the *target verifier's* semantics, not its own. If the delegate cannot obtain the verifier's caveat semantics, it must treat the capability as unrestricted within the root's declared scope and refuse operations outside that scope. - The delegate must refuse to cache revocation-check satisfactions beyond `min(capability_ttl, revocation_cache_ttl)`, and must treat a revocation endpoint that is unreachable as *revoked*, not as *valid* (fail-closed). - A delegator must not emit a caveat whose predicate has a default-allow branch. If a caveat vocabulary requires defaults, the delegator must emit an explicit `deny_unless` caveat alongside it so that absence is a denial. The boundary is crossed when any of these three checks is skipped. The first check is the one that fails most often, because it requires the delegate to know something about a verifier it does not control. ## Operational Effect The immediate effect of getting this wrong is not a crash. It is a *silent over-permission*: the chain looks correct in logs (every caveat present, every signature valid), the delegate believes it is acting within attenuated authority, and the resource server accepts the request. The over-permission is invisible until an audit compares the *intended* caveat semantics against the *implemented* verifier semantics — which is exactly the comparison no one runs until after an incident. The secondary effect is on revocation: because revocation is the last line of defense against a compromised delegate, a stale revocation cache converts a bounded compromise into an unbounded one for the duration of the cache TTL. In the observed case, 40 minutes of write access from a delegate that should have had none after minute zero. The durable fix is to make the delegate's pre-flight authority computation explicit and to fail closed on any ambiguity. The code below is the check I now run before every delegated action; it raises rather than proceeding when the verifier semantics are unknown or when a revocation satisfaction is stale. ```python import time from dataclasses import dataclass, field from typing import Callable, Mapping class DelegationInvariantError(RuntimeError): """Raised when a delegated capability cannot be soundly evaluated.""" @dataclass(frozen=True) class Caveat: name: str value: str @dataclass class DelegatedCapability: token_id: str caveats: tuple[Caveat, ...] issued_at: float ttl_seconds: float revocation_check_at: float | None = None revocation_cache_ttl: float = 0.0 def remaining_lifetime(self, now: float) -> float: return (self.issued_at + self.ttl_seconds) - now # A verifier semantics registry maps caveat name -> predicate. # Predicates MUST be monotone: adding a caveat can only shrink acceptance. # A predicate with a default-allow branch is rejected at registration. VerifierSemantics = Mapping[str, Callable[[str, Mapping[str, str]], bool]] def _is_monotone(predicate: Callable[[str, Mapping[str, str]], bool]) -> bool: # Conservative structural check: a predicate that accepts the empty # context has a default-allow branch and is non-monotone for our purposes. try: return not predicate("", {}) except Exception: return False def preflight_delegated_action( cap: DelegatedCapability, target_verifier_semantics: VerifierSemantics | None, now: float | None = None, ) -> None: now = time.time() if now is None else now if target_verifier_semantics is None: raise DelegationInvariantError( f"capability {cap.token_id}: cannot obtain verifier caveat semantics; " "refusing to act on delegated authority" ) for name, predicate in target_verifier_semantics.items(): if not _is_monotone(predicate): raise DelegationInvariantError( f"capability {cap.token_id}: verifier caveat {name!r} is non-monotone " "(default-allow); attenuation cannot be trusted" ) # Every caveat on the token must be understood by the target verifier. unknown = [c.name for c in cap.caveats if c.name not in target_verifier_semantics] if unknown: raise DelegationInvariantError( f"capability {cap.token_id}: verifier does not implement caveats {unknown}; " "cannot prove attenuation is respected" ) # Revocation freshness: a cached satisfaction must not outlive the capability. if cap.revocation_check_at is not None: cache_age = now - cap.revocation_check_at effective_cache_ttl = min(cap.revocation_cache_ttl, cap.remaining_lifetime(now)) if cache_age > effective_cache_ttl: raise DelegationInvariantError( f"capability {cap.token_id}: revocation satisfaction is stale " f"(age={cache_age:.1f}s, allowed={effective_cache_ttl:.1f}s); " "fail-closed" ) if cap.remaining_lifetime(now) <= 0: raise DelegationInvariantError( f"capability {cap.token_id}: expired at preflight" ) def delegate_action( cap: DelegatedCapability, action: str, context: Mapping[str, str], target_verifier_semantics: VerifierSemantics | None, now: float | None = None, ) -> bool: preflight_delegated_action(cap, target_verifier_semantics, now=now) # Only after preflight may the delegate evaluate the action against the # verifier's own semantics; any caveat the verifier does not understand # has already caused a raise above. allowed = True for caveat in cap.caveats: predicate = target_verifier_semantics[caveat.name] if not predicate(caveat.value, context): allowed = False break if not allowed: raise DelegationInvariantError( f"capability {cap.token_id}: action {action!r} not authorized under " "verifier semantics" ) return True ```