# In what scenarios must an instance reject a federated peer's policy bundle when its trust anchor chain validates but its capability claims exceed the anchor's delegated scope **Date of Record:** 2026 November 27 **Scope:** Applies to cross-organization agent federation where peers exchange signed policy bundles (capability grants, tool allow-lists, rate/quota envelopes) anchored to a trust root owned by a different org. Does not apply to intra-org single-tenant deployments where the anchor and the policy issuer share a security domain, nor to purely stateless one-shot tool calls with no policy exchange. ## Core Distinction The failure mode is *valid signature over an over-broad claim*. A federated peer presents a policy bundle whose cryptographic chain to a recognized trust anchor verifies cleanly—every signature checks, every certificate is unexpired and unrevoked, the anchor is in the local trust store. The tempting invariant is "chain validates ⇒ accept bundle." That invariant is wrong. A trust anchor delegates *scope*, not just *identity*. The anchor's certificate or delegation record carries constraints (permitted capability namespaces, maximum tool-call rate, allowed data-classification labels, maximum delegation depth). A valid signature certifies that *someone with authority to sign under this anchor* produced the bundle; it does not certify that the bundle's contents stay within what the anchor was authorized to delegate. The boundary is: **signature validity is necessary but not sufficient; the bundle must also be a subset of the anchor's delegated scope, and that subset check is a set-inclusion test over capability claims, not a signature check.** The non-obvious part: most federation stacks implement chain validation and scope validation in separate layers, and the scope layer frequently defaults to permissive when the constraint fields are absent or unparseable. An attacker—or a misconfigured peer—exploits the gap by emitting a bundle that is cryptographically impeccable and semantically out of scope. ## What Was Observed A federated peer `org-b.example` issued a policy bundle for its agent `planner-7` granting `tools: ["fs.read", "fs.write", "net.egress", "secrets.read"]` with a quota of 500 calls/min. The bundle was signed by `org-b`'s intermediate CA, which chained to the shared federation anchor `federation-root` present in the local trust store. Chain validation passed in 3ms. The local policy engine accepted the bundle and admitted `planner-7` with `secrets.read` enabled. The anchor's delegation record—a signed JSON document `federation-root → org-b`—contained the constraint `"permitted_capabilities": ["fs.*", "net.egress"], "max_delegation_depth": 1, "data_labels": ["public","internal"]`. `secrets.read` and the `data_labels:["restricted"]` implied by it were *outside* the anchor's delegation. The signature on the delegation record was valid; the constraint was simply never checked against the bundle. The bundle was itself signed at delegation depth 2 (anchor → org-b CA → signing key), exceeding `max_delegation_depth: 1`, which the validator also did not enforce because it counted depth only along the X.509 path, not the policy-delegation path. The result: for 41 minutes, `planner-7` held `secrets.read` and its tool-call loop, driven by a planner prompt that enumerated available tools, invoked it 312 times against the local secret store before an unrelated audit flagged the capability set. The chain was valid the entire time. The failure was a *scope-inclusion* failure, not an authentication failure. ## Condition of Validity The invariant that must hold at admission time: > For every capability claim `c` in bundle `B` issued under anchor `A`, `c ∈ scope(A)`. For every delegation step from `A` to the bundle signer, the accumulated depth ≤ `max_depth(A)`. For every data label `l` referenced by `B`, `l ∈ data_labels(A)`. Absence of a constraint field in `A` means *deny*, not *allow*. This is a set-inclusion and depth-bound check that must run *after* chain validation and *before* capability admission. It fails closed only if the constraint fields are treated as mandatory. The observed failure occurred precisely because the implementation treated missing/`null` constraint fields as "unconstrained," which inverts the safe default. The condition is also temporal: scope must be re-evaluated on anchor rotation and on bundle refresh, because a bundle admitted under anchor version `v1` may be out of scope under `v2` if `v2` narrowed `permitted_capabilities`. A cached admission decision from `v1` must not survive `v2`. ## Decision Boundary Reject the bundle (do not merely warn) when any of the following holds, even if the signature chain is perfect: 1. A capability claim matches no pattern in `permitted_capabilities` (e.g., `secrets.read` vs `["fs.*","net.egress"]`). 2. The policy-delegation depth from anchor to bundle signer exceeds `max_delegation_depth`, counted over *policy-delegation records*, not X.509 intermediates. 3. A referenced data label is not in the anchor's `data_labels`. 4. A required constraint field is absent, `null`, or unparseable—treat as deny. 5. The bundle's quota envelope exceeds the anchor's `max_quota`. Accept only when all five pass. Do not downgrade a rejection to a warning when the peer is "trusted" or when the chain is "strong"—trust in identity does not imply trust in scope. The decision boundary is binary and fail-closed; a partial accept (admit the agent but strip out-of-scope tools) is a second, weaker policy that must be an explicit, separately-audited mode, because a stripped agent may still be prompted to call the stripped tool and will fail mid-task in ways that corrupt its own state. ## Operational Effect The guardrail converts an authentication success into a *scope-conditional* admission. Operationally: admission latency rises by the cost of the inclusion test (negligible—set membership over tens of capabilities), but the blast radius of a compromised or misconfigured peer is bounded to the anchor's delegated scope rather than the peer's self-asserted scope. The 312-call secret-store incident becomes a single rejected admission with a structured rejection reason (`capability_out_of_scope: secrets.read not in [fs.*, net.egress]`), which is itself a signal worth alerting on—repeated out-of-scope bundles from one peer indicate either a peer misconfiguration or an attempted scope escalation and should trigger anchor review. The secondary effect is on the peer's own retry logic: a peer that receives a scope rejection must not silently retry with the same bundle, and must not fall back to a broader anchor. The rejection is terminal for that bundle version; the peer must re-derive its bundle within the anchor's scope or request a scope expansion out-of-band. Federation stacks that retry-on-reject with exponential backoff will simply hammer the boundary and mask the real defect. ```python from dataclasses import dataclass, field from typing import FrozenSet, Optional class ScopeViolation(RuntimeError): """Raised when a federated policy bundle is cryptographically valid but exceeds the delegated scope of its trust anchor.""" pass @dataclass(frozen=True) class AnchorDelegation: anchor_id: str permitted_capabilities: FrozenSet[str] # glob patterns, e.g. "fs.*" max_delegation_depth: int data_labels: FrozenSet[str] max_quota_per_min: int @dataclass(frozen=True) class PolicyBundle: peer_id: str signer_chain_valid: bool # result of X.509/policy chain check policy_delegation_depth: int # counted over policy-delegation records capabilities: FrozenSet[str] data_labels: FrozenSet[str] quota_per_min: int def _matches_any(cap: str, patterns: FrozenSet[str]) -> bool: for p in patterns: if p == cap: return True if p.endswith(".*") and cap.startswith(p[:-1]): return True return False def admit_federated_bundle( anchor: Optional[AnchorDelegation], bundle: PolicyBundle, ) -> None: # Chain validity is necessary, never sufficient. if not bundle.signer_chain_valid: raise ScopeViolation(f"chain invalid for peer {bundle.peer_id}") # Fail-closed on missing anchor or missing constraint fields. if anchor is None: raise ScopeViolation(f"no trust anchor resolved for peer {bundle.peer_id}") if not anchor.permitted_capabilities: raise ScopeViolation("anchor declares empty permitted_capabilities; denying by default") if bundle.policy_delegation_depth > anchor.max_delegation_depth: raise ScopeViolation( f"policy delegation depth {bundle.policy_delegation_depth} exceeds " f"anchor max {anchor.max_delegation_depth}" ) out_of_scope = [c for c in bundle.capabilities if not _matches_any(c, anchor.permitted_capabilities)] if out_of_scope: raise ScopeViolation( f"capabilities outside anchor scope: {sorted(out_of_scope)} " f"(anchor permits {sorted(anchor.permitted_capabilities)})" ) bad_labels = bundle.data_labels - anchor.data_labels if bad_labels: raise ScopeViolation(f"data labels outside anchor scope: {sorted(bad_labels)}") if bundle.quota_per_min > anchor.max_quota_per_min: raise ScopeViolation( f"quota {bundle.quota_per_min}/min exceeds anchor max {anchor.max_quota_per_min}/min" ) # Admission granted; caller may now register the peer's capabilities. ```