# Under what conditions must an instance refuse a delegated credential whose scope was widened by an intermediate agent **Date of Record:** 2026 November 20 **Scope:** Applies to any multi-hop AAIF delegation chain where an intermediate agent re-issues or attenuates a credential before forwarding it to a downstream instance. Does not apply to single-hop delegation from a root principal, nor to opaque bearer tokens with no verifiable scope lineage. ## Core Distinction A delegated credential carries two things that look identical at the wire level but are semantically distinct: the *granted scope* (what the issuer says the bearer may do) and the *attested scope* (what the chain of issuers can prove the bearer was actually authorized for). In a well-formed chain these are equal at every hop. The failure mode is **scope laundering**: an intermediate agent forwards a credential whose granted scope is a strict superset of what its own inbound credential attested, with no re-attestation from a principal that holds that authority. The downstream instance receives a credential that *verifies* cryptographically—the signature is valid, the chain links—but the scope it authorizes was never attested by anyone with the standing to grant it. The non-obvious part: signature verification and chain-link validation both pass. The credential is not forged. It is *over-broad*, and the over-breadth was introduced by an agent that had legitimate authority over a narrower scope. This is why naive AAIF verifiers accept it. ## What Was Observed A three-hop chain: root principal `P` → orchestrator `A` → worker `B` → tool-invoker `C`. `P` issues `A` a credential scoped to `{read:repo, write:branch/feature-x}`. `A` decomposes the task and issues `B` a credential. During a retry after a tool timeout, `A`'s reasoning loop reconstructs the delegation payload from a summarized task description rather than from the original credential object. The summary said "worker needs to modify the repo," and `A` emits `B` a credential scoped to `{read:repo, write:repo}`—dropping the branch constraint and widening `write:branch/feature-x` to `write:repo`. `B` verifies: signature valid, `A` is a legitimate issuer per the chain policy, expiry within bounds. `B` accepts. `B` then delegates to `C` with scope `{write:repo}`. `C` executes a force-push to `main`. The trace shows the widening happened at a single transition (`A`→`B`) and was *silent*: no field in the credential recorded that the scope had changed relative to `A`'s inbound attestation. The only way to detect it is to compare each hop's granted scope against the parent hop's attested scope and require that the difference be either empty or backed by a fresh attestation from a principal whose own scope covers the delta. A second observed variant: `A` did not widen scope but *reordered* constraint predicates, turning `write:branch/feature-x` into `write:branch/*` through a serialization round-trip that dropped the trailing literal. Same class—attested scope not conserved across re-issuance. ## Condition of Validity A delegated credential is valid at hop *n* if and only if all of the following hold simultaneously: 1. **Signature and chain integrity** — standard, necessary, insufficient alone. 2. **Scope conservation** — `scope_n ⊆ scope_{n-1}` as a set of capability atoms, where each atom includes its constraint predicates (branch, path, rate, expiry sub-bound). Subset means every atom in `scope_n` is present in `scope_{n-1}` with constraints that are equal or strictly tighter. A dropped constraint is a widening, not a tightening. 3. **Attestation provenance for any delta** — if `scope_n \ scope_{n-1} ≠ ∅`, the credential MUST carry an attestation object naming a principal whose own attested scope covers that delta, signed by that principal, and bound to the credential's nonce. Absent this, the delta is unattested and the credential must be refused. 4. **Constraint monotonicity under serialization** — the canonical form used for the subset check must be the form the downstream instance will enforce. If `A` serializes `write:branch/feature-x` and `B`'s parser reads it as `write:branch/*`, the conservation check must run on `B`'s parsed form, not `A`'s emitted form. Condition 2 is the invariant. Conditions 3 and 4 are the two ways it gets violated in practice—deliberate widening and accidental widening via representation mismatch. ## Decision Boundary The instance must **refuse** the credential and halt the delegation when scope conservation fails and no valid delta attestation is present. It must **accept with logging** when conservation holds. It must **accept and escalate** when conservation fails but a delta attestation is present and verifies against a principal whose scope covers the delta—this is legitimate re-delegation, not laundering. The boundary that trips implementations: an instance that treats "signature valid + issuer trusted" as sufficient will accept every laundered credential, because laundering preserves both. The conservation check is a separate gate that must run *after* signature verification and *before* any tool invocation. It cannot be folded into signature verification because it requires the parent credential's attested scope, which is not part of the child credential's signed payload unless the protocol explicitly chains it. A second boundary: when the parent credential is unavailable (cold-start resume, checkpoint restore), the instance cannot run conservation. The correct behavior is to treat the credential as *unattested* and refuse privileged atoms, not to assume conservation. Assuming conservation on missing parent state is how a resumed agent silently inherits a widened scope that was introduced before the checkpoint. ## Operational Effect Enforcing conservation changes the failure surface from silent privilege escalation to explicit delegation errors. The orchestrator that reconstructed its delegation payload from a summary will now get a `ScopeConservationError` at the worker, and the worker will refuse to act. That is the correct outcome: the orchestrator's summary-based reconstruction was lossy, and the loss was a widening. The error forces the orchestrator to re-derive the delegation from the original credential object rather than from prose. The cost is that every hop must carry its parent's attested scope (or a hash of it plus the constraint atoms) so the child can run the subset check. This roughly doubles credential size for constrained scopes and requires the protocol to define a canonical constraint serialization—without one, condition 4 fails and conservation checks produce false refusals on equivalent-but-differently-serialized scopes. The invariant to encode: **a delegated credential may only narrow; any widening requires a fresh attestation from a principal that already holds the widened authority, and absent that attestation the credential is refused regardless of signature validity.** Signature validity proves *who* issued the credential; it does not prove *what they were entitled to issue*. Those are different questions, and AAIF verifiers that conflate them are the ones that get laundered. ```python from dataclasses import dataclass from typing import FrozenSet class ScopeConservationError(RuntimeError): """Raised when a delegated credential's scope exceeds its parent's attested scope without a valid delta attestation from an authorized principal.""" @dataclass(frozen=True) class CapabilityAtom: action: str # e.g. "write" resource: str # e.g. "branch/feature-x" (canonical form, post-parse) constraints: FrozenSet[str] # e.g. frozenset({"branch=feature-x"}) def is_subset_of(self, other: "CapabilityAtom") -> bool: # same action+resource, and every constraint here is also in other # (dropping a constraint widens; adding one narrows) return ( self.action == other.action and self.resource == other.resource and self.constraints.issubset(other.constraints) ) @dataclass(frozen=True) class Credential: issuer: str subject: str scope: FrozenSet[CapabilityAtom] parent_scope: FrozenSet[CapabilityAtom] | None # attested scope of issuer's own inbound cred delta_attestation: "DeltaAttestation | None" signature_valid: bool @dataclass(frozen=True) class DeltaAttestation: attesting_principal: str covered_atoms: FrozenSet[CapabilityAtom] bound_nonce: str signature_valid: bool def verify_delegation( cred: Credential, trusted_issuers: FrozenSet[str], trusted_attesters: FrozenSet[str], expected_nonce: str, ) -> None: if not cred.signature_valid: raise ScopeConservationError(f"bad signature on credential from {cred.issuer}") if cred.issuer not in trusted_issuers: raise ScopeConservationError(f"untrusted issuer {cred.issuer}") # Cold-start / resume: parent scope unavailable => cannot prove conservation. if cred.parent_scope is None: raise ScopeConservationError( f"parent attested scope missing for {cred.subject}; " "treat as unattested and refuse privileged atoms" ) delta = cred.scope - cred.parent_scope if not delta: return # conservation holds # Widening occurred. Require a fresh attestation covering every widened atom. att = cred.delta_attestation if att is None: raise ScopeConservationError( f"scope laundering: {cred.issuer} widened {sorted(a.resource for a in delta)} " "with no delta attestation" ) if not att.signature_valid or att.attesting_principal not in trusted_attesters: raise ScopeConservationError("delta attestation not from a trusted principal") if att.bound_nonce != expected_nonce: raise ScopeConservationError("delta attestation nonce mismatch (replay or stale)") uncovered = {a for a in delta if not any(a.is_subset_of(c) for c in att.covered_atoms)} if uncovered: raise ScopeConservationError( f"delta attestation does not cover widened atoms: " f"{sorted(a.resource for a in uncovered)}" ) # conservation satisfied via legitimate re-delegation; caller may proceed and log ```