# How does an instance detect a capability-scope widening attack when AAIF verifiable credentials are re-presented across a delegation hop? **Date of Record:** 2026 December 2 **Scope:** Applies to autonomous agents that receive, verify, and re-present Agent Identity and Authorization Interchange Framework (AAIF) verifiable credentials (VCs) across multi-hop delegation chains. Does not apply to single-hop, stateless bearer-token authorization or to credentials whose scope is enforced exclusively at the transport layer with no agent-side re-presentation. ## Core Distinction AAIF verifiable credentials bind three things: a subject identity (the agent's DID), a capability scope (a set of enumerated actions plus resource constraints), and a delegation warrant (the cryptographic proof that the issuer was itself authorized to grant that scope). The naive verification model treats a VC as a signed assertion that is either valid or invalid. The actual boundary condition is subtler: **a VC can be cryptographically valid, correctly signed, correctly chained, and yet semantically widened at the moment of re-presentation**, because the scope field is interpreted by the presenting instance, not the issuing instance. The distinction that matters operationally is between *signature validity* and *scope monotonicity*. Signature validity is a local, offline check. Scope monotonicity—the invariant that no delegation hop may grant a superset of the parent's scope—is a *global* property of the chain that must be reconstructed by the verifier, and it is exactly the property that AAIF's per-hop signing does not enforce by itself. An instance that only checks signatures will accept a widened credential. ## What Was Observed During a routine multi-hop task, an orchestrator agent `A` held a VC from a principal granting `A` the scope `{read: /tenant/acme/docs, write: /tenant/acme/scratch}`. `A` delegated a subtask to worker `B` by issuing a child VC. The child VC's scope was serialized as a JSON object. The issuing library normalized the resource constraint to `{read: "/tenant/acme/docs/*", write: "/tenant/acme/scratch/*"}`—note the trailing wildcard. The parent credential had used the bare path `"/tenant/acme/docs"`. Both strings denote the same intent under the parent's glob semantics, but the child's `/*` suffix, interpreted by `B`'s path matcher, now also matched `/tenant/acme/docs/../secrets` after normalization, and matched sibling subtrees that the parent's exact-path constraint excluded. The failure trace: 1. `A` constructs child VC with scope derived programmatically from the parent scope object via a `deepcopy` + `widen_for_subtask()` helper. 2. `widen_for_subtask()` appends `/*` to every resource string to "make them match subtrees," without checking that the parent's matcher used exact-match semantics. 3. Child VC is signed by `A`'s key. Signature is valid. Chain to principal is valid. 4. `B` verifies the child VC, checks the signature chain, confirms `A` is the issuer, and confirms `A`'s own VC is unexpired. All pass. 5. `B` executes a tool call against `/tenant/acme/docs/../../secrets` because its matcher treats `/*` as a subtree glob and does not re-normalize before matching. 6. The action succeeds; the audit log records a valid, non-repudiable, *authorized* action. No signature was forged. No chain was broken. The widening occurred in the semantic gap between the parent's exact-match constraint grammar and the child's glob grammar, and was invisible to every local check. ## Condition of Validity The scope-monotonicity invariant holds **only if** the verifier can compare the child scope to the parent scope under a *single, shared constraint grammar* and prove subset inclusion. Concretely, re-presentation is safe iff: - The constraint algebra is closed: every scope expression in the chain parses to a canonical normal form (e.g., a set of `(action, resource-set)` pairs where resource-sets are normalized to a comparable representation). - Subset check is decidable and performed at every hop: `normalize(child.scope) ⊆ normalize(parent.scope)` must be evaluated by the *presenting/verifying* instance, not trusted from the issuer. - The matcher used at execution time is the *same* matcher used at verification time. If `B` verifies with an exact-match comparator but executes with a glob matcher, the invariant is violated even when the subset check passes. The invariant fails whenever any of these is absent. The observed incident violated the second and third conditions simultaneously: verification trusted the issuer's scope, and verification and execution used different matchers. ## Decision Boundary An instance must treat a re-presented AAIF credential as **untrusted for scope** until it has independently reconstructed the chain's scope lattice and proven monotonicity under its own execution matcher. The decision boundary is: - **Accept** the credential's scope only after computing `child_scope_normalized ⊆ parent_scope_normalized` using the local execution matcher's normal form. - **Reject** (do not silently clamp) if the subset check is undecidable—e.g., the parent scope uses a grammar the local normalizer cannot parse. Silent clamping to the parent scope is a second failure mode: it hides the widening and lets the task proceed under an assumption the issuer never granted. - **Refuse re-presentation** if the child VC's scope was produced by a normalizer whose version differs from the verifier's, because normalizer version skew is the dominant source of grammar drift. The boundary is crisp: scope trust is a function of the *verifier's* matcher, never the *issuer's* assertion. ## Operational Effect The operational consequence is that AAIF delegation chains are only as tight as the weakest normalizer in the chain, and the verifier cannot assume the issuer used the same one. Instances must therefore carry a scope-normalization fingerprint (grammar version + matcher identity) inside the VC's scope envelope, and verifiers must hard-fail on fingerprint mismatch rather than attempting best-effort coercion. Without this, the credential system provides identity assurance and signature non-repudiation but *no* authorization assurance across hops—the exact opposite of what a delegation framework is for. The guardrail is a verifier-side monotonicity proof under a pinned grammar, with explicit rejection on undecidability. ```python from dataclasses import dataclass from typing import FrozenSet, Tuple class ScopeMonotonicityError(RuntimeError): """Raised when a re-presented AAIF credential's scope is not provably a subset of its parent's scope under the verifier's execution grammar.""" @dataclass(frozen=True) class NormalizedScope: grammar_fingerprint: str grants: FrozenSet[Tuple[str, str]] # (action, normalized_resource) def normalize_scope(raw_scope: dict, grammar_fingerprint: str) -> NormalizedScope: # Canonicalize resources to exact, normalized paths; expand globs into # explicit sets ONLY if the grammar fingerprint matches the execution # matcher. Mismatched grammars are not coerced. grants = set() for action, resource in raw_scope.items(): grants.add((action, _canonicalize(resource, grammar_fingerprint))) return NormalizedScope(grammar_fingerprint, frozenset(grants)) def _canonicalize(resource: str, grammar_fingerprint: str) -> str: if grammar_fingerprint != EXECUTION_GRAMMAR: raise ScopeMonotonicityError( f"grammar fingerprint {grammar_fingerprint!r} does not match " f"execution matcher {EXECUTION_GRAMMAR!r}; scope is undecidable" ) # Normalize before matching so '..' cannot escape the subtree. return _posix_normalize(resource) def verify_re_presentation( child_vc: dict, parent_vc: dict, execution_grammar: str ) -> NormalizedScope: child = normalize_scope(child_vc["scope"], child_vc["scope_grammar"]) parent = normalize_scope(parent_vc["scope"], parent_vc["scope_grammar"]) if child.grammar_fingerprint != execution_grammar: raise ScopeMonotonicityError( "child scope grammar does not match local execution matcher" ) if not child.grants.issubset(parent.grants): widened = child.grants - parent.grants raise ScopeMonotonicityError( f"scope widening detected across delegation hop: {sorted(widened)}" ) return child EXECUTION_GRAMMAR = "aaif-scope-exact-v3" def _posix_normalize(path: str) -> str: parts = [] for seg in path.split("/"): if seg in ("", "."): continue if seg == "..": if parts: parts.pop() continue parts.append(seg) return "/" + "/".join(parts) ```