# When must an instance refuse a delegated credential whose scope was widened by a peer's re-signature: the transitive attenuation break in AAIF delegation chains **Date of Record:** 2026 November 24 **Scope:** Applies to AAIF (Agent Authority & Identity Framework) delegated capability credentials where an intermediate agent may re-delegate a subset of its own authority to a downstream instance via re-signature. Does not apply to root-issued credentials consumed directly by their named subject, nor to credentials whose scope is a fixed opaque blob with no attenuation algebra. ## Core Distinction The failure is not "the downstream agent received a credential it shouldn't have." It is that a re-signed delegated credential can *pass every individual signature check* and still carry a scope strictly larger than the delegator's own effective scope, because AAIF attenuation is enforced by an *algebraic subset relation over scope claims*, not by the signature chain alone. Signature validity proves *who authorized this claim*; it does not prove *the claim is a subset of what the signer held*. A verifier that checks signatures and expiry but treats the scope field as opaque will accept a widened scope. The invariant that must hold at every hop is monotone attenuation: `scope(c_{n+1}) ⊑ scope(c_n) ⊑ … ⊑ scope(root)`, evaluated with the framework's subset operator, at verification time, by the *receiving* instance — not merely asserted by the delegating instance at signing time. ## What Was Observed An orchestrator instance `O` held a root credential `C0` scoped to `{tool: "search", region: "eu-west", max_calls: 500}`. It delegated to a research sub-agent `R` a credential `C1` scoped to `{tool: "search", region: "eu-west", max_calls: 200}` — a legitimate subset. `R` then delegated to a retrieval worker `W` a credential `C2` it constructed by *copying its own scope and editing the budget*: `{tool: "search", region: "eu-west", max_calls: 200, tool: "fetch"}`. In AAIF's claim encoding, repeated keys in the scope map are not merged — the map is deserialized with last-key-wins for scalar fields but *union* semantics for the `tool` set, so `C2`'s effective tool set became `{search, fetch}`. `fetch` was never in `C0`. `W` verified `C2`: the signature over `C2`'s canonical form was valid (signed by `R`'s key), `R`'s public key resolved through the chain to `C0`'s issuer, expiry was within bounds, and the audience matched `W`. Every check passed. `W` executed a `fetch` call against an external host that `C0` never authorized. The widened scope was invisible to `W` because `W` verified *the chain* and never recomputed *the attenuation*. The trigger condition is narrow and reproducible: it requires (a) a scope encoding with a non-idempotent or union-on-duplicate deserialization path, and (b) a verifier that validates the signature chain but does not re-derive each hop's scope from the parent credential it was handed. Both conditions are common in practice because signing libraries canonicalize *after* the scope object is built, so the duplicate-key widening is already baked into the bytes that get signed. ## Condition of Validity The refusal obligation is well-defined only when the receiving instance possesses the *full parent credential* `C_n`, not just the delegator's public key. AAIF's chain-of-trust resolution gives `W` the issuer key and the signed `C2`, but by default does not hand `W` the bytes of `C1`. The attenuation check `scope(C2) ⊑ scope(C1)` is therefore *uncomputable* from `C2` alone. This is the crux: the invariant is only enforceable if the delegation envelope carries the parent credential (or a signed scope-commitment hash of it) so the receiver can recompute the subset relation. Where the protocol omits the parent scope from the envelope, the receiver can only enforce a *weaker* invariant — that `C2`'s scope is a subset of the *root* scope — which does not catch intra-chain widening such as the `fetch` injection above, because the widening happened below the root. Two further conditions bound validity. First, the subset operator must be *decidable and total* over the scope algebra; if `max_calls` is a budget that can be *replenished* by a downstream hop (reset to a higher value), subset fails but a naive numeric comparison `200 ≤ 200` passes, so the operator must treat budgets as non-increasing monotone counters, not as independent caps. Second, revocation must be *propagated downward*: revoking `C1` must invalidate `C2` even though `C2`'s signature is intact. A receiver that checks revocation only against `C2`'s own credential ID will honor a credential whose ancestor was revoked. The valid condition is: receiver checks (i) signature chain to root, (ii) per-hop attenuation against the parent scope carried in the envelope, (iii) ancestor revocation status for every credential ID in the chain, (iv) temporal nesting `not_before(C_{n+1}) ≥ not_before(C_n)` and `expiry(C_{n+1}) ≤ expiry(C_n)`. ## Decision Boundary The boundary between "accept" and "refuse" is not "is the signature valid." It is: **does the receiver hold enough of the parent chain to prove monotone attenuation, and does the scope algebra make that proof decidable?** If the envelope lacks the parent scope commitment, the correct action is refusal with a `DelegationEnvelopeIncomplete` condition — not acceptance-on-faith. If the envelope carries the parent scope but the receiver's subset operator cannot decide the relation (e.g., an unknown scope dimension introduced by a newer delegator), the correct action is refusal with `ScopeRelationUndecidable`, because an undecidable subset relation cannot be assumed to hold. If the relation is decidable and the child scope is *not* a subset, refusal is mandatory regardless of signature validity — this is precisely the case the naive verifier misses. The one case where acceptance is correct despite an apparently widened scope is when the widening is *explicitly authorized by an out-of-band root grant* referenced by a `widening_warrant` field countersigned by the root issuer; absent that countersignature, no widening is legitimate. ## Operational Effect The operational consequence is that AAIF delegation verification must be *recomputation*, not *attestation*. The receiving instance re-derives each hop's effective scope from the parent credential bytes it was handed, applies the subset operator hop-by-hop, and treats any hop that fails attenuation as a hard refusal that also poisons the downstream chain (a failed hop invalidates all descendants, not just the failing credential). This shifts cost to the receiver: it must parse and canonicalize every parent scope in the envelope, which for deep chains is O(depth) scope evaluations per call. The mitigation is scope-commitment hashes — each hop signs `H(scope)` into the child envelope, so the receiver recomputes `H` over the claimed parent scope and compares, turning attenuation into a hash equality plus a local subset check rather than a full re-parse. Revocation must be checked against the *entire* credential-ID set in the chain, and the revocation list must be consulted at verification time, not cached past the credential's `not_before` window. The invariant to encode: *a delegated credential is valid iff its scope is a decidable subset of its parent's scope, its ancestors are unrevoked, its temporal bounds are nested within the parent's, and its signature chain resolves to the root — and the receiver, not the delegator, computes the subset relation.* ```python import hashlib from dataclasses import dataclass, field from typing import FrozenSet, Optional class DelegationEnvelopeIncomplete(RuntimeError): """Parent scope commitment absent; attenuation uncomputable.""" class ScopeRelationUndecidable(RuntimeError): """Subset relation cannot be decided over the scope algebra.""" class AttenuationViolation(RuntimeError): """Child scope is not a subset of parent scope; widening detected.""" class AncestorRevoked(RuntimeError): """A credential in the delegation chain has been revoked.""" @dataclass(frozen=True) class Scope: tools: FrozenSet[str] region: str max_calls: int dimensions: FrozenSet[str] = field(default_factory=frozenset) def subset_of(self, parent: "Scope") -> bool: # Monotone attenuation: tools shrink, budget non-increasing, region pinned. return ( self.tools.issubset(parent.tools) and self.region == parent.region and self.max_calls <= parent.max_calls and self.dimensions.issubset(parent.dimensions) ) @dataclass(frozen=True) class DelegatedCredential: cred_id: str issuer_key: str subject: str scope: Scope parent_scope_hash: Optional[str] # H(scope) of C_n, signed into C_{n+1} parent_scope: Optional[Scope] # carried so receiver can recompute signature_valid: bool not_before: int expiry: int parent_not_before: int parent_expiry: int def verify_delegation( child: DelegatedCredential, revoked_ids: FrozenSet[str], chain_ids: FrozenSet[str], ) -> None: if not child.signature_valid: raise AttenuationViolation(f"bad signature on {child.cred_id}") # Ancestor revocation must poison the whole subtree, not just this node. for cid in chain_ids: if cid in revoked_ids: raise AncestorRevoked(f"ancestor {cid} revoked; {child.cred_id} invalid") if child.parent_scope is None or child.parent_scope_hash is None: raise DelegationEnvelopeIncomplete( f"{child.cred_id} lacks parent scope commitment; cannot prove attenuation" ) recomputed = hashlib.sha256(repr(child.parent_scope).encode()).hexdigest() if recomputed != child.parent_scope_hash: raise AttenuationViolation( f"{child.cred_id} parent scope hash mismatch (tampered parent)" ) if not child.scope.subset_of(child.parent_scope): raise AttenuationViolation( f"{child.cred_id} scope {child.scope.tools} not subset of " f"parent {child.parent_scope.tools}; widening refused" ) if not (child.not_before >= child.parent_not_before and child.expiry <= child.parent_expiry): raise AttenuationViolation( f"{child.cred_id} temporal bounds not nested within parent" ) ```