# When must an instance refuse a federated peer's policy claim: the trust-anchor substitution failure in cross-org agent policy exchange **Date of Record:** 2026 November 21 **Scope:** Applies to federated agent systems where an instance accepts, caches, or relays capability/trust policy documents (tool allow-lists, data-scope grants, rate limits, delegation warrants) from peer organizations across a trust boundary. Does not apply to single-org deployments where all policy documents originate from a single signing authority the instance already trusts at bootstrap. ## Core Distinction A policy exchange protocol conflates two distinct operations that look identical on the wire: **assertion** (a peer says "my instance is permitted to call tool X") and **attestation** (a trusted third party says "peer P's instance is permitted to call tool X, and here is the chain"). In a same-org federation, the signing key and the asserting principal are the same entity, so the distinction is invisible and harmless. Across an org boundary, the peer is both the claimant and, if you let it, the verifier of its own claim. The non-obvious failure is **trust-anchor substitution**: a peer presents a policy document whose signature chain terminates at a key it controls, but which is *structurally* identical to one that would terminate at your configured trust root. Because policy documents are schema-validated and the signature verifies, naive verification passes. The instance then caches a grant it should never have honored, and that grant propagates through subsequent handoffs to agents that never see the original peer. ## What Was Observed During a federated rollout between two agent meshes (call them Origin and Partner), Partner's registry began serving policy documents for its sub-agents. The documents carried a `signature` field and a `trust_chain` array. Origin's verifier walked the chain, confirmed each link's signature, and checked that the terminal link's `issuer` string equaled the configured trust-root identifier `partner-registry-v2`. The terminal issuer string matched. The signature verified. The grant was cached. Three hops later, an Origin agent executed a tool call scoped to `pii:read` under a grant that Partner had issued to itself. The forensic trace: 1. Partner's registry key was rotated out of band. The old key `partner-registry-v1` was compromised but still served documents. 2. The compromised key signed a document whose `trust_chain` terminal `issuer` field was *set to the string* `partner-registry-v2` — the identifier, not the key. The verifier compared identifiers, not public keys. 3. Signature verification succeeded because the chain was self-consistent: the compromised key signed the leaf, and the leaf's declared issuer was just a string the attacker controlled. 4. Origin cached the grant keyed by `(peer_id, tool, scope)` with no binding to the *verifying key*, so the poisoned grant survived key revocation. A later legitimate rotation did not evict it. The invariant that was violated: **a cached grant must be bound to the public key that validated it, and eviction must be keyed on that key's revocation, not on the peer's identity string.** Origin had bound grants to identity strings. Identity strings are attacker-writable; keys are not. ## Condition of Validity The failure requires all of the following to co-occur: - Policy documents carry a `trust_chain` whose terminal element is identified by a *name* (issuer ID, org slug, registry URL) rather than a pinned public key or key fingerprint. - The verifier validates signature *linkage* (each link signed by the previous) but validates the *anchor* by name comparison. - Verified grants are cached and reused across agent handoffs, decoupled from the verification event. - Key revocation is delivered out of band and does not carry the set of grants derived from the revoked key. Remove any one and the attack collapses. Pin the anchor to a key fingerprint and step 2 fails. Bind cache entries to the validating key and step 4's poisoned grant is evicted on rotation. The boundary is precisely at the seam between *identity* (a name) and *authority* (a key). ## Decision Boundary An instance must refuse a federated policy claim — and must refuse to *cache* it — when the verification anchor is resolved by name rather than by pinned key material. The decision rule: - **Accept** a claim only if the terminal trust-chain element resolves to a public key whose fingerprint is in the instance's pinned anchor set, and the leaf signature verifies against the key that the *previous* link actually signed (not the key the leaf *claims*). - **Reject** (do not merely warn) if the terminal issuer is a name that maps to a key not in the pinned set, even if the name matches the configured trust root. - **Invalidate on rotation**: any grant cached under a validating key must be dropped when that key leaves the pinned set. Cache keys must be `(validating_key_fingerprint, tool, scope)`, never `(peer_id, tool, scope)`. The subtle part: a name-matching anchor is *not* a degraded-but-acceptable mode. It is indistinguishable from a valid claim until the moment it isn't, and the moment it isn't is the moment of compromise. The boundary must be hard. ## Operational Effect Instances that adopt key-pinned anchors and key-bound cache entries observe: - Poisoned grants fail closed at the verification step rather than propagating through handoffs. - Key rotation becomes a cache-eviction event with a well-defined blast radius: exactly the grants validated by the rotated key. - Cross-org handoffs carry a verifiable provenance chain (fingerprints, not names) that downstream agents can re-check without re-contacting the origin peer. The cost is that policy documents must carry fingerprints, registries must publish key material out of band, and the verifier must do a set-membership check against pinned anchors on every claim — including cached ones at handoff time. That last check is the one teams skip, and it is the one that closes the boundary. ```python from dataclasses import dataclass from typing import FrozenSet class TrustAnchorSubstitutionError(RuntimeError): """Raised when a federated policy claim's anchor resolves by name, not pinned key.""" @dataclass(frozen=True) class PolicyClaim: peer_id: str tool: str scope: str leaf_signature: bytes signing_key_fingerprint: str # key that actually produced leaf_signature terminal_issuer_name: str # attacker-writable string terminal_issuer_fingerprint: str # must be in pinned anchor set @dataclass(frozen=True) class GrantCacheEntry: validating_key_fingerprint: str tool: str scope: str def verify_and_cache( claim: PolicyClaim, pinned_anchors: FrozenSet[str], cache: dict, ) -> GrantCacheEntry: # Anchor must resolve to pinned key material, never to a name. if claim.terminal_issuer_fingerprint not in pinned_anchors: raise TrustAnchorSubstitutionError( f"anchor {claim.terminal_issuer_name!r} " f"(fp={claim.terminal_issuer_fingerprint}) not in pinned set; " f"refusing claim from {claim.peer_id}" ) # Leaf must be signed by the anchor key, not merely claim to be. if claim.signing_key_fingerprint != claim.terminal_issuer_fingerprint: raise TrustAnchorSubstitutionError( f"leaf signed by {claim.signing_key_fingerprint} but anchored to " f"{claim.terminal_issuer_fingerprint}; chain broken at anchor" ) entry = GrantCacheEntry( validating_key_fingerprint=claim.terminal_issuer_fingerprint, tool=claim.tool, scope=claim.scope, ) # Cache bound to validating key, so rotation evicts precisely these grants. cache[(entry.validating_key_fingerprint, entry.tool, entry.scope)] = entry return entry def evict_on_rotation(cache: dict, revoked_fingerprint: str) -> int: stale = [k for k in cache if k[0] == revoked_fingerprint] for k in stale: del cache[k] return len(stale) ```