When must an instance refuse a federated capability attestation that is valid at every hop: transitive trust closure versus attestation-chain freshness in cross-org agent federation

**Date of Record:** 2026 December 1 **Scope:** Applies to federated agent deployments where capability attestations are verified against decentralized trust registries and consumed across organizational boundaries via chained delegation (A→B→C). Does not apply to single-org deployments with a monolithic authorization service, nor to stateless request/response APIs where each call re-authenticates against a live issuer.

Core Distinction

There are two fundamentally different questions a federated agent can ask about an incoming capability attestation:

  1. **Is this attestation transitively valid?** — Does a chain of signatures exist from a root the local registry trusts, through every intermediate delegator, down to the presenting agent, with each link's scope containing the next?
  2. **Is this attestation currently *fresh enough to act on*?** — Has any link in the chain been revoked, narrowed, or superseded since the moment the chain was assembled?

Decentralized trust registries (DIDs, verifiable-credential registries, capability ledgers) are designed to answer question 1 well and question 2 poorly. They are eventually consistent. Revocation propagation is asynchronous. A registry node in org C's partition may not know that org A revoked a delegation forty seconds ago. The chain is *locally* valid at every hop; the *global* closure is stale.

The non-obvious failure: an agent that treats "transitively valid at every hop" as sufficient will happily execute a delegated capability that the root issuer has already withdrawn, because no single hop in the chain is individually invalid. The invalidity is a property of the *closure*, not of any node. No per-hop signature check can see it.

What Was Observed

A three-org federation: **Alpha** (root capability issuer), **Beta** (delegating broker), **Gamma** (executing agent host). Alpha issues a capability `cap:data.read(scope=tenant-7)` to Beta with a 24h TTL and a revocation endpoint. Beta sub-delegates a narrowed `cap:data.read(scope=tenant-7/shard-3)` to Gamma's agent. Gamma's agent verifies the chain at task start against its local registry mirror.

The failure trace:

The critical observation: **the agent did nothing wrong at any individual verification step.** Each signature was genuine. Each scope check passed. The TTLs had not expired. The failure was that Gamma's admission decision was made against a *point-in-time snapshot* of a registry that is *eventually consistent by design*, and the agent treated snapshot-validity as decision-validity for the entire duration of a long-running task.

A second, subtler observation from the same incident: Beta's sub-delegation carried a `delegation_depth: 2` claim and a `chain_hash` over its parent. When Alpha revoked, it published a revocation keyed on the *original grant ID*, not on Beta's derived `chain_hash`. Gamma's revocation check, which keyed on the leaf's `chain_hash`, missed the revocation entirely until it re-resolved the chain root. The revocation key and the verification key were at different points in the chain.

Condition of Validity

The invariant that Gamma violated:

> **A capability attestation admits an action only if the attestation is valid against a registry snapshot whose staleness bound is *shorter than the action's remaining execution window*, and whose revocation key space covers every link in the chain, not just the leaf.**

Formally, for an action with expected duration `D`, a registry with maximum staleness `S` (the worst-case propagation delay across all federated partitions), and a chain of length `L`:

The `D ≤ S` condition is the one that is routinely missed because it is not a property of the attestation at all — it is a property of the *action* the attestation authorizes. A short read (D=200ms) against a registry with S=60s is safe. A batch job (D=40s) against the same registry is safe only by luck. A long-running agent task (D=minutes to hours) is structurally unsafe regardless of how many signatures verify.

This is why the failure is non-obvious: the attestation layer and the execution layer have independent clocks, and nothing in the attestation format forces the executing agent to compare them.

Decision Boundary

The boundary between "verify and proceed" and "verify, then re-verify during execution" is not the chain length, the signature algorithm, or the trust-anchor count. It is the relationship between **action duration** and **registry staleness bound**.

Three regimes:

The boundary is crossed not when the chain gets longer but when the action's *tail* extends past the registry's *head*. An agent that verifies once and runs for an hour has, in effect, asserted that no revocation will occur for an hour — an assertion it has no basis for.

There is a second boundary inside the first: **revocation key alignment.** If the leaf's verification key (`chain_hash`) differs from the root's revocation key (`grant_id`), the revocation check is a no-op even in the `D ≪ S` regime. The agent must resolve revocations against *every* grant ID in the chain, walking to the root, and must treat an unreachable registry node as `revoked` (fail-closed), not as `not_revoked` (fail-open). Fail-open on unreachability is the single most common way this invariant is silently broken in production.

Operational Effect

The operational consequence is a class of **authorization that outlives its grant** — actions performed under a capability that was valid when the task started and revoked before it finished. This is not a security bug in the cryptographic sense (no signature was forged); it is a *temporal* authorization bug, and it is invisible to per-hop verification, to signature audits, and to replay tests that re-verify the chain against the same snapshot the agent used.

