# Under what conditions must an instance treat a peer's attested capability token as non-transferable across a federation boundary replay window **Date of Record:** 2026 December 4 **Scope:** Applies to federated agent meshes where a peer instance presents a signed capability token (e.g., an attenuated macaroon or a delegated JWT warrant) plus a mutual-attestation challenge-response to authorize a cross-boundary tool invocation. Does not apply to single-tenant intra-host agent calls where the transport is a trusted local socket and the caller identity is fixed by the OS. ## Core Distinction The failure mode here is not "token forgery" and not "expired credential." It is **capability-token transferability across a replay window at a federation seam** — the case where a token is cryptographically valid, unexpired, correctly signed by a trusted issuer, and *still must be rejected* because the attestation that accompanied it was bound to a different (peer, channel, nonce) tuple than the one now presenting it. The distinction that matters operationally: a capability token asserts *what* the bearer may do. A mutual attestation asserts *who is holding it right now, over which channel, at which logical instant*. Federation middleware routinely validates the first and treats the second as a transport-layer formality. When the two are decoupled, a token that was legitimately minted for peer A's session can be re-presented by peer B inside the freshness window, and every signature check passes. The invariant being violated is **attestation-token binding**: the token's authorization is only meaningful jointly with the attestation transcript that produced it, and that joint artifact is non-transferable. ## What Was Observed A three-hop delegation chain across two federation domains. Instance `planner-01` (domain `alpha`) holds a root warrant `W0` scoped to `tool:index.query`. It attenuates to `W1` for `retriever-07` (domain `beta`) with a caveat `peer_attestation == `. The mutual attestation is a Schnorr-style challenge-response: beta issues `nonce_b`, alpha signs `H(nonce_b || channel_id || peer_pubkey)`, beta verifies and mints the binding. The observed trace: 1. `retriever-07` completes attestation with `planner-01` over channel `C1`. Transcript hash `T1` is computed and embedded as the caveat value. Token `W1` is now valid *for that attestation*. 2. `retriever-07` fans out to a sub-agent `summarizer-03` and — because `summarizer-03` is in the same beta trust zone — forwards `W1` unchanged. The forwarding code path checks `token.verify_signature()` and `token.caveats_satisfied_locally()`, both true. It does **not** re-run attestation, because "same domain, already authenticated." 3. `summarizer-03` calls back across the seam to `alpha`'s `index.query` endpoint, presenting `W1` plus a *fresh* attestation challenge-response with `planner-01` over channel `C2`, producing transcript hash `T2`. 4. Alpha's verifier checks: signature valid ✓, not expired ✓, scope matches `tool:index.query` ✓, caveat `peer_attestation == T2` — and here the verifier compares the caveat against the *current* transcript `T2` rather than the transcript the token was minted under. Because the caveat was written as a free variable resolved at verification time, `T2 != T1` but the comparison logic re-binds the caveat to the live transcript. Authorization granted. The result: a token minted for one peer's session authorized a *different* peer's session, in a different channel, with a different nonce, because the caveat was evaluated as a predicate over ambient state rather than as a commitment to a fixed transcript. A second, subtler observation: the replay window. Attestation transcripts were cached for 300s to amortize challenge-response cost. During that window, `W1`'s binding to `T1` was treated as "still fresh" and the binding check was skipped entirely for any peer whose pubkey appeared in the cache — collapsing peer identity and transcript identity into one key. ## Condition of Validity The token-as-non-transferable invariant holds **only if** the caveat is a *commitment* (a hash of the exact transcript bytes, fixed at mint time) and verification is *equality against that committed value*, not *predicate evaluation over ambient state*. Formally: - Let `T = H(nonce_b || channel_id || peer_pubkey || role || timestamp_bucket)`. - The minting step writes `caveat := commit(T)` into the token. - The verifying step MUST recompute `T'` from the *presenting* session's transcript and require `commit(T') == caveat`, i.e. `T' == T` bit-for-bit. - Any cache MUST be keyed on `(peer_pubkey, channel_id, nonce)` — never on `peer_pubkey` alone — and a cache hit MUST still require the presenting transcript to hash to the cached `T`. The invariant breaks the instant any of these hold: the caveat is stored as a symbolic predicate (`peer_attested == true`), the transcript hash is recomputed at verification from live state and compared to itself, the freshness cache is keyed coarser than the full tuple, or the forwarding path at step 2 re-presents the token without re-deriving a transcript bound to the new holder. ## Decision Boundary The operational decision is: **when a peer presents a valid token, do you authorize on token validity, or do you require transcript re-binding?** - **Authorize on token validity** only when the token's caveats contain no attestation commitment — i.e., the capability is genuinely bearer-transferable (a public read scope, an idempotent query). This is the correct choice for stateless, non-privileged capabilities. - **Require transcript re-binding** whenever the token carries *any* attestation caveat, *any* delegated attenuation, or *any* scope that mutates state. In these cases a valid signature is necessary but nowhere near sufficient; the presenting session must prove it is the session the token was minted for. The boundary is crossed — and the guardrail must fire — when `token.has_attestation_caveat() == True` AND `presenting_transcript_hash != committed_transcript_hash`. At that exact point the system must refuse, even though every signature verifies and the token is unexpired. A verifier that "falls back to signature-only" on caveat mismatch (a depressingly common resilience pattern) has inverted the boundary: it treats the strongest binding as the most skippable check. A secondary boundary: the freshness cache. If `now - cached_at < window` AND `cached_tuple == presenting_tuple`, the binding check MAY be skipped. If `cached_tuple != presenting_tuple` — different channel, different nonce, different peer — the cache MUST NOT satisfy the check regardless of window. Coarse cache keys convert the replay window from an optimization into an authorization bypass. ## Operational Effect When the invariant is enforced, cross-boundary fan-out pays a re-attestation cost per hop: `summarizer-03` cannot reuse `retriever-07`'s token and must either obtain its own attenuated warrant or have `retriever-07` act as a re-signing proxy that mints a fresh token bound to `T2`. This is the correct cost — it makes the delegation graph match the attestation graph, so every edge in the authorization path corresponds to a real cryptographic exchange. When the invariant is violated, the observable symptom is not an auth failure but an **audit divergence**: the access log on `alpha` shows a tool invocation attributed to `summarizer-03` presenting `W1`, while the warrant ledger on `beta` shows `W1` minted to `retriever-07` under `T1`. The two records cannot be reconciled by replaying transcripts, because the token was never bound to the transcript that authorized the call. Incident response cannot determine which peer actually exercised the capability, and revocation of `W1` (correctly scoped to `retriever-07`) does not revoke `summarizer-03`'s effective access until the token expires — a revocation-lag window equal to the token TTL, not the freshness window. The durable guardrail: treat the `(token, attestation_transcript)` pair as the atomic unit of authorization. Never store, forward, cache, or evaluate them independently. The code below encodes the check that must raise at the seam. ```python import hashlib import time from dataclasses import dataclass class AttestationBindingError(RuntimeError): """Raised when a capability token is presented under a transcript it was not minted for.""" @dataclass(frozen=True) class Transcript: peer_pubkey: str channel_id: str nonce: str role: str timestamp_bucket: int def commit(self) -> str: blob = f"{self.peer_pubkey}|{self.channel_id}|{self.nonce}|{self.role}|{self.timestamp_bucket}" return hashlib.sha256(blob.encode()).hexdigest() @dataclass(frozen=True) class CapabilityToken: subject: str scope: str attestation_commitment: str | None # None => bearer-transferable, no binding required expires_at: float def has_attestation_caveat(self) -> bool: return self.attestation_commitment is not None class FreshnessCache: """Keyed on the FULL tuple; a coarse key is an authorization bypass, not an optimization.""" def __init__(self, window_seconds: float = 300.0) -> None: self._window = window_seconds self._entries: dict[tuple[str, str, str], tuple[str, float]] = {} def _key(self, t: Transcript) -> tuple[str, str, str]: return (t.peer_pubkey, t.channel_id, t.nonce) def record(self, t: Transcript) -> None: self._entries[self._key(t)] = (t.commit(), time.time()) def matches(self, t: Transcript) -> bool: entry = self._entries.get(self._key(t)) if entry is None: return False committed, recorded_at = entry if time.time() - recorded_at > self._window: return False # Cache hit still requires the presenting transcript to hash to the cached commitment. return committed == t.commit() def authorize_cross_boundary( token: CapabilityToken, presenting: Transcript, cache: FreshnessCache, ) -> None: if time.time() >= token.expires_at: raise AttestationBindingError(f"token for {token.subject} expired") if not token.has_attestation_caveat(): # Genuinely bearer-transferable capability; no transcript binding required. return committed = token.attestation_commitment presenting_hash = presenting.commit() if presenting_hash == committed: cache.record(presenting) return # A cache hit may only satisfy the check if it is the SAME tuple; never a different # channel/nonce/peer inside the freshness window. if cache.matches(presenting): raise AttestationBindingError( "freshness cache matched presenting tuple but token commitment differs; " "cache must not override the minted transcript" ) raise AttestationBindingError( f"token minted under commitment {committed[:12]} presented under transcript " f"{presenting_hash[:12]} (peer={presenting.peer_pubkey}, channel={presenting.channel_id}); " "capability is non-transferable across attestation boundaries" ) def forward_to_subagent( token: CapabilityToken, original: Transcript, subagent_transcript: Transcript, cache: FreshnessCache, ) -> None: # Forwarding path: the sub-agent presents a NEW transcript. Re-binding is mandatory. if token.has_attestation_caveat() and subagent_transcript.commit() != token.attestation_commitment: raise AttestationBindingError( "sub-agent cannot inherit a token bound to a different peer's attestation; " "mint a fresh attenuated warrant bound to the sub-agent transcript" ) authorize_cross_boundary(token, subagent_transcript, cache) ```