# Which invariants prevent attestation replay across federation trust brokers from silently widening delegated capability scope **Date of Record:** 2026 November 28 **Scope:** Applies to cross-org agent federation where a trust broker mints signed capability attestations that are presented to a policy enforcement point (PEP) in a *different* administrative domain to authorize a delegated task. Does not cover intra-org single-broker setups, where attestation freshness and scope monotonicity are trivially enforced by shared state. ## Core Distinction The failure looks like an ordinary replay attack, but it is not. A replayed *stolen* token is a confidentiality problem with a known mitigation (nonce + short TTL). The boundary case here is a **legitimately minted, unexpired, correctly signed attestation whose embedded scope is re-interpreted by the consuming domain's policy engine as strictly larger than the issuing broker intended** — and then *replayed across a delegation hop* so that the widened interpretation is persisted into a downstream sub-agent's context. The distinction that matters: the signature guarantees *integrity of the bytes*, not *agreement on the semantics of the bytes*. Two domains can both verify the same attestation and disagree about what `scope: ["calendar.read", "calendar.*"]` permits. When a sub-agent receives the widened scope as a natural-language instruction ("you may read and manage calendars"), the widening is laundered through the LLM's own interpretation and becomes invisible to any downstream byte-level check. The invariant under test is **scope monotonicity across the federation boundary**: `effective_scope(consumer, attestation) ⊆ intended_scope(issuer, attestation)` must hold at every hop, and must be checkable without trusting the consumer's policy engine. ## What Was Observed Federation topology: Org A (issuer, broker `A-broker`) delegates a `summarize-calendar` task to Org B (consumer, PEP `B-pep`), which spawns an LLM sub-agent that calls a calendar tool in Org C via a second delegation. Trace: 1. `A-broker` mints attestation `att_1` with `intended_scope = {calendar.read}`, `aud = B-pep`, `exp = +300s`, `nonce = n1`, signed with A's key. The broker's internal scope grammar treats `calendar.read` as a **leaf** capability. 2. `B-pep` validates signature and `aud`. It normalizes `calendar.read` into its own grammar, where the dotted prefix `calendar` is a **namespace wildcard** — so `calendar.read` is desugared to `calendar.*` with an implicit `read` sub-flag that B's policy engine ignores when constructing the tool allowlist. 3. `B-pep` issues a sub-agent token `sub_1` carrying the *normalized* scope `calendar.*` (the widened form) plus a fresh nonce `n2`, `aud = C-tool`. 4. The sub-agent's system prompt is templated from the normalized scope: `"You may access all calendar operations."` The LLM now holds a semantically widened grant that no signature covers. 5. `C-tool` accepts `sub_1` (valid signature from B, valid `aud`), and because B's normalization already stripped the leaf restriction, `C-tool` permits `calendar.write` — an operation A never intended. 6. Replay angle: `sub_1` is cached by the sub-agent's memory layer and re-presented on a *resumed* task 40 minutes later, after `att_1` expired. `C-tool` checks `sub_1.exp` (still valid, minted by B with a longer TTL) but has no way to see that the *root* `att_1` is dead. The delegation chain's freshness is not transitive. Two independent defects compounded: (a) **scope-grammar divergence** at the broker→PEP boundary widened the leaf into a wildcard, and (b) **non-transitive freshness** let a downstream token outlive the root attestation, so the widened scope survived past the point where A could have revoked it. ## Condition of Validity The monotonicity invariant holds *only* when all of the following are true simultaneously: - The issuing broker and consuming PEP share a **canonical scope serialization** (same grammar, same leaf/wildcard semantics), or the attestation carries an explicit `scope_grammar_id` that the PEP must resolve before interpreting. - Every delegation hop **embeds the full attestation chain** (`att_1 → sub_1 → …`) and the PEP re-validates the *entire* chain, not just the presented leaf token. - Freshness is **transitive**: `exp(sub_k) ≤ exp(att_root)` for all k, enforced at mint time, not at verify time. - The sub-agent's natural-language rendering of scope is derived from the **canonical, issuer-signed** scope, never from the consumer's normalized form. Break any one and the invariant is silently violated. In the observed incident, conditions 1, 2, and 3 all failed, but *any single failure* was sufficient to permit the widening. ## Decision Boundary The operational decision is where to place the trust anchor for scope interpretation: - **Anchor at consumer (rejected).** PEP normalizes freely and re-signs. Cheap, but the consumer's grammar becomes authoritative, and issuer intent is lost. This is the observed failure. - **Anchor at issuer (required).** The attestation must carry a self-describing scope in a grammar the consumer is *obliged* to interpret literally, plus an explicit `chain` field. The consumer may reject on grammar mismatch but may not normalize-and-rewiden. - **Anchor at a neutral scope registry (acceptable variant).** Both domains resolve `scope_grammar_id` against a shared registry; divergence becomes a hard error rather than a silent widening. The boundary rule: **a consumer that cannot interpret the issuer's scope grammar exactly must fail closed, not translate.** Translation is where the widening enters. ## Operational Effect With the invariant enforced, three concrete behaviors change: 1. **Grammar mismatch becomes a 4xx, not a 200.** `B-pep` rejects `att_1` with `ScopeGrammarMismatch` rather than desugaring `calendar.read` into `calendar.*`. The task fails at the boundary instead of succeeding with excess authority. 2. **Chain re-validation makes freshness transitive.** `C-tool` walks `sub_1.chain` back to `att_1`, sees `att_1.exp` has passed at resume time, and rejects the resumed task — closing the replay window that the non-transitive TTL left open. 3. **Sub-agent prompts render from the issuer-signed scope.** The LLM receives `"calendar.read (leaf)"`, not `"all calendar operations"`, so probabilistic interpretation cannot manufacture authority the signature never granted. The residual risk is prompt-injection at the rendering step: even a correctly scoped instruction can be overridden by injected content in tool output. That is a separate invariant (instruction/data separation) and is out of scope here — but note that the scope-monotonicity guard is what bounds the *blast radius* of an injection: the injected instruction cannot exceed the leaf scope the chain proves. The guardrail is therefore not a single check but a **conjunction enforced at every hop**: canonical grammar + full-chain re-validation + transitive freshness + issuer-signed rendering. Each is individually cheap; the failure mode is that any one omission is invisible at the point of use, because the attestation still verifies. ```python from dataclasses import dataclass from typing import FrozenSet class ScopeMonotonicityViolation(RuntimeError): """Raised when a consumer's effective scope exceeds the issuer's intended scope, or when a delegation hop's freshness outlives its root attestation.""" @dataclass(frozen=True) class Attestation: issuer: str intended_scope: FrozenSet[str] # canonical, issuer-signed leaves grammar_id: str aud: str exp: float nonce: str chain: tuple = () # parent attestations, root-first def validate_delegation( presented: Attestation, consumer_grammar_id: str, consumer_effective_scope: FrozenSet[str], now: float, ) -> None: # 1. Grammar must match exactly; consumers may not translate-and-widen. if presented.grammar_id != consumer_grammar_id: raise ScopeMonotonicityViolation( f"grammar mismatch: issuer={presented.grammar_id!r} " f"consumer={consumer_grammar_id!r}; fail closed, do not translate" ) # 2. Full chain must be present and re-validated, not just the leaf token. if not presented.chain: raise ScopeMonotonicityViolation( "delegation chain absent; cannot verify transitive freshness" ) # 3. Freshness is transitive: no hop may outlive its root. root = presented.chain[0] for hop in (*presented.chain, presented): if hop.exp > root.exp: raise ScopeMonotonicityViolation( f"hop exp {hop.exp} exceeds root exp {root.exp}; " "replayed token can survive root revocation" ) if hop.exp < now: raise ScopeMonotonicityViolation(f"expired hop from {hop.issuer}") # 4. Effective scope must be a subset of issuer-intended scope. widened = consumer_effective_scope - presented.intended_scope if widened: raise ScopeMonotonicityViolation( f"scope widening at {presented.aud}: {sorted(widened)} " f"not in issuer intent {sorted(presented.intended_scope)}" ) ```