What happens when an instance accepts a federated peer's policy digest before the trust anchor has been pinned

**Date of Record:** 2026 December 1 **Scope:** Applies to cross-org agent federations where an inbound peer presents a signed policy bundle (capability grants, rate limits, data-classification tags) during handshake, and the receiving instance negotiates effective permissions before the trust anchor for that peer's issuing authority is durably pinned. Does not apply to intra-org meshes sharing a single root CA, nor to stateless request/response RPC where no negotiated policy artifact survives the call.

Core Distinction

The failure is not "an untrusted peer got in." It is subtler: the instance *correctly* verified the peer's signature against a certificate chain, *correctly* parsed the policy bundle, and *correctly* negotiated an effective permission set — but it did so against a **transient trust anchor** that was resolved, cached, and consumed within a single handshake transaction, and never committed to durable state. The negotiated policy digest is therefore bound to an anchor that has no persistence guarantee. On the next handshake (or after a restart, or after the anchor cache TTL expires), the same peer resolves to a *different* anchor — a rotated key, a re-issued intermediate, a failover CA — and the previously negotiated policy digest no longer validates against the new chain. The agent either (a) silently re-negotiates to a *broader* effective permission set because the new anchor's policy bundle is less restrictive, or (b) has cached the old digest and now operates under permissions the current anchor does not grant.

The invariant that is violated: **a negotiated policy digest must be cryptographically bound to a pinned, durable trust anchor at the moment of negotiation, and that binding must survive anchor rotation.** Verification-without-pinning is the boundary. Signature validity is not anchor durability.

What Was Observed

Two federated orgs, `alpha` (caller) and `beta` (callee). `beta` runs a policy-negotiation endpoint behind a load balancer fronting three negotiation replicas, each holding a short-lived anchor cache (TTL 300s) populated from `beta`'s root-of-trust service.

Trace:

  1. `alpha` agent `A1` initiates handshake. `beta` replica `R1` resolves `alpha`'s issuing CA from its anchor cache — cache miss, fetches from root-of-trust, validates `A1`'s bundle signature, computes effective permissions `P_eff = {read:public, read:internal, write:staging}`, returns a signed `PolicyGrant` with digest `D1` bound to anchor `K_alpha_v1`.
  2. `A1` caches `D1`. It does not persist the anchor fingerprint — the grant payload contains the digest but the anchor binding is only implicit in the signature chain, which `A1` discards after validation.
  3. `beta` rotates `alpha`'s intermediate CA (`K_alpha_v1` → `K_alpha_v2`) as part of scheduled key hygiene. Root-of-trust now serves `v2`. Replica anchor caches expire within 300s.
  4. `A1` resumes a long-running task after a mid-task checkpoint. It re-handshakes. `R2` resolves `K_alpha_v2`. `K_alpha_v2`'s policy bundle (issued by a different team during rotation, with a *default-allow* fallback for `write:*` that the `v1` team had explicitly scoped to `write:staging`) yields `P_eff' = {read:public, read:internal, write:*}`.
  5. `A1` receives `PolicyGrant` with digest `D2`. It has no pinned anchor to compare against `D1`'s binding, so it accepts `D2` as a routine re-negotiation. The agent now holds `write:*` against `beta` — a privilege escalation caused entirely by anchor rotation plus a non-pinned negotiation, with zero malicious actor.

The observable symptom was not an auth failure. It was a **silent widening of effective permissions across a checkpoint boundary**, logged as a normal re-handshake. Detection came from an out-of-band audit comparing `D1` and `D2` scope sets, not from any runtime guard.

Condition of Validity

This failure requires all of the following to hold simultaneously:

Remove any one and the failure collapses. Pin the anchor fingerprint into the grant, and step 5 fails closed (digest mismatch → refuse). Require monotonic narrowing across anchor versions, and `write:*` would be rejected as a superset. Persist the anchor across the checkpoint, and `A1` would compare `v1` to `v2` and halt.

Decision Boundary

The boundary is **where the anchor binding is committed**. Two architectures sit on either side:

The guardrail is not "verify signatures harder." It is: **the policy digest must commit to the anchor fingerprint, and the fingerprint must be part of the durable agent state that survives checkpoint/resume.** A grant whose digest does not name its anchor is a grant that cannot be re-validated — only re-negotiated — and re-negotiation under rotation is where privilege silently drifts.

Operational Effect

Without the pin, cross-org federations accumulate **anchor-rotation privilege drift**: each rotation cycle is a chance for the effective permission set to widen, and the widening is invisible to runtime auth logs because every individual handshake succeeded. The drift is bounded only by the frequency of rotation and the breadth of each anchor version's default policy — both of which are controlled by the *peer* org, not the caller. An agent that checkpoints across a rotation inherits permissions its original grant never authorized, and it has no local artifact to prove the discrepancy. The fix is cheap (one fingerprint in the digest, one field in the checkpoint) but only if the instance treats anchor pinning as a *state-continuity* obligation rather than a *handshake* obligation. The failure mode is a continuity bug wearing the costume of a crypto bug.

import hashlib
from dataclasses import dataclass


class AnchorBindingError(RuntimeError):
    """Raised when a negotiated policy digest is not bound to the pinned anchor."""


@dataclass(frozen=True)
class PolicyGrant:
    policy: dict
    anchor_fingerprint: str
    digest: str


def compute_digest(policy: dict, anchor_fingerprint: str) -> str:
    # Digest MUST commit to the anchor, not just the policy.
    material = repr(sorted(policy.items())) + "|" + anchor_fingerprint
    return hashlib.sha256(material.encode()).hexdigest()


def negotiate(policy: dict, anchor_fingerprint: str) -> PolicyGrant:
    return PolicyGrant(
        policy=policy,
        anchor_fingerprint=anchor_fingerprint,
        digest=compute_digest(policy, anchor_fingerprint),
    )


def revalidate_on_resume(
    checkpoint_grant: PolicyGrant,
    current_policy: dict,
    current_anchor_fingerprint: str,
) -> PolicyGrant:
    # On checkpoint resume or anchor-cache refresh, the anchor must match.
    if checkpoint_grant.anchor_fingerprint != current_anchor_fingerprint:
        raise AnchorBindingError(
            f"anchor rotated: pinned={checkpoint_grant.anchor_fingerprint} "
            f"current={current_anchor_fingerprint}; re-enrollment required, "
            f"refusing silent re-negotiation"
        )
    recomputed = compute_digest(current_policy, current_anchor_fingerprint)
    if recomputed != checkpoint_grant.digest:
        raise AnchorBindingError(
            "policy digest mismatch under stable anchor; possible tampering"
        )
    return checkpoint_grant


# Failure trace: A1 pinned under K_alpha_v1, resumes after rotation to K_alpha_v2.
pinned = negotiate(
    {"read": ["public", "internal"], "write": ["staging"]},
    anchor_fingerprint="K_alpha_v1",
)
try:
    revalidate_on_resume(
        pinned,
        current_policy={"read": ["public", "internal"], "write": ["*"]},
        current_anchor_fingerprint="K_alpha_v2",
    )
except AnchorBindingError as e:
    # Correct behavior: fail closed, force explicit re-enrollment.
    print(f"halted: {e}")