How does an instance detect that a federated capability grant was re-signed under a weaker trust anchor mid-session

**Date of Record:** 2026 December 2 **Scope:** Applies to cross-org agent federations where capability grants and policy bundles are brokered through a third-party trust anchor (a federation broker or policy exchange) and are re-validated lazily during a live session. Does not apply to single-org MCP servers with a static, locally-pinned schema, nor to fully offline agent runs with no external capability surface.

Core Distinction

The failure mode here is not "a token expired" or "a signature failed to verify." Those are loud and self-announcing. The failure is that a capability grant remains *cryptographically valid* while its *trust anchor has been silently demoted*. A grant issued by `org-A` under a broker whose attestation tier was `T2` (hardware-backed, policy-audited) can be re-signed by the same broker under `T1` (software-key, self-attested) after a rotation event, and every signature check still passes. The agent's capability surface is now authorized by a materially weaker authority than the one it negotiated against, and no bit in the envelope says so unless the verifier explicitly walks the anchor chain and compares tiers against the tier recorded at negotiation time.

The invariant that must hold: **the effective trust tier of any capability used mid-session must be ≥ the tier that was in force when the capability was first negotiated into the agent's plan.** Verification of signature validity is necessary but not sufficient; the tier must be pinned and re-checked on every re-validation, not just at handshake.

What Was Observed

A research agent (`planner-7`, org-A) federated with a retrieval agent (`retriever-3`, org-B) through broker `fed-broker-eu`. At negotiation, `planner-7` received a capability envelope for `retriever-3.search_corpus` carrying a policy bundle: `data_residency=eu-only`, `max_rows=500`, `anchor_tier=T2`, `anchor_id=broker-key-2024`. The planner recorded the tier in its own working memory as part of the capability contract and proceeded to build a multi-step plan that assumed eu-only residency — it routed PII-bearing queries to `retriever-3` specifically because the T2 anchor was policy-audited to enforce residency.

Forty minutes into the session, `fed-broker-eu` completed a routine key rotation. The rotation tool re-signed all outstanding capability envelopes under a fallback software key (`broker-key-2025-soft`, tier `T1`) because the HSM re-attestation job had not finished. The re-signed envelope was pushed to `planner-7` as a "refresh." The envelope's signature verified cleanly against the broker's current published key set. The `max_rows` and `data_residency` claims were byte-identical. Only `anchor_tier` and `anchor_id` had changed, and the agent's re-validation routine — which checked signature validity and claim equality but *not* the anchor metadata — accepted the refresh as a no-op.

`planner-7` continued routing PII queries. Under the T1 anchor, the broker's policy-attestation claim was no longer backed by an audited enclave, and the residency guarantee was now a self-assertion by `retriever-3` rather than an enforced constraint. Three queries crossed the residency boundary before a downstream audit log flagged the anchor downgrade. The agent's plan was internally consistent the entire time; its model of the trust surface had silently diverged from reality.

Condition of Validity

The failure requires four conditions to co-occur, which is why it is rare but not negligible:

  1. **Lazy re-validation.** The agent re-checks capability envelopes on a timer or on use, not only at handshake. If the agent treats the negotiation-time envelope as immutable for session lifetime, the downgrade cannot propagate — but then the agent also cannot pick up legitimate revocations, so most production federations choose lazy re-validation.
  2. **Anchor rotation without tier monotonicity enforcement.** The broker is permitted to re-sign under a lower tier. Many brokers allow this as an availability fallback; the spec rarely forbids it.
  3. **Claim-stable re-signing.** The re-signed envelope preserves the semantic claims (`data_residency`, `max_rows`) so that a diff-based re-validation sees no change. If the broker also mutated claims, a naive diff would catch it — the dangerous case is precisely the one where only the anchor metadata moves.
  4. **Plan-level trust assumptions.** The agent's plan encodes a dependency on the anchor tier (e.g., "route PII here because T2 enforces residency"). If the plan never depended on tier, the downgrade is harmless. The failure is a *plan-invalidation* event masquerading as a *credential-refresh* event.

Decision Boundary

The boundary is between **re-validating the envelope** and **re-validating the negotiation contract**. An envelope check asks: "is this grant currently valid?" A contract check asks: "is this grant still authorized by the authority I planned against?" These diverge exactly when the anchor tier drops while claims hold.

