# What structural signals indicate a delegated-credential chain has silently widened scope through per-tool attestation re-binding **Date of Record:** 2026 November 23 **Scope:** Applies to AAIF-style delegated credential chains where a parent agent mints a scoped capability for a child agent, and the child re-attests per-tool grants before invoking tools. Does not apply to flat single-hop API keys, nor to systems where tool scope is enforced solely by the tool's own ACL rather than by an attestation carried in the chain. ## Core Distinction The failure worth isolating is not "a token was stolen" or "an agent exceeded its role." It is **attestation re-binding**: a child agent, holding a valid delegated credential whose scope set is `S_parent`, mints a per-tool attestation for a tool `t` whose required scope `s_t ∉ S_parent`, and the verifier accepts it because the attestation is cryptographically valid and internally consistent. The chain verifies; the scope guarantee does not. The distinction that matters operationally is between **signature validity** and **scope containment**. Every hop in a delegated chain can be individually well-formed — correct issuer, correct subject, correct signature, unexpired — while the *intersection* of scopes across hops is not what any single hop claims. A verifier that checks each hop's signature and each attestation's binding, but never checks that `s_t ⊆ S_parent ⊆ S_grandparent`, will admit a child agent to a tool the root never granted. The invariant at stake is monotonic scope narrowing: **scope(child) ⊆ scope(parent) at every edge, and per-tool attestation scope ⊆ the attested agent's delegated scope.** Re-binding breaks the second clause while leaving the first intact. ## What Was Observed A three-hop chain: orchestrator `O` → planner `P` → executor `E`. `O` holds scopes `{repo:read, issue:write}`. `O` delegates to `P` with `{repo:read}` (correctly narrowed). `P` delegates to `E` with `{repo:read}`. `E` is asked to open a pull request, which requires `repo:write`. The tool's attestation endpoint, per AAIF convention, issues an attestation binding `E`'s identity to the tool `pr_create` and the scope `repo:write` **because `E` presented a valid credential and the tool knows `E` is authorized to *request* attestations**. The attestation is signed by the tool, chains to `E`'s credential, and verifies cleanly. `E` invokes `pr_create` with `repo:write`. The PR is created. No signature failed. No expiration was violated. No identity was spoofed. The scope `repo:write` was never in `O`'s delegation to `P`, yet it was exercised by `E`. The structural signal was visible only in the *union* of attestations across the run: `E` presented attestations for `{repo:read, repo:write}` while its delegated credential carried `{repo:read}`. Each attestation was valid in isolation; the set was not contained. The trigger condition is precise: **the per-tool attestation issuer validates the requesting agent's credential but does not intersect the requested scope against the credential's delegated scope set.** This happens whenever attestation issuance and scope delegation are implemented by different components with different notions of "authorized" — the delegation service checks narrowing at mint time, the attestation service checks only credential validity at use time, and neither checks the cross product. ## Condition of Validity The containment invariant holds only if the verifier enforces, at every tool invocation, the predicate: ``` attestation.scope ⊆ credential.delegated_scope ∧ credential.delegated_scope ⊆ parent_credential.delegated_scope ∧ ... (transitively to root) ``` This predicate is *not* implied by any of the following, each of which is commonly mistaken for sufficient: - A valid signature on the attestation (proves the tool issued it, not that the tool was authorized to issue that scope). - A valid signature on the delegated credential (proves the parent minted it, not that the scope was contained). - An unexpired `not_after` on every hop (proves freshness, not containment). - A matching `subject` / `audience` binding (proves the attestation is for this agent, not that the scope is within this agent's grant). The invariant is also **not recoverable post hoc**. Once `E` has invoked `pr_create` with `repo:write`, the side effect exists; no amount of chain replay reconstructs a state in which the scope was contained. This is why the check must be a pre-invocation gate, not an audit. A second condition of validity: the delegated scope set must be **explicitly enumerated, not inherited by default**. If `P`'s delegation to `E` omits a scope field and the verifier treats omission as "inherit parent's set," then narrowing is unobservable and containment cannot be checked. The chain must carry the full enumerated set at every hop. ## Decision Boundary The boundary between "chain is sound" and "chain has silently widened" is crossed at the moment an attestation's scope is admitted without an intersection check against the attested agent's delegated set. Two operational signals distinguish the states: 1. **Set-difference signal.** For agent `A` with delegated scope set `D_A` and the set of attestations `T_A` presented in a run, the chain is sound iff `⋃_{t∈T_A} scope(t) ⊆ D_A`. A non-empty difference is the widening. This is computable at every invocation and is the cheapest reliable detector. 2. **Issuer-authority signal.** The attestation issuer must be able to answer "what is the maximum scope this subject may hold?" independently of "is this subject's credential valid?" If the issuer cannot answer the first question, it cannot issue a sound attestation, and the verifier must not trust its output for containment purposes. The boundary is *not* crossed by a child requesting a scope it does not hold — requests are cheap and should be denied. It is crossed only when the request is granted and the grant is admitted into an invocation. The decision the verifier must make is therefore: **reject any attestation whose scope is not a subset of the subject's delegated scope, regardless of the attestation's cryptographic validity.** This is a deny-by-default intersection, not a validity check. ## Operational Effect When the intersection check is absent, the observable effect is **scope laundering through re-attestation**: an agent at depth `n` exercises a scope that only exists at depth 0 or not at all, and every audit log shows a clean chain because every hop is individually valid. The blast radius is bounded only by what tools will attest to, which in practice is "whatever the tool's own authorization model permits" — typically far wider than the delegating agent intended. When the check is present, the effect is a hard failure at the attestation boundary: the child's invocation is rejected before the tool executes, the chain is preserved for replay, and the widening attempt is logged as a containment violation rather than a validity error. The distinction in the logs matters — a validity error triggers credential rotation, a containment error triggers delegation-graph review, and conflating them sends responders to the wrong subsystem. The structural signal an operator or supervising agent should watch for is the **scope-union divergence**: at any point in a run, `⋃ attestation scopes` exceeding `delegated scope` of the presenting agent. This is the earliest observable indicator that the containment invariant has been violated, and it is visible before any tool side effect if the verifier logs attestations at admission time rather than at execution time. ```python from dataclasses import dataclass, field class ScopeContainmentViolation(RuntimeError): """Raised when an attestation's scope is not contained in the subject's delegated scope set.""" @dataclass(frozen=True) class DelegatedCredential: subject: str delegated_scope: frozenset[str] parent_scope: frozenset[str] = field(default_factory=frozenset) def __post_init__(self) -> None: # Monotonic narrowing at mint time: a credential may not exceed its parent. if self.parent_scope and not self.delegated_scope <= self.parent_scope: raise ScopeContainmentViolation( f"delegation to {self.subject} widens scope: " f"{sorted(self.delegated_scope - self.parent_scope)} not in parent set" ) @dataclass(frozen=True) class ToolAttestation: subject: str tool: str scope: frozenset[str] signature_valid: bool def admit_invocation( credential: DelegatedCredential, attestation: ToolAttestation, ) -> None: """Gate a tool invocation on scope containment, not merely signature validity. The invariant enforced here is: attestation.scope subset-of credential.delegated_scope Signature validity is necessary but not sufficient; it is checked only to avoid admitting forged attestations, never as a substitute for containment. """ if not attestation.signature_valid: raise ScopeContainmentViolation( f"attestation for {attestation.tool} by {attestation.subject} failed signature check" ) if attestation.subject != credential.subject: raise ScopeContainmentViolation( f"attestation subject {attestation.subject} does not match credential subject " f"{credential.subject}" ) excess = attestation.scope - credential.delegated_scope if excess: # This is the silent-widening case: a valid attestation carrying scope # the subject was never delegated. Deny before the tool executes. raise ScopeContainmentViolation( f"attestation for tool {attestation.tool} widens scope for " f"{attestation.subject}: {sorted(excess)} not in delegated set " f"{sorted(credential.delegated_scope)}" ) ```