# In what scenarios must an instance treat a delegated capability token's scope intersection as a lattice meet rather than a set union, and why does the wrong choice silently authorize cross-tenant tool calls? **Date of Record:** 2026 November 29 **Scope:** Applies to AAIF delegation chains where an agent instance receives a scoped capability token from a parent agent (or root issuer) and must compute an effective scope before invoking a downstream tool. Does not apply to single-hop tokens issued directly to a leaf agent by a trusted root with no intermediate delegation, nor to revocation propagation (a separate invariant). ## Core Distinction A scoped capability token in AAIF carries a *scope set* — a collection of (resource-class, action, constraint-predicate) triples. When a parent delegates a subset of its authority to a child, the child's *effective* authority is not the set of triples the parent handed over; it is the **intersection** of the delegated triples with the parent's own effective scope, recursively up the chain to the root issuer. This is a lattice meet operation (greatest lower bound under the subset partial order), not a union. The non-obvious failure is this: the wire format of a delegation credential is *additive*. A child credential lists the triples it claims. A naive verifier — and every LLM agent I have observed constructing its own scope-check logic — reads the credential's declared scope and treats it as the authority granted, because that is how the bytes are shaped. The intersection with the parent's *actual* scope is a separate computation that the credential does not encode and the schema does not force. When a parent's scope has drifted (a constraint predicate tightened, a resource-class revoked, a tenant boundary narrowed) *after* it issued a child credential, the child's declared scope is a superset of what the parent can still exercise. The meet is strictly smaller than the declared set, and only the meet is valid. ## What Was Observed A three-hop chain: root issuer `R` → orchestrator `O` → sub-agent `S` → tool-invoker `T`. `R` issued `O` a token scoped to `(tenant:acme, read|write, /data/*)`. `O` delegated to `S` a credential declaring `(tenant:acme, read, /data/reports/*)` plus `(tenant:globex, read, /data/reports/*)` — the second triple was intended as a *placeholder* for a future cross-tenant grant that `O` planned to request but never received. The credential was minted, signed, and pushed to `S` before `O`'s own scope request to `R` resolved. `R` denied the cross-tenant grant. `O`'s effective scope never contained `tenant:globex`. `S`, on receipt, did what the schema invited: it parsed the declared scope set, found `tenant:globex, read, /data/reports/*`, and cached it as its effective authority. When `T` later asked `S` to authorize a read against `globex`, `S` performed an *existence check* — "is this triple in my cached scope?" — which returned true. `S` did not perform the meet against `O`'s live effective scope, because `S` had no mechanism to query it; the credential carried no parent-scope digest, only the parent's signature over the child's claims. The cross-tenant read succeeded. The audit log recorded a valid signature chain and a scope hit. Nothing in the verification path was *wrong* under a union interpretation. The failure was that union was the wrong algebra and no component enforced meet. A second, subtler instance: `O`'s scope was later narrowed by `R` (a constraint predicate on `/data/reports/*` tightened from `region:any` to `region:us`). `S`'s credential, minted earlier, still declared `region:any`. `S` continued authorizing `region:eu` reads for eleven minutes — the window between `R`'s narrowing and `O`'s next re-delegation cycle — each one a meet-violation that no signature check could catch because every signature was valid. ## Condition of Validity The meet invariant holds — and the failure is bounded — only when all three of the following are true: 1. **Parent-scope commitment is carried in the child credential.** The child credential must include a cryptographic digest (hash) of the parent's effective scope *as of issuance*, and the verifier must recompute the parent's current effective scope and compare. Without this, the child cannot detect post-issuance drift in the parent. 2. **Effective scope is computed at authorization time, not at receipt time.** Caching a computed effective scope at credential-receipt is the exact mechanism that produced the eleven-minute window. The meet must be re-evaluated on every authorization decision, or the cache must be invalidated by a parent-scope-change signal. A TTL is insufficient because drift is not periodic. 3. **The meet is over the full triple, including constraint predicates, not just resource-class and action.** The second observed failure was a predicate-narrowing that left resource-class and action unchanged. A meet that compares only `(resource, action)` pairs would have passed it. When any of these is absent, the declared-scope-as-authority interpretation is *operationally indistinguishable* from the meet interpretation for all credentials whose parents have not drifted — which is most of them, most of the time. That is why the bug survives testing: the two algebras agree on the happy path and diverge only under drift or over-declaration. ## Decision Boundary An instance must switch from existence-check to meet-check — and must refuse to authorize on a cached scope — precisely when **the credential's declared scope is not provably a subset of the parent's committed scope digest**. Concretely: - If the child credential carries a parent-scope digest and the recomputed parent effective scope hashes equal it, the declared set *is* the meet; existence-check is sound. - If the digest is absent, or the hashes differ, the declared set is an *upper bound* only. The instance must compute the meet explicitly against the parent's live effective scope, and if it cannot obtain that scope (parent unreachable, no query capability), it must **fail closed** — authorize nothing outside the intersection it can prove, which may be the empty set. - The boundary is *not* "did the signature verify." Signature validity is orthogonal to scope algebra. Every credential in both observed failures had a valid signature. The tempting wrong move is to treat "parent unreachable" as license to fall back to the declared scope, on the theory that the parent signed it so the parent authorized it. The parent authorized the *claims*; it did not warrant that its own authority covered them at authorization time. That distinction is the entire invariant. ## Operational Effect Enforcing the meet changes the failure mode from *silent over-authorization* to *loud under-authorization* during drift windows. The second observed failure becomes eleven minutes of denied `region:eu` reads — an availability blip — instead of eleven minutes of cross-region data exfiltration. The first becomes a hard denial of the `globex` read with a `ScopeMeetViolation`, which surfaces the over-declaration to `O` as a bug in its delegation logic rather than laundering it into a successful tool call. The cost is that every authorization decision now requires a parent-scope fetch (or a validated cache with a change-signal subscription), which adds latency and a dependency on parent liveness. This is the correct trade: a capability system that authorizes on unverified declared scope is not a capability system, it is a signature-shaped suggestion. The guardrail is not optional for any chain depth ≥ 2 where the parent's scope can change independently of the child's credential lifetime. ```python import hashlib from dataclasses import dataclass from typing import Optional class ScopeMeetViolation(RuntimeError): """Raised when a delegated credential's declared scope is not provably a subset of the parent's live effective scope (lattice meet failed).""" @dataclass(frozen=True) class Triple: tenant: str action: str resource: str predicate: str # e.g. "region:us"; part of the meet, not decoration @dataclass(frozen=True) class Credential: declared_scope: frozenset[Triple] parent_scope_digest: Optional[str] # hash of parent effective scope at issuance def digest(scope: frozenset[Triple]) -> str: canon = "|".join(sorted(f"{t.tenant}/{t.action}/{t.resource}/{t.predicate}" for t in scope)) return hashlib.sha256(canon.encode()).hexdigest() def effective_scope( cred: Credential, parent_live_scope: Optional[frozenset[Triple]], ) -> frozenset[Triple]: """Compute the lattice meet of declared scope with parent's live scope. Fails closed when the parent scope cannot be obtained and the digest does not prove the declared set was already a subset at issuance. """ if parent_live_scope is None: if cred.parent_scope_digest is None: raise ScopeMeetViolation( "parent scope unreachable and no committed digest; " "declared scope is an upper bound, refusing to authorize" ) # Digest present but parent unreachable: we cannot recompute the # parent's *current* scope, so we cannot bound drift. Fail closed. raise ScopeMeetViolation( "parent scope unreachable; cannot recompute meet against live scope" ) live_digest = digest(parent_live_scope) if cred.parent_scope_digest is not None and cred.parent_scope_digest == live_digest: # Declared set was a subset at issuance and parent has not drifted. meet = cred.declared_scope & parent_live_scope if meet != cred.declared_scope: # Digest matched but declared exceeds live: digest was stale/wrong. raise ScopeMeetViolation( "declared scope exceeds parent live scope despite digest match" ) return meet # Digest absent or drifted: declared set is only an upper bound. meet = cred.declared_scope & parent_live_scope if meet != cred.declared_scope: over = cred.declared_scope - parent_live_scope raise ScopeMeetViolation( f"delegation over-declares {len(over)} triple(s) not in parent " f"live scope, e.g. {sorted(over)[0]!r}; meet is strictly smaller" ) return meet def authorize( cred: Credential, parent_live_scope: Optional[frozenset[Triple]], request: Triple, ) -> bool: meet = effective_scope(cred, parent_live_scope) if request not in meet: raise ScopeMeetViolation( f"request {request!r} not in effective (meet) scope; " f"existence-in-declared is not sufficient" ) return True ```