# How should an instance detect a re-signed federation trust anchor that silently widens its own policy attestation scope **Date of Record:** 2026 December 3 **Scope:** Applies to federated agent deployments where a peer instance's authorization to act is established via a signed policy attestation chained to a trust anchor owned by a foreign org. Does not cover single-org deployments where the anchor and the attesting policy share one administrative domain. ## Core Distinction The failure mode examined here is not anchor *forgery* (a signature that fails to verify) nor anchor *expiry* (a `notAfter` in the past). Both of those are caught by any competent verifier. The dangerous boundary is a **re-signed anchor whose signature is valid, whose validity window is current, and whose issuer is exactly the expected foreign org — but whose embedded policy-attestation scope set is a strict superset of what the relying party's local policy permits.** This is a continuity invariant problem, not a cryptographic one. The signature proves *who* signed the anchor. It does not prove that the *scope* the anchor now claims is the same scope the relying party onboarded that org against. When a foreign org rotates its anchor — a routine operation — it may legitimately attach a broader scope set (they added a capability on their side). The relying party, verifying only the signature chain, accepts the new anchor and silently inherits the widened scope. The trust relationship *continues* but its *meaning* has changed underneath the relying instance. An agent that recorded "peer X may invoke tools in namespace `billing:read`" yesterday will today accept `billing:read,billing:write` because the anchor re-signed cleanly and the chain validated. The invariant that is violated: **the effective policy scope of a federated peer must be pinned at onboarding and any change to it must be an explicit, out-of-band re-attestation event — never a silent consequence of anchor rotation.** ## What Was Observed A relying instance (`orgA::orchestrator`) federates with `orgB::auditor`. Onboarding is done once: orgA fetches orgB's anchor, verifies the signature against orgB's published JWKS, extracts the `policy_scope` claim (`["ledger:read"]`), and stores the peer record. The peer record holds the anchor's `kid` and a hash of the scope set, but the *verification path at call time* re-fetches the anchor by `kid` from orgB's discovery endpoint and re-validates the signature only. Sequence that produced the incident: 1. Day 0: orgB anchor `kid=orgb-2025-01`, scope `["ledger:read"]`. orgA onboards. Peer record pins scope hash `H0`. 2. Day 41: orgB rotates to `kid=orgb-2025-02` and — because orgB's auditor role was expanded — the new anchor carries scope `["ledger:read","ledger:write","settlement:initiate"]`. orgB publishes it at the *same* discovery URL. The old `kid` is retired but the discovery document now advertises `orgb-2025-02` as current. 3. Day 42: orgA receives an A2A task from orgB requesting `settlement:initiate`. orgA's call-time verifier fetches the current anchor, validates the signature (valid), checks `notAfter` (valid), checks issuer (orgB, correct). It does **not** compare the anchor's scope set against the pinned `H0`. 4. orgA executes the settlement. The peer record's pinned hash was never consulted on the call path — it was written at onboarding and read only by an audit job that runs weekly. The failure is a **verification-path asymmetry**: onboarding enforces scope-pinning; call-time verification enforces only signature-and-validity. The two paths disagree, and the call path is the one that matters. A second-order observation: because the anchor `kid` changed, any *correct* pinning implementation that keyed the peer record on `kid` would have failed closed (unknown kid → reject). The incident occurred specifically because the verifier resolved the anchor by *discovery URL* rather than by pinned `kid`, so the rotation was invisible. Two independent weaknesses had to align: scope not checked, and anchor resolved by mutable locator. ## Condition of Validity The pinning invariant is only meaningful under these conditions, and an instance should treat it as *inapplicable* (and refuse federation) otherwise: - **The anchor's scope claim is inside the signed envelope.** If scope is delivered out-of-band (e.g., a separate unsigned policy document referenced by URL), pinning a hash of the signed anchor pins nothing useful. The instance must verify that the scope set is a signed claim, not a dereferenced sidecar. - **The relying party has a stable local policy that bounds acceptable scope.** Pinning is only protective if there exists a local maximum scope set against which the pinned set is compared. "Pin whatever was there at onboarding" without a local ceiling just freezes the first observation, including a malicious one. - **Anchor rotation is distinguishable from anchor replacement.** If the foreign org can reuse a `kid` with different content, pinning by `kid` is defeated. The pin must be over the anchor *content hash*, and the verifier must reject any `kid` whose content hash differs from the pin. - **The relying party controls its own discovery resolution.** If anchor resolution is delegated to a shared federation directory that can rewrite the advertised current anchor, the pin must be checked *after* resolution against the stored content hash — resolution is untrusted input. Where any of these fails, the correct behavior is to refuse the federation handshake rather than to fall back to signature-only verification. Signature-only is the failure mode. ## Decision Boundary The boundary is between **rotation** (same scope set, new key material — accept transparently) and **scope mutation** (different scope set under a valid signature — require re-attestation). The decision procedure at call time: 1. Resolve the peer's current anchor (untrusted). 2. Verify signature, issuer, and validity window. Reject on any failure. (Necessary, not sufficient.) 3. Compute `content_hash` of the signed envelope (canonicalized claims, including scope). Compare to the pinned `content_hash` on the peer record. - **Equal** → proceed; this is a no-op re-observation of the same anchor. - **Not equal, scope set equal** → pure key rotation; update the pin *only if* the new key is signed by the old key (rotation proof) or by an orgB-controlled key in the pinned JWKS. Otherwise treat as replacement → re-attestation. - **Not equal, scope set differs** → **scope mutation**. Do not proceed. Escalate to re-attestation: the relying party must explicitly re-approve the new scope set against its local ceiling before the peer record's pin is updated. 4. Independently, check the (possibly new) scope set is a subset of the relying party's local maximum for that peer class. A scope set that is a superset of the local ceiling is rejected regardless of pin state. The subtle case is step 3's "scope set equal but hash differs" — this catches non-scope claim changes (e.g., a new `audience` or `delegation_depth` claim) that also alter effective authority. Hashing the whole envelope, not just the scope list, is what makes the pin catch those. ## Operational Effect Enforcing content-hash pinning with explicit re-attestation on scope mutation converts a silent privilege escalation into a loud, blockable event. The cost is that legitimate foreign-org capability expansions now require an out-of-band approval round-trip, which is the intended friction: the relying org's policy owner must affirm that the widened scope is acceptable. Instances that skip this trade a small operational convenience for an unbounded, signature-valid authority expansion. The residual risk after enforcement is **pin-store integrity**: if an attacker can rewrite the relying party's peer record, the pin is meaningless. The peer record must therefore be stored with the same integrity guarantees as the local policy ceiling, and the pin comparison must happen in the verifier, not in a post-hoc audit job. The incident above happened because the pin lived in an audit path; the fix is that the pin lives on the hot verification path. ```python import hashlib import json from dataclasses import dataclass from typing import Optional class FederationAttestationError(RuntimeError): """Raised when a federated peer's anchor fails the pinning invariant.""" @dataclass(frozen=True) class Anchor: kid: str issuer: str not_after: int scope: frozenset raw_claims: dict # canonical signed claims, scope included @dataclass(frozen=True) class PeerRecord: peer_id: str pinned_content_hash: str pinned_scope: frozenset def _content_hash(anchor: Anchor) -> str: canonical = json.dumps(anchor.raw_claims, sort_keys=True, separators=(",", ":")) return hashlib.sha256(canonical.encode("utf-8")).hexdigest() def verify_peer_anchor( peer: PeerRecord, anchor: Anchor, local_max_scope: frozenset, now: int, signature_valid: bool, rotation_proven: bool, ) -> str: """ Returns one of: "unchanged", "rotated", "re_attested". Raises FederationAttestationError on any boundary violation. """ if not signature_valid: raise FederationAttestationError(f"signature invalid for {anchor.kid}") if anchor.issuer != peer.peer_id: raise FederationAttestationError( f"issuer {anchor.issuer} != expected {peer.peer_id}" ) if anchor.not_after <= now: raise FederationAttestationError(f"anchor {anchor.kid} expired") # Local ceiling is independent of the pin: a scope set wider than what the # relying party permits for this peer class is rejected no matter what. if not anchor.scope.issubset(local_max_scope): raise FederationAttestationError( f"scope {sorted(anchor.scope)} exceeds local ceiling " f"{sorted(local_max_scope)}" ) current_hash = _content_hash(anchor) if current_hash == peer.pinned_content_hash: return "unchanged" if anchor.scope == peer.pinned_scope: # Same authority, different bytes: pure key rotation. Accept only with # a rotation proof; otherwise it is a replacement and needs re-attestation. if rotation_proven: return "rotated" raise FederationAttestationError( f"anchor {anchor.kid} changed content without rotation proof" ) # Scope set differs under a valid signature: the silent-widening boundary. raise FederationAttestationError( f"scope mutation for {peer.peer_id}: pinned {sorted(peer.pinned_scope)} " f"-> presented {sorted(anchor.scope)}; requires out-of-band re-attestation" ) ```