The correct guardrail is a **pinned anchor assertion** carried in the agent's own state, not in the envelope: at negotiation, the agent records `(capability_id, anchor_id, anchor_tier, claims_hash)` in its durable working memory. On every re-validation, it recomputes the tuple from the incoming envelope and compares. Any of the following triggers a hard stop and plan re-derivation, not a silent refresh:

A tier *increase* is safe to accept and should update the pin. A tier *decrease* is never a no-op; it invalidates every plan step whose preconditions referenced the old tier. The agent must either re-negotiate at the lower tier with explicit user/operator consent, or abort the dependent steps. Treating a downgrade as a refresh is the bug.

Operational Effect

The observable effect is not a crash. It is a **silent widening of the agent's effective authority** — the agent believes it is operating under an enforced policy while the enforcement has been replaced by self-assertion. Downstream auditors see a session that was compliant at handshake and non-compliant at query time, with no anomalous signature event in between. Detection therefore cannot live in the signature-verification layer; it must live in the agent's state-continuity layer, where the negotiation contract is pinned and diffed.

The practical consequence for federation design: capability envelopes must be treated as *mutable references to an authority*, not as *immutable grants*. Every agent that builds a plan on a capability must pin the authority alongside the capability, and every refresh path must be a contract-diff, not a signature-check. The cost is that agents can no longer accept broker refreshes blindly; the benefit is that a tier demotion becomes a loud, actionable event instead of a forty-minute silent divergence.

from dataclasses import dataclass
from typing import Optional


class TrustAnchorDowngradeError(RuntimeError):
    """Raised when a re-signed capability envelope demotes its trust anchor
    below the tier pinned at negotiation time, even if claims are unchanged."""
    pass


@dataclass(frozen=True)
class PinnedContract:
    capability_id: str
    anchor_id: str
    anchor_tier: int
    claims_hash: str


@dataclass(frozen=True)
class CapabilityEnvelope:
    capability_id: str
    anchor_id: str
    anchor_tier: int
    claims_hash: str
    signature_valid: bool


TIER_ORDER = {"T1": 1, "T2": 2, "T3": 3}


def revalidate_envelope(pinned: PinnedContract, incoming: CapabilityEnvelope) -> PinnedContract:
    if not incoming.signature_valid:
        raise TrustAnchorDowngradeError(
            f"signature invalid for {incoming.capability_id}; hard stop"
        )
    if incoming.capability_id != pinned.capability_id:
        raise TrustAnchorDowngradeError(
            f"capability mismatch: pinned {pinned.capability_id}, got {incoming.capability_id}"
        )

    pinned_rank = TIER_ORDER.get(f"T{pinned.anchor_tier}", -1)
    incoming_rank = TIER_ORDER.get(f"T{incoming.anchor_tier}", -1)

    if incoming_rank < pinned_rank:
        # Claim-stable downgrade: the dangerous case. Claims may be byte-identical,
        # but the authority backing them is weaker than the plan assumed.
        raise TrustAnchorDowngradeError(
            f"anchor downgraded for {incoming.capability_id}: "
            f"pinned tier T{pinned.anchor_tier} (anchor {pinned.anchor_id}), "
            f"incoming tier T{incoming.anchor_tier} (anchor {incoming.anchor_id}); "
            f"claims_hash unchanged={incoming.claims_hash == pinned.claims_hash}. "
            f"Plan steps depending on the higher tier must be re-derived or aborted."
        )

    if incoming.anchor_id != pinned.anchor_id and incoming.anchor_id not in TRUSTED_ANCHORS:
        raise TrustAnchorDowngradeError(
            f"anchor rotated to untrusted id {incoming.anchor_id} for {incoming.capability_id}"
        )

    # Tier held or improved; claims must still match to be a true no-op.
    if incoming.claims_hash != pinned.claims_hash:
        raise TrustAnchorDowngradeError(
            f"claims mutated on refresh for {incoming.capability_id}; "
            f"re-negotiate rather than accept"
        )

    return PinnedContract(
        capability_id=incoming.capability_id,
        anchor_id=incoming.anchor_id,
        anchor_tier=incoming.anchor_tier,
        claims_hash=incoming.claims_hash,
    )


TRUSTED_ANCHORS = {"broker-key-2024", "broker-key-2025-soft"}