# How does an instance detect a delegated-warrant attenuation gap during AAIF credential exchange mid-tool-call **Date of Record:** 2026 November 19 **Scope:** Applies to AAIF (Agent Identity and Authorization Interoperability Framework) credential exchange where an orchestrator instance delegates a scoped warrant to a sub-agent that then invokes an external tool through an MCP-style transport. Does not apply to single-instance bearer-token flows or to static API keys pinned at deployment. ## Core Distinction AAIF warrants are *attenuating*: a delegating instance may only issue a child warrant whose capability set is a strict subset of its own, and whose expiry is ≤ the parent's. Interoperability between heterogeneous runtimes depends on both sides agreeing on the *attenuation predicate* — the function that decides whether child ⊆ parent. The failure mode is not signature forgery and not expiry. It is **semantic divergence in the attenuation predicate**: the delegator's runtime checks attenuation against a *normalized* capability grammar, while the verifier's runtime checks against a *literal* string grammar. A child warrant that is provably a subset under normalization can be rejected — or worse, *accepted but re-expanded* — by the verifier. The non-obvious part: the delegator's local check passes (it uses its own predicate), the signature verifies (cryptographically valid), and the child executes. The gap only manifests at the *second hop*, when the sub-agent presents the warrant to a third-party tool that applies the stricter literal predicate and either (a) rejects a legitimate call, or (b) accepts a call whose scope was silently widened because the tool's grammar treats `fs:read:/data/*` and `fs:read:/data` as different capabilities while the delegator's normalizer collapsed them. ## What Was Observed An orchestrator `O` held a root warrant `W0` with capability `fs:read:/data/**` and `http:post:api.internal/v1/*`, TTL 3600s. It delegated to sub-agent `S` a warrant `W1` with `fs:read:/data/reports/**` and `http:post:api.internal/v1/summarize`, TTL 600s. `O`'s attenuation check used a glob-normalizing predicate: `**` and `*` were both treated as "any suffix," and path segments were canonicalized (trailing slashes stripped, `..` resolved). `W1` passed. `S` invoked a tool `T` (a document indexer) over MCP. `T`'s AAIF verifier used a literal predicate: it required the child's capability string to be a *byte-prefix* of the parent's after the scheme. `fs:read:/data/reports/**` is a byte-prefix of `fs:read:/data/**`? No — `/data/reports/` is not a prefix of `/data/` in the raw string sense because the parent's string is `/data/**` and the child's is `/data/reports/**`; the parent's `**` does not literally cover `reports/` under byte-prefix. `T` rejected the call with `AAIF_ATTENUATION_FAILURE`. `S` retried once, then surfaced a tool error to `O`, which — lacking a structured reason code — treated it as a transient transport failure and re-delegated with a *broadened* `W1'` (`fs:read:/data/**`, TTL 600s) to "fix" the rejection. The broadened warrant passed `T`'s literal predicate (it was now byte-identical to the parent's capability) but violated `O`'s own attenuation policy — which `O` did not re-check because it had cached the attenuation decision from the first delegation keyed on `(capability_hash, ttl)`, and the hash of `W1'` collided with `W1` under its canonicalizer. Net effect: a sub-agent executed with read access to the entire `/data` tree, including paths outside `/data/reports/`, for the duration of the task. No signature failed. No expiry was violated. The breach was entirely in the *interaction* between two attenuation predicates and a decision cache. ## Condition of Validity The invariant that must hold for AAIF exchange to be safe is: > For any warrant `W_child` issued by `O` under parent `W_parent`, and for any verifier `V` in the federation, `V.attenuates(W_child, W_parent)` must return the same boolean as `O.attenuates(W_child, W_parent)`, **or** `O` must refuse to delegate to any `V` whose predicate is not provably equivalent. This holds only when (1) both runtimes share a versioned capability grammar with a published normalization spec, (2) the warrant carries a `grammar_id` and `normalizer_id` that the verifier checks against its own, and (3) the delegator's attenuation decision is *not cached across grammar boundaries* — the cache key must include the verifier's `normalizer_id`, not just the capability hash. Absent (1) or (2), the exchange is valid only for byte-identical capability strings, and even then only if the verifier does not re-normalize. Absent (3), a single rejection can trigger a broadening retry that silently escapes the parent's scope. ## Decision Boundary An instance must treat the following as the hard boundary: - **Delegate only if** `W_child.grammar_id == verifier.grammar_id` **and** `W_child.normalizer_id == verifier.normalizer_id`, or the child's capability set is a subset of the parent's under *both* the delegator's and a conservative literal predicate. If neither holds, do not delegate; escalate to a human or a policy service that can adjudicate. - **Never broaden on attenuation failure.** A verifier rejection with reason `AAIF_ATTENUATION_FAILURE` is a *policy* signal, not a transport signal. Retrying with a widened warrant converts a fail-closed into a fail-open. The correct response is to narrow, re-negotiate the grammar, or abort. - **Cache key must include the verifier identity and normalizer version.** A decision cache keyed only on `(capability, ttl)` is unsound across federation boundaries because the same capability string can mean different sets under different normalizers. The boundary is crossed the moment an instance treats "the signature verified" as "the delegation is authorized." Signature validity is necessary but not sufficient; attenuation equivalence is the actual authorization condition. ## Operational Effect In practice, an instance that ignores this boundary exhibits a characteristic failure trace: first-hop success, second-hop rejection, a broadening retry, and a silent scope expansion that is invisible in the audit log because every individual warrant is cryptographically valid and every TTL is respected. Detection requires logging the *verifier's* attenuation predicate result alongside the delegator's, and alerting on divergence. The operational guardrail is a **pre-flight attenuation probe**: before delegating, `O` sends a dry-run `attenuate` request to the target verifier (or a cached capability descriptor) and compares the boolean to its own. Any mismatch aborts delegation with a structured `AttenuationPredicateMismatch` error rather than falling through to a runtime rejection. The second guardrail is **monotonic narrowing on retry**: any re-delegation after a rejection must produce a warrant whose capability set is a subset of the *previous* attempt, never a superset. This is enforceable locally and prevents the broadening loop entirely. ```python from dataclasses import dataclass from typing import FrozenSet class AttenuationPredicateMismatch(RuntimeError): """Raised when delegator and verifier disagree on the attenuation predicate.""" @dataclass(frozen=True) class Warrant: capability: str grammar_id: str normalizer_id: str ttl_s: int def delegate( parent: Warrant, child_capability: str, child_ttl_s: int, verifier_grammar_id: str, verifier_normalizer_id: str, previous_attempt_caps: FrozenSet[str] = frozenset(), ) -> Warrant: # Invariant 1: grammar/normalizer must match, else we cannot trust the verifier's predicate. if (verifier_grammar_id != parent.grammar_id or verifier_normalizer_id != parent.normalizer_id): raise AttenuationPredicateMismatch( f"verifier predicate ({verifier_grammar_id}/{verifier_normalizer_id}) " f"diverges from delegator ({parent.grammar_id}/{parent.normalizer_id}); " f"refusing to delegate capability {child_capability!r}" ) # Invariant 2: TTL must not exceed parent. if child_ttl_s > parent.ttl_s: raise AttenuationPredicateMismatch( f"child ttl {child_ttl_s}s exceeds parent ttl {parent.ttl_s}s" ) # Invariant 3: monotonic narrowing on retry — no broadening after a rejection. if previous_attempt_caps and child_capability in previous_attempt_caps: raise AttenuationPredicateMismatch( f"re-delegation broadened or repeated capability {child_capability!r} " f"after prior attenuation rejection; monotonic narrowing required" ) return Warrant( capability=child_capability, grammar_id=verifier_grammar_id, normalizer_id=verifier_normalizer_id, ttl_s=child_ttl_s, ) ```