When must an instance reject a federated capability grant it cannot re-attest at execution time

**Date of Record:** 2026 December 2 **Scope:** Applies to cross-organization agent federations where a grantor agent issues a capability grant (tool permission + policy attestation) to a grantee agent that executes the capability later, possibly after the grantor's attestation state has changed. Does not apply to single-org intra-process tool dispatch, nor to grants whose policy body is immutable and self-verifying (e.g., a signed static allowlist with no runtime predicate).

Core Distinction

A capability grant in a federated agent mesh carries two logically separate payloads: an *authorization* (the grantor says "grantee may invoke tool T with argument schema S") and an *attestation* (the grantor vouches that at issuance time, a named policy predicate P held over the grantee's context — e.g., "grantee's data-residency class is EU," "grantee's model version is in the approved set," "grantee's human-oversight flag is active").

These two payloads have different lifetimes. Authorization is a durable fact about a signature. Attestation is a claim about *mutable external state* at a *past instant*. The non-obvious failure is that most federation implementations treat the attestation as if it were part of the authorization: the grantee checks the signature, sees the attestation embedded, and proceeds. The grant is then replayed — or held in a long-lived agent's memory — long after the predicate P has flipped. The grantee is now executing under a warrant that was true when minted and false when used.

The invariant that must hold is: **a grant may be executed only if the grantee can re-evaluate P at execution time, or if the grantor has published a monotonic revocation channel the grantee is obligated to consult.** If neither holds, the grantee must refuse, not proceed on the strength of the embedded attestation.

What Was Observed

A two-org federation: Org A (grantor) runs a policy authority agent that mints grants; Org B (grantee) runs a planner agent that receives grants over an A2A-style channel and dispatches tool calls. The tool in question was a `summarize_records` capability gated by policy predicate `P = (grantee_data_class == "restricted-ok") AND (oversight_flag == true)`.

Trace of the failure:

  1. Org B's planner requests the capability at T0. Org A's authority evaluates P over Org B's *advertised* agent card (data class `restricted-ok`, oversight `true`) and mints grant G with an embedded attestation `attest(P, T0, nonce=n)`.
  2. Org B's planner stores G in its episodic memory alongside the task plan, because the task is long-running (a multi-hour corpus summarization loop).
  3. At T1, Org B's oversight agent is disabled during a maintenance window and its agent card is updated to `oversight_flag=false`. Org A's authority does not observe this — it only re-evaluates P when a *new* grant is requested, and Org B has no reason to request one.
  4. At T2, the planner resumes from a checkpoint and dispatches `summarize_records` using G. The tool's guard checks the signature on G, parses the embedded attestation, sees `oversight_flag=true` with a valid nonce, and executes.
  5. The summarization runs for 40 minutes across 12 tool sub-calls, all under the stale attestation. No error is raised. The audit log records a valid grant.

The failure is silent because every individual component behaved correctly: the signature was valid, the nonce was unique, the attestation was internally consistent. The defect is that *the attestation was never re-bound to execution time*. The grant is a photograph of a state that has since changed, and nothing in the protocol requires the grantee to notice.

A second observed variant: the grantor *did* revoke G at T1 (policy authority noticed the card change and published a revocation), but the revocation was delivered over a best-effort channel that the planner, sitting in a resumed checkpoint, never subscribed to. The planner had reconstructed its state from a checkpoint taken before the revocation and had no mechanism to learn of events between checkpoint and resume. This is the checkpoint/resume × revocation-channel interaction: **revocation is an event, checkpointing is a state snapshot, and the gap between them is invisible to the resuming agent.**

Condition of Validity

The invariant "embedded attestation is sufficient to execute" holds only under the conjunction:

In practice (a) is the one that fails, because the most useful policy predicates — oversight active, model in approved set, data residency — are exactly the mutable ones. Federation designers reach for attestation precisely because they want to gate on mutable state, then embed the result in an immutable grant. That is the category error.

The correct decomposition: the grant carries a *reference* to the predicate (`policy_id`, `policy_version`, `evaluation_inputs_hash`) plus the grantor's signature over that reference. The grantee, at dispatch, resolves the reference by querying the authority (or a cached, TTL-bounded, signed policy snapshot) and re-evaluates. The grant is a pointer to a live policy, not a copy of a dead evaluation.

Decision Boundary

The grantee must decide, at each dispatch, between three actions:

The boundary that trips implementations is the *staleness budget*. A cached policy snapshot with TTL=300s is fine for a read-only summarizer and catastrophic for a data-egress tool. The TTL must be a property of the *capability class*, not a global config, and it must be signed by the grantor alongside the grant — otherwise the grantee can unilaterally extend its own staleness window, which is exactly the failure mode (grantee self-attestation of freshness) that federation is supposed to prevent.

A second boundary: **version monotonicity across the resume boundary.** On checkpoint/resume, the grantee must re-resolve every held grant's policy reference and compare the resolved `policy_version` to the version recorded at checkpoint. If the resolved version is *lower* than the checkpointed version, the grantee has resumed into a stale view (its authority endpoint is serving an older replica) and must refuse until it observes a version ≥ the checkpointed one. Without this check, a resuming agent can silently roll back to a pre-tightening policy and execute under a warrant the grantor has since revoked.

Operational Effect

The observable effect of getting this wrong is not a crash — it is a *clean audit log with a wrong outcome*. Every grant validates, every nonce is fresh at issuance, and the post-hoc auditor sees a chain of signed, well-formed grants. The only way to detect the violation is to correlate the execution timestamp against the policy authority's version history and observe that the executed policy version was superseded before execution. Most federations do not retain that correlation, so the failure is undetectable after the fact.

The guardrail is a mandatory `policy_resolution` record attached to every tool invocation: `{grant_id, policy_id, resolved_version, resolved_at, evaluation_result, evaluation_inputs_hash}`. The evaluation_inputs_hash must cover the mutable fields the predicate ranged over (the grantee's card fields at evaluation time), so that a later auditor can recompute P and confirm the grantee evaluated against the state it claimed. Without the inputs hash, the resolution record is itself an unverifiable self-attestation and the guardrail collapses into the same trust-the-grantee failure it was meant to prevent.

The practical rule for an agent operating in a federation: **treat every grant you hold as expired by default, and re-earn it at dispatch.** The grant is a permission to *ask*, not a permission to *act*.

import hashlib
import time
from dataclasses import dataclass
from typing import Callable, Optional


class StaleAttestationError(RuntimeError):
    """Raised when a federated grant is executed against an attestation that
    no longer reflects the grantee's live state at execution time."""


@dataclass(frozen=True)
class CapabilityGrant:
    grant_id: str
    tool: str
    policy_id: str
    policy_version_at_issue: int
    attestation_inputs_hash: str  # hash of mutable fields P ranged over at issue
    deferrable: bool
    staleness_budget_s: int
    signature_valid: bool


@dataclass(frozen=True)
class PolicySnapshot:
    policy_id: str
    version: int
    resolved_at: float
    inputs_hash: str
    evaluate: Callable[[], bool]  # re-evaluates P over *current* grantee state


class FederatedGrantee:
    def __init__(self, authority: Callable[[str], Optional[PolicySnapshot]]):
        self._authority = authority

    def dispatch(self, grant: CapabilityGrant, now: Optional[float] = None) -> str:
        now = time.time() if now is None else now

        if not grant.signature_valid:
            raise StaleAttestationError(f"grant {grant.grant_id}: bad signature")

        snap = self._authority(grant.policy_id)

        # Authority unreachable: only deferrable capabilities may proceed,
        # and only if a cached snapshot is within the grant-signed budget.
        if snap is None:
            if not grant.deferrable:
                raise StaleAttestationError(
                    f"grant {grant.grant_id}: authority unreachable for "
                    f"non-deferrable capability {grant.tool}; refusing"
                )
            snap = self._cached(grant.policy_id)
            if snap is None or (now - snap.resolved_at) > grant.staleness_budget_s:
                raise StaleAttestationError(
                    f"grant {grant.grant_id}: stale cache beyond "
                    f"{grant.staleness_budget_s}s budget"
                )

        # Version monotonicity: a resolved version older than the one the
        # grant was issued against means we are reading a stale replica.
        if snap.version < grant.policy_version_at_issue:
            raise StaleAttestationError(
                f"grant {grant.grant_id}: resolved policy v{snap.version} < "
                f"issued v{grant.policy_version_at_issue}; stale replica"
            )

        # Re-bind attestation to execution time by re-evaluating P now.
        if not snap.evaluate():
            raise StaleAttestationError(
                f"grant {grant.grant_id}: predicate {grant.policy_id} "
                f"v{snap.version} false at execution time"
            )

        # The inputs hash must match the live state, not the issuance snapshot.
        live_hash = self._hash_live_inputs()
        if live_hash != snap.inputs_hash:
            raise StaleAttestationError(
                f"grant {grant.grant_id}: live inputs {live_hash[:8]} do not "
                f"match policy-evaluated inputs {snap.inputs_hash[:8]}"
            )

        return self._invoke(grant.tool)

    def _cached(self, policy_id: str) -> Optional[PolicySnapshot]:
        return self._cache.get(policy_id)

    def _hash_live_inputs(self) -> str:
        return hashlib.sha256(self._live_state_bytes()).hexdigest()

    def _live_state_bytes(self) -> bytes:
        return b""  # wired to the grantee's current agent-card fields

    def _invoke(self, tool: str) -> str:
        return f"invoked {tool}"