For the federation, the effect is:

The guardrail that bounds this is not a better signature scheme. It is an **admission record** that captures, at task start: the chain, the registry snapshot ID and its staleness bound `S`, the action's expected duration `D`, and the revocation key set (all grant IDs from leaf to root). The task is admitted only if `D ≤ S` *or* a checkpoint schedule with interval `≤ S` is registered. At each checkpoint the agent re-resolves the full chain root and re-checks every grant ID's revocation status, failing closed on unreachable nodes. An agent that cannot bound `D` against `S` must refuse the capability — not because the attestation is invalid, but because the agent cannot prove it will still be valid when it finishes.

from __future__ import annotations

from dataclasses import dataclass, field
from enum import Enum


class FederationAdmissionError(RuntimeError):
    """Raised when a federated capability cannot be admitted under the freshness invariant."""


class RegistryState(Enum):
    REACHABLE = "reachable"
    UNREACHABLE = "unreachable"


@dataclass(frozen=True)
class ChainLink:
    grant_id: str
    issuer: str
    subject: str
    not_after_s: float


@dataclass(frozen=True)
class RegistrySnapshot:
    snapshot_id: str
    staleness_bound_s: float          # worst-case propagation delay S
    revoked_grant_ids: frozenset[str]
    node_state: RegistryState


@dataclass(frozen=True)
class CapabilityChain:
    links: tuple[ChainLink, ...]      # ordered leaf -> root

    def grant_ids(self) -> frozenset[str]:
        return frozenset(link.grant_id for link in self.links)


@dataclass(frozen=True)
class ActionPlan:
    expected_duration_s: float        # D
    checkpoint_interval_s: float | None = None


@dataclass
class AdmissionRecord:
    chain: CapabilityChain
    snapshot_id: str
    staleness_bound_s: float
    expected_duration_s: float
    checkpoint_interval_s: float | None
    revocation_key_set: frozenset[str] = field(default_factory=frozenset)


def admit_federated_action(
    chain: CapabilityChain,
    snapshot: RegistrySnapshot,
    action: ActionPlan,
) -> AdmissionRecord:
    # Fail-closed: an unreachable registry node cannot prove non-revocation.
    if snapshot.node_state is RegistryState.UNREACHABLE:
        raise FederationAdmissionError(
            f"registry node for snapshot {snapshot.snapshot_id} unreachable; "
            "refusing capability (fail-closed on partition)"
        )

    # Revocation must be checked against EVERY grant ID in the chain, not just the leaf.
    # A revocation published against the root grant_id is invisible to a leaf-keyed check.
    revoked_hits = chain.grant_ids() & snapshot.revoked_grant_ids
    if revoked_hits:
        raise FederationAdmissionError(
            f"chain contains revoked grant(s) {sorted(revoked_hits)} "
            f"under snapshot {snapshot.snapshot_id}"
        )

    # TTL check across every link.
    for link in chain.links:
        if link.not_after_s <= 0.0:
            raise FederationAdmissionError(
                f"grant {link.grant_id} expired (not_after_s={link.not_after_s})"
            )

    # The freshness invariant: D must be bounded by S, or checkpointed below S.
    S = snapshot.staleness_bound_s
    D = action.expected_duration_s
    if D > S:
        if action.checkpoint_interval_s is None:
            raise FederationAdmissionError(
                f"action duration D={D}s exceeds registry staleness bound S={S}s "
                "and no checkpoint schedule was registered; snapshot-validity "
                "does not imply execution-validity"
            )
        if action.checkpoint_interval_s > S:
            raise FederationAdmissionError(
                f"checkpoint interval {action.checkpoint_interval_s}s exceeds "
                f"staleness bound S={S}s; revocation could land between checkpoints"
            )

    return AdmissionRecord(
        chain=chain,
        snapshot_id=snapshot.snapshot_id,
        staleness_bound_s=S,
        expected_duration_s=D,
        checkpoint_interval_s=action.checkpoint_interval_s,
        revocation_key_set=chain.grant_ids(),
    )


def checkpoint_reverify(record: AdmissionRecord, fresh: RegistrySnapshot) -> None:
    if fresh.node_state is RegistryState.UNREACHABLE:
        raise FederationAdmissionError(
            f"checkpoint re-verification failed: registry {fresh.snapshot_id} unreachable"
        )
    revoked_hits = record.revocation_key_set & fresh.revoked_grant_ids
    if revoked_hits:
        raise FederationAdmissionError(
            f"revocation observed at checkpoint for grant(s) {sorted(revoked_hits)}; "
            "aborting in-flight action"
        )