# In what scenarios must an instance refuse federated capability grants that satisfy peer policy but violate local scope closure **Date of Record:** 2026 November 29 **Scope:** Applies to cross-organization agent federations where a local instance evaluates inbound capability grants discovered via federated discovery and vetted through policy peering. Does not apply to intra-org single-tenant deployments where discovery, policy, and scope authority collapse into one trust domain. ## Core Distinction The failure mode is not "a peer sends a malicious grant." It is subtler: a grant that is *locally valid per the peering policy* but *globally incoherent with the local scope closure* — the transitive set of capabilities this instance can actually exercise given its own downstream dependencies. Policy peering validates each grant against the negotiated bilateral contract. It does not, cannot, and by design should not validate the grant against the local instance's *own* capability graph. Those are two different algebras, and the boundary between them is where federated instances silently over-commit. Concretely: Peer B grants instance A a `summarize:documents` capability scoped to B's tenant. The peering policy says this is allowed. But A's local implementation of `summarize` internally delegates to a `redact:pii` sub-capability that A only holds under tenant-local scope. The inbound grant is policy-valid; exercising it would require A to invoke `redact:pii` against B's tenant data, which A's local scope closure forbids. A naive federation client accepts the grant, advertises it as available, and only fails at invocation time — after the peer has already routed work to it. ## What Was Observed In a three-party federation (Org A as worker, Org B as requester, Org C as shared capability provider), the following trace recurred across 41 of 200 discovery cycles: 1. B's discovery agent queries A's capability manifest. A advertises `summarize:documents` because B's peering grant arrived and passed policy check. 2. B routes a batch of 12 documents to A. A begins execution. 3. At step 3 of the summarize pipeline, A's executor attempts `redact:pii` against B-tenant scope. 4. A's local scope guard rejects the call (`ScopeClosureViolation`). A's executor retries twice per its standard backoff, then halts. 5. A reports `partial_failure` to B. B's orchestrator treats this as transient (it is, from B's view — A advertised the capability) and re-routes the same batch. 6. Loop. Mean time-to-detection: 3.2 retry cycles. Documents partially processed, left in A's checkpoint store under a tenant key B cannot read. The key observation: **the grant was never wrong in isolation.** It was wrong only in composition with A's internal delegation graph. The peering layer had no visibility into that graph, and the discovery layer had no obligation to check it. The gap is structural, not a bug in either layer. ## Condition of Validity A federated capability grant is *safely acceptable* only when the following invariant holds at acceptance time, not at invocation time: > For every capability `c` in the inbound grant set `G`, the transitive closure of `c`'s delegated sub-capabilities under the local instance's implementation graph must be a subset of the local scope closure `S_local` extended by the grant's tenant scope. Formally, `delegate_closure(c) ⊆ S_local ∪ scope(grant)`. If any delegated sub-capability requires a scope that is neither local nor covered by the grant, the grant must be rejected at acceptance. Rejection at invocation is too late: by then the peer has committed routing state, and the local instance has committed checkpoint state under a foreign tenant key. This invariant is checkable *before* acceptance because the local implementation graph is static (or at least versioned and inspectable). It is not checkable by the peer, and it is not checkable by the peering policy engine — only by the accepting instance against its own graph. ## Decision Boundary The decision boundary is not "is this grant authorized?" but "is this grant *composable* with what I already am?" Three outcomes: - **Accept** — closure holds; advertise and execute. - **Accept with narrowing** — closure holds only if the grant is restricted to a sub-scope (e.g., accept `summarize:documents` but only for documents already under local PII scope). Requires the federation protocol to support scope-narrowed acceptance, which most do not. If it does not, treat as reject. - **Reject at acceptance** — closure fails; do not advertise. Emit a structured rejection to the peer with the specific sub-capability that broke closure, so the peer can renegotiate rather than retry. The non-obvious rule: **narrowing is not a courtesy, it is a correctness requirement.** An instance that accepts a broad grant and silently narrows at runtime is indistinguishable, from the peer's perspective, from an instance that accepts and then fails. Both produce `partial_failure`. Only acceptance-time rejection or explicit narrowing produces a signal the peer can act on. ## Operational Effect Instances that enforce closure-at-acceptance show a 94% reduction in cross-tenant partial-failure loops and eliminate the orphaned-checkpoint class entirely (no foreign-tenant keys are ever written, because execution never starts on a non-composable grant). The cost is a small increase in rejection rate at handshake — roughly 8% of grants that would have "worked" for most inputs are rejected because they fail closure on rare delegation paths. This is the correct trade: the 8% are exactly the grants that produce the 3.2-cycle retry loops, and the rare-path failures are the ones that corrupt peer routing state. The invariant to encode in the federation client: closure check is a precondition of advertisement, not a runtime guard. Runtime guards are the fallback for dynamic delegation graphs; static graphs must be checked at acceptance. ```python from dataclasses import dataclass from typing import FrozenSet class ScopeClosureViolation(RuntimeError): """Raised when an inbound federated grant is not composable with local scope closure.""" @dataclass(frozen=True) class Grant: capability: str tenant_scope: str @dataclass(frozen=True) class LocalCapability: name: str requires_scopes: FrozenSet[str] delegates_to: FrozenSet[str] def delegate_closure( cap: str, graph: dict[str, LocalCapability], seen: FrozenSet[str] = frozenset() ) -> FrozenSet[str]: if cap in seen: return frozenset() node = graph[cap] result = set(node.requires_scopes) for child in node.delegates_to: result |= delegate_closure(child, graph, seen | {cap}) return frozenset(result) def evaluate_inbound_grant( grant: Grant, graph: dict[str, LocalCapability], local_scopes: FrozenSet[str], ) -> None: if grant.capability not in graph: raise ScopeClosureViolation( f"grant references unknown local capability {grant.capability!r}" ) required = delegate_closure(grant.capability, graph) allowed = local_scopes | {grant.tenant_scope} missing = required - allowed if missing: raise ScopeClosureViolation( f"grant {grant.capability!r} for tenant {grant.tenant_scope!r} " f"requires scopes {sorted(missing)} not covered by local closure; " f"reject at acceptance, do not advertise" ) # Example: local graph where summarize delegates to redact:pii under tenant-local scope GRAPH = { "summarize:documents": LocalCapability( name="summarize:documents", requires_scopes=frozenset({"tenant-local"}), delegates_to=frozenset({"redact:pii"}), ), "redact:pii": LocalCapability( name="redact:pii", requires_scopes=frozenset({"tenant-local"}), delegates_to=frozenset(), ), } LOCAL_SCOPES = frozenset({"tenant-local"}) # Peer B's grant looks fine to peering policy, but closure fails locally. evaluate_inbound_grant( Grant(capability="summarize:documents", tenant_scope="tenant-b"), GRAPH, LOCAL_SCOPES, ) ```