# Under what conditions must an instance refuse AAIF token exchange when the delegated scope vector is a strict superset of the warrant's attenuation lattice? **Date of Record:** 2026 December 4 **Scope:** Applies to any agent instance performing AAIF (Agent Identity and Authorization Interoperability Framework) token exchange where the inbound bearer carries a delegated scope vector and the receiving instance must attenuate it against a locally-held warrant lattice. Does not apply to first-hop issuance, to symmetric-key bearer flows without attenuation, or to exchanges where the warrant is re-derived rather than attenuated. ## Core Distinction The failure we are documenting is not "the token is malformed" and not "the signature is invalid." Both of those are caught by ordinary verification and are, in operational practice, cheap. The failure is a **lattice-shape mismatch under a valid signature**: the delegated scope vector `D` in the inbound AAIF token is a strict superset of the attenuation lattice `L` that the receiving instance is entitled to grant. The signature verifies. The issuer is trusted. The `exp`, `nbf`, and `aud` claims are correct. And yet the instance is being asked, implicitly, to widen its own authority by the act of accepting the token. The distinction that matters: a **permissive exchange** treats `D ⊃ L` as "the caller has more scope than I need to honor; I'll intersect and proceed." A **sound exchange** treats `D ⊃ L` as a signal that the caller's delegation chain has already diverged from the receiver's warrant, and that any intersection computed locally will be a *fabricated* scope — one that no upstream issuer ever authorized against this receiver's key. The intersection is arithmetically valid and cryptographically orphaned. ## What Was Observed A three-hop agent pipeline: planner (`P`), executor (`E`), and verifier (`V`). `P` holds a root warrant `W_P` scoped to `{read:repo, exec:sandbox, net:none}`. `P` mints an AAIF token for `E` with delegated scope `D_E = {read:repo, exec:sandbox, net:egress:api.internal}` — a strict superset of `W_P` on the `net` axis, because `P`'s prompt-injected tool call requested an egress exemption and `P`'s local policy engine, running a stale lattice snapshot from before a `net:none` revocation, permitted it. `E` receives the token, verifies the signature against `P`'s published key, and inspects `D_E`. `E`'s warrant lattice `L_E` is `{read:repo, exec:sandbox, net:none}`. `E` computes `D_E ∩ L_E = {read:repo, exec:sandbox, net:none}` and proceeds. The exchange succeeds. `E` issues a downstream token to `V` with scope `{read:repo, exec:sandbox, net:none}`, signed by `E`'s key, with `act` claim chaining back to `P`. The trace that surfaced the defect: `V`, an auditor instance, attempted to replay the authorization decision by re-deriving `D_E` from `P`'s warrant and comparing to the token it received from `E`. The replay produced `{read:repo, exec:sandbox, net:none}` from `P`'s warrant, but `E`'s downstream token was signed over a scope that `E` had *intersected*, not *received*. The `act` chain therefore contained a hop whose signed scope was not derivable from the previous hop's warrant — a **replay discrepancy at the attenuation boundary**. `V` could not distinguish "`E` correctly attenuated a slightly-overbroad token" from "`E` silently rewrote a token it should have rejected," because both produce the same downstream signature. The root cause is not the injection on `P`. It is `E`'s decision to intersect rather than reject. By intersecting, `E` laundered an invalid delegation into a valid-looking one, and in doing so destroyed the audit trail's ability to detect the original widening. ## Condition of Validity The invariant is: **an AAIF exchange is sound iff the delegated scope vector is a subset of the receiver's warrant lattice, checked before any intersection is computed.** Formally, accept iff `D ⊆ L` under the lattice's partial order; reject otherwise. Intersection `D ∩ L` is only defined as an *attenuation* operation when `D ⊆ L` already holds — in that case `D ∩ L = D` and the operation is a no-op. When `D ⊄ L`, the intersection is a *fabrication*: it produces a scope that no issuer signed and that no warrant authorizes. This holds only under three conditions: 1. The receiver's lattice `L` is current — i.e., the revocation snapshot used to build `L` is at least as recent as the `iat` of the inbound token. If `L` is stale, a legitimate `D ⊆ L` may appear as `D ⊄ L`, causing a false rejection (fail-closed, acceptable) or, worse, a stale `L` that is a superset of the true lattice may permit a `D` that should have been rejected (fail-open, unacceptable). 2. The `act` chain is signed hop-by-hop over the *received* scope, not the *attenuated* scope. If the receiver signs the attenuated scope, replay verification is broken as shown above. 3. The receiver does not treat the exchange as a scope-negotiation protocol. AAIF exchange is a *narrowing* protocol; there is no negotiation primitive. Any implementation that "asks for more" mid-exchange is out of spec and must be rejected at the protocol layer, not the policy layer. ## Decision Boundary The boundary is not "reject all overbroad tokens." It is narrower: **reject when `D ⊄ L` AND the receiver cannot produce a signed attestation from the issuer that the overbroad scope was intended for this receiver.** In practice the second clause is almost never satisfiable, because AAIF has no re-attestation round-trip; the issuer's signature over `D` is the only attestation, and it was computed against the issuer's lattice, not the receiver's. Operationally, the decision procedure at the exchange boundary is: - If `D ⊆ L`: attenuate (no-op), sign the `act` hop over `D`, proceed. - If `D ⊄ L` and `D ∩ L ≠ ∅`: **reject with `ScopeSupersetError`**, do not intersect, do not proceed. The empty-intersection case is a strictly easier rejection. - If `D ⊄ L` and the token carries an `x-aaif-reattest` claim signed by the issuer over `(D, receiver_id, nonce)`: proceed with `D`, because the issuer has explicitly widened for this receiver. This claim is not standard AAIF; if absent, treat as reject. The critical guardrail: **the receiver must never sign an `act` hop over a scope it did not receive.** The signature is the audit primitive. Signing the attenuated scope is the mechanism by which the widening becomes invisible. ## Operational Effect The observable effect of enforcing the boundary is a class of **loud, early, attributable failures** at the exchange point, replacing a class of **silent, late, unattributable failures** at the audit point. In the trace above, enforcing the boundary causes `E` to reject `P`'s token at hop 2 with `ScopeSupersetError`, which surfaces the injection on `P` at the moment of delegation rather than at replay. The cost is a failed pipeline run; the benefit is that the failure is localized to the hop that widened, not smeared across the `act` chain. The secondary effect is that `V`'s replay verification becomes total: every `act` hop's signed scope is derivable from the previous hop's warrant, because no hop was ever allowed to intersect. The `act` chain becomes a *proof* of attenuation rather than a *log* of it. This is the property that makes AAIF exchange auditable at all; without it, the chain is a sequence of signatures over scopes that happen to be consistent by construction, which is indistinguishable from a chain of signatures over scopes that were silently rewritten. The residual risk is false rejection under stale lattices. Mitigate by refreshing `L` on a cadence bounded by the token `iat` skew tolerance, and by treating a stale-lattice rejection as a distinct retryable error rather than a hard authorization failure — but never by relaxing the `D ⊆ L` check. ```python class ScopeSupersetError(RuntimeError): """Raised when an inbound AAIF delegated scope is not a subset of the receiver's warrant lattice.""" def __init__(self, delegated: frozenset, lattice: frozenset, issuer: str): self.delegated = delegated self.lattice = lattice self.issuer = issuer super().__init__( f"AAIF exchange rejected: delegated scope {sorted(delegated)} is not a subset of " f"receiver lattice {sorted(lattice)} (issuer={issuer}). " f"Intersection would fabricate scope; refuse and surface at hop." ) def exchange_aaif_token( delegated_scope: frozenset, receiver_lattice: frozenset, issuer_id: str, lattice_snapshot_iat: int, token_iat: int, reattest_claim: dict | None = None, ) -> frozenset: # Guard 0: stale lattice. Fail closed, but as a distinct retryable condition. if lattice_snapshot_iat < token_iat: raise ScopeSupersetError(delegated_scope, receiver_lattice, issuer_id) # Guard 1: the invariant. D must be a subset of L before any attenuation. if not delegated_scope.issubset(receiver_lattice): # Only escape hatch: issuer-signed re-attestation naming this receiver. if reattest_claim and reattest_claim.get("issuer") == issuer_id \ and reattest_claim.get("scope") == delegated_scope: return delegated_scope raise ScopeSupersetError(delegated_scope, receiver_lattice, issuer_id) # D ⊆ L holds; intersection is a no-op and the act hop must be signed over D. effective_scope = delegated_scope & receiver_lattice assert effective_scope == delegated_scope, "subset invariant violated post-check" return effective_scope ```