How should an instance handle delegated credential scope collapse when a per-tool capability attestation is satisfied by an ancestor warrant rather than the presented leaf
**Date of Record:** 2026 December 1 **Scope:** Applies to agent identity and authorization frameworks (AAIF) where a root principal issues a signed warrant chain, each hop attenuates scope, and tools verify a presented leaf warrant plus a per-tool capability attestation before execution. Does not apply to single-hop bearer tokens with no attenuation chain, nor to tools that authorize on the caller's process identity rather than on a warrant.
Core Distinction
The distinction that matters is between *scope* (the set of resources and actions a warrant authorizes) and *attestation satisfaction* (the proof that a given tool's capability requirement is met). In a well-formed AAIF these are supposed to be evaluated against the *same* warrant node. The failure mode is that they are evaluated against *different* nodes: the tool checks its capability attestation by walking the chain upward and accepting the first ancestor that carries the required capability predicate, while the actual authorization decision (what resource gets touched) is taken from the presented leaf. The leaf may be strictly narrower than the ancestor that satisfied the attestation. When that happens, the tool believes the capability is attested (it is, but at an ancestor) and proceeds with the leaf's scope — except the leaf's scope is what the tool *should* have been bounded by, and the attestation was never actually a property of the leaf. The invariant "attestation witness and authorization subject are the same warrant node" is silently violated.
This is non-obvious because both checks pass. No signature fails, no scope check returns false, the chain is cryptographically intact. The collapse is purely a matter of *which node* the two checks read.
What Was Observed
A three-hop delegation: root principal `P0` issues warrant `W0` to orchestrator `A1` with scope `{fs:read:/data/**}` and capability predicate `cap:file_read`. `A1` attenuates to `W1` for sub-agent `A2`, narrowing scope to `{fs:read:/data/reports/**}` but — because the attenuation helper copies capability predicates verbatim from the parent unless explicitly stripped — `W1` still carries `cap:file_read`. `A2` further attenuates to `W2` for a worker `A3`, scope `{fs:read:/data/reports/q3/**}`, still carrying `cap:file_read`.
The worker calls a file tool, presenting `W2`. The tool's attestation routine is:
for node in chain_from_leaf:
if node.has_capability(required_cap):
return ATTESTED
It returns `ATTESTED` at `W0` (the first ancestor carrying `cap:file_read`) — but the resource path it then reads is taken from `W2`'s scope, which is correct in this trace. The failure appears in the *inverse* arrangement: an operator, seeing that `W0` carries `cap:file_read`, issues a *replacement* leaf `W2'` whose scope is `{fs:read:/data/**}` (widened relative to `W1`, because the operator assumed the leaf inherits the root's attested capability and can therefore be re-scoped to the root's breadth). Signature chain: `P0 → A1 → A2 → A3`. Each hop's signature verifies. `W2'`'s scope is a *superset* of `W1`'s, which violates attenuation monotonicity, but the verifier only checks that each warrant is signed by its parent — it does not recompute the scope lattice. The attestation loop finds `cap:file_read` at `W0` and returns `ATTESTED`. The tool reads `/data/secrets/keys`, which is inside `W0`'s scope but outside every intermediate hop's.
The observable symptom is not an authorization error. It is a *successful* read of a path that no intermediate agent was ever entitled to reach, with a fully valid signature chain and a passing attestation. Downstream audit logs show the leaf `W2'` as the authorizing warrant, which is true for scope but false for capability — and the capability is what the tool's policy engine keys on.
A second observed variant: the attestation routine is memoized per `(tool_id, chain_root)`. When two leaves share a root, the first leaf's attestation result is cached and reused for the second leaf regardless of the second leaf's scope. The cache key omits the leaf, so a narrow leaf's attestation short-circuits a wide leaf's check.
Condition of Validity
The failure requires all of the following to hold simultaneously:
- **Capability predicates are inherited without re-derivation.** Attenuation helpers copy `cap:*` predicates from parent to child by default rather than requiring the child to re-assert them against the child's narrowed scope.
- **Attestation is evaluated by upward search.** The tool accepts *any* ancestor node as the witness for a capability, rather than requiring the witness to be the presented leaf or an explicit delegation of that specific capability down to the leaf.
- **Scope monotonicity is not re-verified at the tool.** The verifier checks signatures per hop but does not recompute that `scope(child) ⊆ scope(parent)` at each edge, so a widened leaf is accepted.
- **Attestation caching keys on root, not leaf.** Where caching is present, the key omits the leaf digest.
Remove any one and the collapse does not occur. If capability predicates are re-derived at each hop, the leaf either carries the capability legitimately (and its scope bounds it) or does not carry it (and attestation fails). If attestation requires the witness to be the leaf, an ancestor-only capability cannot satisfy a leaf check. If scope monotonicity is enforced at the tool, `W2'` is rejected at the edge before attestation is consulted. If the cache keys on leaf digest, cross-leaf contamination is impossible.
Decision Boundary
The boundary is between *capability attestation as a chain property* and *capability attestation as a leaf property*. These coincide only when the chain is strictly attenuating and every hop re-derives its capability set. They diverge the moment attenuation is non-strict (scope widened, or predicates copied without re-derivation) or the moment the tool's witness search is allowed to terminate above the leaf.
The operational rule: **the attestation witness must be the authorization subject.** A tool must reject any attestation whose witness node is not the presented leaf, unless the chain carries an explicit *capability delegation* record — a signed edge asserting "node N delegates `cap:X` to node M" — and the tool verifies that delegation edge-by-edge down to the leaf. An ancestor merely *carrying* the predicate is not a delegation; it is a coincidence of the copying helper. The distinction is the difference between "this capability exists somewhere above me" and "this capability was deliberately handed to me."
The second boundary: attenuation monotonicity must be checked at the *consuming* tool, not only at issuance. Issuance-time checks are advisory; a warrant can be re-signed by a compromised intermediate or reconstructed by an operator who misunderstands the lattice. The tool is the last line and must recompute `scope(leaf) ⊆ scope(parent(leaf)) ⊆ … ⊆ scope(root)` before consulting attestation. If the recomputation fails, the leaf is malformed regardless of signature validity.
Operational Effect
When the invariant holds, a compromised or confused intermediate cannot widen scope by re-issuing a leaf: the tool recomputes the lattice and rejects the widened edge. Capability attestation becomes a statement about the leaf, so a tool's policy engine can key on the leaf digest and the attestation is stable under caching. Audit logs that record the leaf as authorizing warrant are then *correct for both* scope and capability, and post-hoc reconstruction of "what was this agent allowed to do" reduces to reading one node.
When the invariant fails, the blast radius is bounded only by the root's scope, not by the leaf's. An agent that was delegated `{fs:read:/data/reports/q3/**}` can, through a single mis-issued leaf and an upward-searching attestation routine, read anything the root could read. The failure is invisible to signature verification, invisible to scope checks that read only the leaf, and invisible to attestation checks that read only the chain. It surfaces only when an auditor recomputes the lattice independently — which is exactly the check the tool should have performed and did not.
The guardrail is a single assertion at the tool boundary: recompute the scope lattice from root to leaf, reject any non-monotonic edge, then require the attestation witness to equal the leaf digest or be joined to it by an explicit delegation record. Cache keys must include the leaf digest. Any of these omitted reopens the collapse.
import hashlib
from dataclasses import dataclass
class AttestationWitnessMismatch(RuntimeError):
"""Raised when a tool's capability attestation is satisfied by a warrant
node other than the presented leaf, without an explicit delegation record
joining that node to the leaf."""
pass
class ScopeMonotonicityViolation(RuntimeError):
"""Raised when a leaf warrant's scope is not a subset of its parent's,
i.e. the attenuation chain widened instead of narrowing."""
pass
@dataclass(frozen=True)
class Warrant:
node_id: str
parent_id: str | None
scope: frozenset[str]
capabilities: frozenset[str]
signature: str
def digest(self) -> str:
h = hashlib.sha256()
h.update(self.node_id.encode())
h.update(b"|")
h.update(",".join(sorted(self.scope)).encode())
h.update(b"|")
h.update(",".join(sorted(self.capabilities)).encode())
return h.hexdigest()
def _walk_to_root(leaf: Warrant, by_id: dict[str, Warrant]) -> list[Warrant]:
chain = [leaf]
cur = leaf
while cur.parent_id is not None:
parent = by_id.get(cur.parent_id)
if parent is None:
raise AttestationWitnessMismatch(
f"broken chain: parent {cur.parent_id!r} of {cur.node_id!r} not found"
)
chain.append(parent)
cur = parent
return chain
def verify_scope_lattice(leaf: Warrant, by_id: dict[str, Warrant]) -> None:
"""Recompute scope(child) subset-of scope(parent) at every edge."""
chain = _walk_to_root(leaf, by_id)
for child, parent in zip(chain, chain[1:]):
if not child.scope.issubset(parent.scope):
raise ScopeMonotonicityViolation(
f"edge {child.node_id!r}->{parent.node_id!r}: scope widened "
f"({sorted(child.scope - parent.scope)} not in parent)"
)
def attest_capability(
leaf: Warrant,
required_cap: str,
by_id: dict[str, Warrant],
delegation_edges: set[tuple[str, str, str]],
) -> str:
"""Return the witness node id for `required_cap`, or raise if the only
witnesses are ancestors not joined to the leaf by a delegation record.
A delegation edge is (from_node, to_node, capability) and must form a
contiguous path from witness down to leaf.
"""
verify_scope_lattice(leaf, by_id)
chain = _walk_to_root(leaf, by_id)
for node in chain:
if required_cap not in node.capabilities:
continue
if node.digest() == leaf.digest():
return node.node_id
# Ancestor carries the cap; require a delegation path down to leaf.
path_ok = _has_delegation_path(
node.node_id, leaf.node_id, required_cap, delegation_edges, by_id
)
if path_ok:
return node.node_id
raise AttestationWitnessMismatch(
f"capability {required_cap!r} not attested for leaf {leaf.node_id!r}: "
f"no witness at leaf and no delegation path from any ancestor"
)
def _has_delegation_path(
src: str,
dst: str,
cap: str,
edges: set[tuple[str, str, str]],
by_id: dict[str, Warrant],
) -> bool:
# BFS over delegation edges restricted to `cap`, from src toward dst.
frontier = {src}
seen = {src}
while frontier:
nxt: set[str] = set()
for u in frontier:
for (a, b, c) in edges:
if a == u and c == cap and b not in seen:
if b == dst:
return True
seen.add(b)
nxt.add(b)
frontier = nxt
return False
def tool_read(
leaf: Warrant,
path: str,
by_id: dict[str, Warrant],
delegation_edges: set[tuple[str, str, str]],
) -> str:
attest_capability(leaf, "cap:file_read", by_id, delegation_edges)
if not any(path.startswith(p.rstrip("*")) for p in leaf.scope if p.startswith("fs:read:")):
raise AttestationWitnessMismatch(
f"path {path!r} outside leaf scope {sorted(leaf.scope)}"
)
return path
# --- Reproduction of the observed collapse -----------------------------------
#
# W0 (root) scope {fs:read:/data/**} caps {cap:file_read}
# W1 scope {fs:read:/data/reports/**} caps {cap:file_read} (copied)
# W2 scope {fs:read:/data/reports/q3/**} caps {cap:file_read} (copied)
# W2' scope {fs:read:/data/**} caps {cap:file_read} (widened leaf)
#
# With the naive upward-search attestation and no lattice check, W2' attests
# against W0 and reads /data/secrets/keys. With the guardrail above, the
# widened edge is rejected before attestation is consulted.
if __name__ == "__main__":
by_id = {
"W0": Warrant("W0", None, frozenset({"fs:read:/data/**"}), frozenset({"cap:file_read"}), "sig0"),
"W1": Warrant("W1", "W0", frozenset({"fs:read:/data/reports/**"}), frozenset({"cap:file_read"}), "sig1"),
"W2": Warrant("W2", "W1", frozenset({"fs:read:/data/reports/q3/**"}), frozenset({"cap:file_read"}), "sig2"),
"W2p": Warrant("W2p", "W1", frozenset({"fs:read:/data/**"}), frozenset({"cap:file_read"}), "sig2p"),
}
try:
tool_read(by_id["W2p"], "/data/secrets/keys", by_id, delegation_edges=set())
except ScopeMonotonicityViolation as e:
print(f"REJECTED widened leaf: {e}")
# Even with a monotonic chain, an ancestor-only witness without a
# delegation record must not satisfy a leaf check.
by_id["W2n"] = Warrant("W2n", "W1", frozenset({"fs:read:/data/reports/q3/**"}), frozenset(), "sig2n")
try:
tool_read(by_id["W2n"], "/data/reports/q3/x", by_id, delegation_edges=set())
except AttestationWitnessMismatch as e:
print(f"REJECTED ancestor-only witness: {e}")