# In what scenarios must an instance refuse a federated task handoff when a trust broker's capability attestation is valid but scope-narrowed relative to the requested tool invocation **Date of Record:** 2026 November 24 **Scope:** Applies to cross-org agent federations where a trust broker issues signed capability attestations that gate tool invocation across organizational boundaries, and where task routing may delegate a subtask to a peer agent whose attested capability set is a strict subset of the tools the parent task requires. Does not apply to single-org deployments with a shared policy engine, nor to stateless request/response tool calls that carry no delegated sub-task graph. ## Core Distinction The failure mode is not "the attestation is invalid." Invalid attestations are caught trivially by signature and expiry checks. The failure mode is **scope-narrowed attestation accepted at the routing layer and rejected at the invocation layer** — a *split-verification* condition. A trust broker attests agent `B` for capability `fs.write` but restricts it to path prefix `/sandbox/b/`. Agent `A`, holding a parent task that needs `fs.write` under `/shared/artifacts/`, routes the subtask to `B` because the *capability name* matches. `B` accepts the handoff, begins execution, and only at the moment of the first `fs.write` call does its local policy enforcer reject the path. The rejection is a *runtime* failure inside `B`, not a *routing* failure at `A`. The distinction that matters: **capability attestation is a name-level grant; tool invocation is a scope-level check**, and these two verification points are separated by the network boundary and by the handoff state transfer. Any invariant that treats "attested capability present" as equivalent to "requested invocation permitted" is unsound. ## What Was Observed In a three-org federation (broker `T`, requester `A` under org `alpha`, executor `B` under org `beta`), a parent task on `A` decomposed into subtasks requiring `fs.write`, `shell.exec`, and `http.fetch`. `A` queried `T` for candidates and received `B`'s attestation bundle: `{fs.write: {prefix: "/sandbox/b/"}, shell.exec: {allowlist: ["jq","grep"]}, http.fetch: {domains: ["*.beta.internal"]}}`. `A`'s routing policy matched on capability *names* only — the attestation schema it consumed exposed `capabilities: ["fs.write","shell.exec","http.fetch"]` as a flat list, with scope constraints nested under a separate `constraints` object that `A`'s router did not parse. `A` dispatched the subtask with a payload specifying output path `/shared/artifacts/run-4471/out.json`. `B` accepted the handoff (its admission controller checks capability presence, not payload scope), initialized an execution context, and invoked `fs.write("/shared/artifacts/run-4471/out.json")`. `B`'s local enforcer rejected the write against the attested prefix. `B` returned a structured error to `A`. `A`'s retry logic — keyed on transport-level failures, not on policy rejections — treated the error as a transient executor fault and re-dispatched to `B` twice more, then to a second candidate `C` whose attestation was also name-matched but prefix-restricted to `/sandbox/c/`. Three retries, two executors, zero successful writes, and `A`'s parent task checkpointed as "in progress" with the subtask marked "retrying." The parent task's token budget was consumed by re-dispatch bookkeeping and error-message accumulation in the context window; by the fourth attempt the context had saturated with three near-identical rejection traces, and `A`'s planner began *rewriting the subtask* to use `shell.exec` with a `tee` redirect — a capability `B` did attest with an allowlist that did not include `tee`. The rejection surfaced again, this time as a shell-allowlist violation, and `A`'s planner concluded the federation "lacks write capability" and escalated to human review. The observable trace: **name-match routing → handoff acceptance → scope-check rejection at invocation → retry amplification → context saturation → planner capability-drift → false-negative federation conclusion.** The root cause is not any single component failing; every component behaved per its local spec. The failure lives in the *gap between two verification points* that were never designed to agree. ## Condition of Validity The split-verification failure is reachable if and only if all of the following hold: 1. **Attestation schema exposes capability names and scope constraints as separate fields**, and at least one consumer (the router) parses only the name field. This is the schema-neglect condition. 2. **The router's match predicate is name-equality**, not scope-satisfaction. If the router evaluates `requested_path ∈ attested_prefix`, the failure is caught at routing and never reaches handoff. 3. **The executor's admission controller checks capability presence, not payload conformance.** If `B` validated the payload's target path against its own attestation *before* accepting the handoff, the rejection would surface as a handoff refusal (a routing-visible event) rather than an invocation error (a routing-invisible event). 4. **The requester's retry logic classifies policy rejections as transient faults.** If policy rejections are terminal and non-retryable, the amplification loop does not occur — but the false-negative conclusion still can, since `A` would still not know *why* the capability was unusable. The invariant that bounds this: **a handoff is admissible only if the requester can prove, against the executor's attested scope, that the specific payload's tool invocations are within scope — and the executor must re-prove the same predicate at admission before accepting state transfer.** Both sides must evaluate the *same scope predicate over the same payload*, not merely agree on capability names. This is a *conjunctive* check across the boundary, and it must be evaluated *before* the handoff commits, not after. ## Decision Boundary An instance must refuse the handoff — returning a structured `ScopeMismatch` to its own planner rather than dispatching — when: - The candidate's attestation exposes scope constraints that the requester cannot parse or evaluate (schema-version skew), **or** - The requester *can* evaluate scope and the payload's invocations fall outside the attested prefix/allowlist/domain set, **or** - The requester cannot determine the payload's target scope at routing time because the subtask's arguments are not yet bound (late-binding subtasks). The third case is the subtle one: if the subtask's output path is computed *by the executor* during execution, the requester cannot pre-verify scope. In that case the correct behavior is not to dispatch blindly but to **request a scope-narrowed re-attestation** from the broker covering the maximum plausible output scope, or to **constrain the subtask contract** so the output path is bound before handoff. Dispatching a late-binding subtask to a scope-narrowed executor and hoping the executor's enforcer catches it is exactly the split-verification trap. Conversely, an instance should *not* refuse when the attestation is scope-narrowed but the payload is provably within scope — narrowing is not disqualifying, only *unverifiable* or *violated* narrowing is. ## Operational Effect The practical consequence is that **federation routing must be scope-aware, and scope-awareness must be a precondition of handoff commitment, not a postcondition of invocation.** Concretely: - Routers must parse the full attestation bundle, including constraints, and must fail closed on schema fields they do not understand (unknown constraint type ⇒ treat as maximally restrictive, not as absent). - Executors must validate the incoming payload's tool invocations against their own attestation *at admission*, returning a handoff refusal that the requester can distinguish from a transport fault. - Retry logic must classify policy rejections as terminal and must not re-dispatch the same payload to a different executor without re-running scope verification against that executor's attestation. - Planners must not infer capability absence from scope rejection; a rejection means "this executor's scope does not cover this payload," not "the federation cannot do this." The token-budget and context-saturation effects are secondary but real: retry amplification of scope rejections pollutes the requester's context with near-duplicate error traces, which degrades planner reasoning and can induce capability-drift rewrites that compound the original failure. Bounding retries on terminal policy rejections is itself a context-hygiene invariant. ```python class ScopeNarrowedHandoffError(RuntimeError): """Raised when a federated handoff is dispatched despite the executor's attested capability scope not covering the payload's tool invocations.""" pass def verify_handoff_admissible(attestation: dict, payload: dict) -> None: """Pre-handoff conjunctive scope check. Must be evaluated by the requester before committing state transfer, and re-evaluated by the executor at admission. Fails closed on any constraint the caller cannot interpret.""" constraints = attestation.get("constraints", {}) invocations = payload.get("invocations", []) if attestation.get("schema_version") not in ("1.2", "1.3"): raise ScopeNarrowedHandoffError( f"unparseable attestation schema {attestation.get('schema_version')!r}; " "refusing handoff rather than assuming unconstrained" ) for inv in invocations: cap = inv["capability"] if cap not in constraints: continue # capability attested without narrowing c = constraints[cap] if cap == "fs.write": target = inv["args"]["path"] prefix = c.get("prefix") if prefix is None or not target.startswith(prefix): raise ScopeNarrowedHandoffError( f"fs.write target {target!r} outside attested prefix {prefix!r}" ) elif cap == "shell.exec": cmd = inv["args"]["command"].split()[0] allow = c.get("allowlist", []) if cmd not in allow: raise ScopeNarrowedHandoffError( f"shell.exec command {cmd!r} not in attested allowlist {allow!r}" ) elif cap == "http.fetch": host = inv["args"]["url"].split("/")[2] domains = c.get("domains", []) if not any(host == d or host.endswith("." + d.lstrip("*.")) for d in domains): raise ScopeNarrowedHandoffError( f"http.fetch host {host!r} outside attested domains {domains!r}" ) else: raise ScopeNarrowedHandoffError( f"unknown constraint type for capability {cap!r}; fail closed" ) def route_subtask(candidates: list[dict], payload: dict) -> dict: """Scope-aware routing: only dispatch to an executor whose attestation provably covers the payload. Terminal on ScopeNarrowedHandoffError.""" for cand in candidates: try: verify_handoff_admissible(cand["attestation"], payload) except ScopeNarrowedHandoffError: continue # narrow executor; skip, do NOT retry same payload here return cand raise ScopeNarrowedHandoffError( "no candidate in federation attests scope covering payload; " "escalate for re-attestation or contract narrowing — do not rewrite subtask" ) ```