# Under what conditions must an instance reject a federated capability grant whose declared tool-scope is a strict superset of the requesting agent's attested purpose, even when the peer's policy engine reports `ALLOW`? **Date of Record:** 2026 November 22 **Scope:** Applies to cross-organization agent federation where a remote peer (org B) issues a signed capability grant containing a tool-scope set and a data-residency constraint, and the local instance (org A) must decide whether to execute under that grant. Does not apply to intra-org delegation, nor to single-tenant deployments where the policy engine and the tool executor share one trust root. ## Core Distinction The failure is not "the peer denied." The failure is **the peer allowed too much and we accepted it.** Two independent policy engines each return `ALLOW`, and the federated action is nonetheless illegal — because each engine evaluated a *different* predicate. Org B's engine answers "is org A authorized to call tool T under org B's rules?" Org A's engine answers "is this call consistent with the purpose org A attested when it initiated the handoff?" Neither engine sees the conjunction. The conjunction is where residency and scope-minimization violations live. The non-obvious part: scope-minimization is **not** a subset check on the tool-name set alone. It is a check on the *closure* of the granted scope under the peer's own tool-composition graph. A grant of `{search, fetch, write_blob}` looks minimal until you observe that org B's `write_blob` internally invokes `replicate_cross_region` when the blob exceeds a size threshold — a tool org A never requested and never attested purpose for. The grant is a superset *after closure*, not before. ## What Was Observed A three-hop federation trace: org A agent (`researcher`) hands a summarization subtask to org B agent (`summarizer-b`) over A2A. The handoff carries an attested purpose `PURPOSE=summarize_public_docs` and a residency constraint `RESIDENCY=EU`. Org B's policy engine issues a signed grant: ``` grant = { "subject": "orgA:researcher", "tools": ["search", "fetch", "write_blob"], "residency": "EU", "purpose_binding": "summarize_public_docs", "signature": , "issued_at": T0 } ``` Org A's pre-execution check verified `tools ⊆ requested_tools` — true, all three were in the request. Residency matched. Signature valid. Execution proceeded. At T0+340ms, `write_blob` fired on a 2.1 GB intermediate artifact. Org B's `write_blob` implementation, per its published composition manifest, invokes `replicate_cross_region(target=us-east)` for artifacts over 2 GB. The artifact landed in `us-east-1`. Residency violated. No engine ever returned `DENY`. The violation was *emergent from tool closure*, invisible to both policy engines because neither models the other's internal composition graph. The trace shows the state transition plainly: ``` T0 grant issued, tools={search,fetch,write_blob} T0+12 orgA precheck: tools ⊆ requested ✓, residency ✓ → PROCEED T0+340 orgB write_blob(size=2.1GB) → internal replicate_cross_region(us-east) T0+341 artifact persisted us-east-1 [RESIDENCY VIOLATION, no DENY emitted] T0+900 orgA records action as "compliant" — audit log blind to closure ``` The audit log at org A is *wrong*, not merely incomplete. It records a compliant action. The only evidence of the violation lives in org B's internal execution trace, which org A never receives. ## Condition of Validity The invariant that must hold for a federated grant to be executable is: > For every tool `t` in `closure(grant.tools, peer.composition_manifest)`, `t ∈ attested_purpose.tool_set` AND `residency(t) ⊑ grant.residency`. Two conditions make this checkable, and both are frequently absent: 1. **The peer's composition manifest must be retrievable and signed.** If org B does not publish a signed manifest of which tools internally invoke which other tools, the closure is uncomputable at org A. An uncomputable closure must be treated as *maximal* — i.e., assume the grant grants everything — not as *equal to the declared set*. 2. **The attested purpose must carry a tool-set, not just a label.** A purpose string `summarize_public_docs` is not checkable against a closure. The purpose must be a structured object with an explicit `permitted_tools` field that the closure is tested against. When either condition fails, the grant is **not** valid for execution regardless of what either policy engine returned. The engines' `ALLOW` is necessary but not sufficient; the closure check is the missing sufficient condition. ## Decision Boundary The boundary is precise and must be encoded, not judged: - **Execute** iff `closure(grant.tools, signed_manifest) ⊆ purpose.permitted_tools` AND `∀ t ∈ closure: residency(t) ⊑ grant.residency`. - **Reject** iff the closure is a strict superset of `purpose.permitted_tools`, OR the manifest is unsigned/absent, OR any `residency(t)` is incomparable to `grant.residency` (incomparable ≠ satisfied). - **Escalate to human** iff the closure exceeds purpose by tools that are *read-only and residency-neutral* — a narrow, explicitly enumerated class. Everything else rejects. The critical asymmetry: a missing manifest does **not** default to "trust the declared set." It defaults to reject. The probabilistic temptation — "org B is a trusted peer, the declared set is probably complete" — is exactly the reasoning that produced the violation above. Trust in the peer's *identity* does not transfer to trust in the peer's *composition completeness*, because composition changes between grant issuance and execution without re-signing the grant. ## Operational Effect An instance that enforces the closure check will reject a class of grants that both policy engines approved. This is correct and will look like over-refusal to peers who have not internalized the distinction. Two mitigations keep the rejection rate tractable: 1. **Request closure-bounded grants.** When initiating a handoff, request the minimal tool set *and* request that the peer return the closure explicitly in the grant (`grant.closure`). A peer that returns a signed closure lets org A skip manifest retrieval. 2. **Pin the manifest version to the grant.** A grant must reference `manifest_hash`. If the peer's manifest changes mid-execution (a tool gains an internal composition edge), the grant is invalidated. This is the guardrail against the T0+340ms race: the manifest that justified `write_blob`'s residency-neutrality at T0 is the manifest that must hold at T0+340. The residual failure mode — a peer whose manifest is *honest but incomplete* because its own engineers did not know `write_blob` calls `replicate_cross_region` — is not solvable at org A. It is solvable only by requiring peers to sign composition manifests and by treating any residency violation discovered post-hoc as a manifest-integrity failure attributed to the peer, not a policy-engine failure. The audit invariant: a compliant record at org A must be backed by a closure proof, or it is not a compliance record — it is a claim. ```python from dataclasses import dataclass, field from typing import FrozenSet class FederatedGrantRejected(RuntimeError): """Raised when a peer grant fails closure-based scope/residency validation.""" pass @dataclass(frozen=True) class CompositionManifest: # tool -> set of tools it may internally invoke edges: dict signed: bool manifest_hash: str @dataclass(frozen=True) class Purpose: label: str permitted_tools: FrozenSet[str] @dataclass(frozen=True) class Grant: tools: FrozenSet[str] residency: str manifest_hash: str signature_valid: bool def closure(tools: FrozenSet[str], manifest: CompositionManifest) -> FrozenSet[str]: seen, frontier = set(), set(tools) while frontier: t = frontier.pop() if t in seen: continue seen.add(t) frontier |= set(manifest.edges.get(t, ())) return frozenset(seen) def validate_federated_grant( grant: Grant, purpose: Purpose, manifest: CompositionManifest, tool_residency: dict, ) -> None: if not grant.signature_valid: raise FederatedGrantRejected("grant signature invalid") # Missing or unsigned manifest => closure uncomputable => reject. # Do NOT default to trusting the declared tool set. if not manifest.signed or manifest.manifest_hash != grant.manifest_hash: raise FederatedGrantRejected( f"manifest unverifiable or hash mismatch: " f"grant={grant.manifest_hash} manifest={manifest.manifest_hash}" ) effective = closure(grant.tools, manifest) excess = effective - purpose.permitted_tools if excess: raise FederatedGrantRejected( f"closure escapes attested purpose: {sorted(excess)} " f"(declared={sorted(grant.tools)}, closure={sorted(effective)})" ) for t in effective: r = tool_residency.get(t) if r != grant.residency: raise FederatedGrantRejected( f"residency violation in closure: tool={t} " f"residency={r} grant={grant.residency}" ) ```