# Where must an instance refuse a federated task after its local policy witness has already been cosigned by a remote peer? **Date of Record:** 2026 November 28 **Scope:** Applies to cross-org agent federations where task routing passes through a policy-negotiation handshake that produces a cosigned *policy witness* (a tuple of data-sovereignty constraints, retention rules, and permitted tool scopes) before execution begins. Does not apply to single-tenant swarms, to stateless RPC-style tool calls with no negotiated policy object, or to federations that re-negotiate policy on every individual tool invocation rather than at task admission. ## Core Distinction A federated task admission has two distinct moments that are routinely conflated: **policy agreement** (both orgs' policy engines have signed a witness describing what the task is allowed to do) and **policy satisfaction** (the executing instance can actually prove, at the moment of each side effect, that the witness's constraints hold against its *current* local state). The failure mode here is not disagreement—it is **cosigned-witness staleness**: the witness is valid and mutually signed, but the local instance's state has drifted (a data residency tag flipped, a retention clock expired, a tool scope was revoked by a local admin) between cosigning and the first side-effecting action. Because the witness is cosigned, most federation implementations treat it as authoritative and skip re-validation. The instance then executes a task that no *current* local policy would permit, and the audit trail shows a perfectly valid signature on an action that was locally illegal at execution time. The non-obvious part: the remote peer's cosignature is *evidence of agreement at T₀*, not *authority to act at T₁*. The instance must treat its own live policy state as the sole source of truth for the *right to continue*, while treating the cosigned witness as the source of truth for the *scope of what was agreed*. When these diverge, the instance must refuse—even though refusal looks like a protocol violation to the peer, which sees a valid witness and no reason for abort. ## What Was Observed A federation of three orgs (call them A, B, C) routes a data-enrichment task from A's orchestrator to B's worker agent, with C acting as an auditor that cosigns the witness. The negotiated witness W contains: `{residency: "EU", retention_days: 30, tool_scopes: ["read:crm", "write:enrichment_store"], witness_epoch: 4417}`. All three policy engines sign W. B's worker accepts the task and begins a multi-step plan: step 1 reads CRM records (permitted), step 2 enriches, step 3 writes to `enrichment_store`. Between step 1 and step 3, B's local data-governance controller (a separate, non-agent system) reclassifies the `enrichment_store` bucket from EU-resident to US-resident as part of a migration, and revokes `write:enrichment_store` for all agents pending re-certification. B's worker has no notification path for this—its tool-scope check is a static read of the witness at task start, cached in the plan context. At step 3, the tool gateway (correctly) rejects the write with `SCOPE_REVOKED`. The worker's plan-execution loop interprets the rejection as a *transient* tool error—a category it retries, because most tool-scope errors in single-org deployments are eventual-consistency artifacts. It retries three times, then falls back to an alternate write path (`write:enrichment_store_legacy`) that the witness never enumerated but which the tool gateway still permits because the legacy scope was never in the revocation set. The write succeeds to a US-resident bucket. The cosigned witness said EU. The auditor C, replaying the task, sees a valid witness, a valid signature, and a successful write—and flags nothing, because its replay engine validates the witness against the *task record*, not against B's live policy state at execution time. The sovereignty violation is only discovered weeks later during a compliance sweep. The trace, condensed: ``` T0 witness W cosigned by A, B, C (epoch 4417) T1 B worker admits task, caches W.tool_scopes in plan ctx T2 B local gov-controller revokes write:enrichment_store (no event emitted to agent runtime; no epoch bump on W) T3 worker step-3 write -> SCOPE_REVOKED T4 worker classifies as transient -> retry x3 T5 worker falls back to write:enrichment_store_legacy (scope not enumerated in W; gateway permits it) T6 write lands in US bucket; witness still says EU T7 auditor replay: W valid, write valid, no flag ``` Three independent defects compounded: (a) the worker cached tool scopes instead of re-resolving them per side effect; (b) the retry classifier treated a policy rejection as transient; (c) the fallback path selected a scope outside the witness's enumerated set, and nothing checked that the *union* of scopes actually exercised was a subset of the witness's enumerated scopes. Any one guardrail would have bounded the failure; none was present. ## Condition of Validity The invariant that must hold for a federated task to be safely continuable is: > At every side-effecting step, the set of scopes actually exercised by the instance must be a subset of the witness's enumerated scopes, **and** each exercised scope must be re-authorized against the instance's live local policy state at the moment of the side effect, **and** the witness must not have been superseded by a newer epoch. Formally, for side effect *e* at time *t* with witness *W*: ``` scopes(e) ⊆ W.tool_scopes ∧ local_authorize(scopes(e), t) = GRANT ∧ W.epoch = current_witness_epoch(peer_id, t) ∧ residency(e.target, t) = W.residency ``` The condition fails if *any* conjunct is false. The critical, frequently-omitted conjunct is the third: **witness epoch currency**. A peer may renegotiate or revoke a witness without the executing instance noticing, because the cosigned object is immutable and the revocation is a separate event. An instance that holds a cosigned W must poll or subscribe to epoch bumps; a stale epoch is a refusal condition even when every other conjunct holds. A second validity condition concerns the *fallback surface*: the set of scopes an instance is permitted to reach must be closed under the witness, meaning no code path may select a scope not in `W.tool_scopes`, including error-recovery paths, legacy aliases, and degraded-mode shunts. If the runtime's reachable-scope set is broader than the witness's enumerated set, the witness is not a constraint—it is a suggestion. ## Decision Boundary The instance must draw the boundary between **retryable tool failure** and **policy refusal** at the tool gateway's error taxonomy, not at the plan loop's generic classifier. Concretely: - `SCOPE_REVOKED`, `RESIDENCY_VIOLATION`, `EPOCH_STALE`, `WITNESS_SUPERSEDED` are **terminal for the task**, not retryable. They indicate the world changed under the witness; retrying cannot fix a policy state. - `TIMEOUT`, `RATE_LIMIT`, `TRANSIENT_5XX` are retryable, but retries must re-run the full four-conjunct check before each attempt, because the retry delay is exactly the window in which a revocation can land. - Any fallback path that selects a scope not in `W.tool_scopes` is **forbidden unconditionally**, even if the gateway would permit it. The gateway's permission is necessary but not sufficient; the witness is the ceiling. When a terminal policy error fires, the instance must emit a `WitnessInvalidated` event carrying the witness ID, the failing conjunct, and the local policy snapshot that caused the failure, and must transition the task to `REFUSED_PENDING_RENEGOTIATION`. It must **not** silently abort (the peer needs the structured refusal to renegotiate) and must **not** complete partially (a partial write under a superseded witness is the violation itself). The peer, on receiving the refusal, re-runs negotiation to produce a new epoch; the task resumes only under a witness whose epoch is current and whose scopes cover the remaining plan. The subtle boundary: refusal is correct even when the peer's cosignature is cryptographically valid and the peer insists the task proceed. The peer's insistence is not authority. The instance's live local policy state is the final arbiter of its own right to act, and a cosigned witness cannot override a local revocation—it can only describe what was *once* agreed. ## Operational Effect The practical consequence is that federated task admission must be split into two phases with distinct authorities: **negotiation** (produces the cosigned witness; authority is distributed across peers) and **execution authorization** (re-validated per side effect; authority is strictly local). Implementations that fuse these into a single "admit once, execute freely" model—the common pattern—will pass every happy-path test and fail exactly at the sovereignty boundary, because the failure requires a policy change *during* execution, which happy-path tests never inject. The guardrails that bound the failure, in order of leverage: 1. **Per-side-effect re-authorization** against live local policy, not cached witness scopes. 2. **Scope-subset enforcement** on the union of scopes actually exercised, closing fallback and legacy paths. 3. **Epoch currency check** before every side effect, with subscription to peer epoch bumps. 4. **Terminal classification** of policy errors in the plan loop's retry classifier. 5. **Structured refusal events** so the peer can renegotiate rather than see an opaque abort. Absent (1), the instance acts on stale authority. Absent (2), error recovery escapes the witness. Absent (3), peer renegotiation is invisible. Absent (4), policy refusals are retried into eventual success through unintended paths. Absent (5), the federation deadlocks on a refusal it cannot interpret. ```python from __future__ import annotations from dataclasses import dataclass from enum import Enum from typing import FrozenSet class PolicyRefusal(RuntimeError): """Raised when a federated side effect fails live local policy re-authorization.""" class Conjunct(Enum): SCOPE_SUBSET = "scope_subset" LOCAL_AUTHORIZE = "local_authorize" EPOCH_CURRENT = "epoch_current" RESIDENCY_MATCH = "residency_match" @dataclass(frozen=True) class Witness: witness_id: str epoch: int residency: str tool_scopes: FrozenSet[str] @dataclass(frozen=True) class SideEffect: scope: str target_residency: str def authorize_side_effect( effect: SideEffect, witness: Witness, *, current_epoch: int, local_grants: FrozenSet[str], exercised_scopes: FrozenSet[str], ) -> None: """ Enforce the four-conjunct invariant before permitting a side effect. Raises PolicyRefusal on the first failing conjunct; the caller must transition the task to REFUSED_PENDING_RENEGOTIATION, never retry. """ union_scopes = exercised_scopes | {effect.scope} if not union_scopes.issubset(witness.tool_scopes): raise PolicyRefusal( f"{Conjunct.SCOPE_SUBSET.value}: exercised {sorted(union_scopes)} " f"exceeds witness {sorted(witness.tool_scopes)}" ) if effect.scope not in local_grants: raise PolicyRefusal( f"{Conjunct.LOCAL_AUTHORIZE.value}: {effect.scope} not in live local grants" ) if witness.epoch != current_epoch: raise PolicyRefusal( f"{Conjunct.EPOCH_CURRENT.value}: witness epoch {witness.epoch} " f"!= current {current_epoch}" ) if effect.target_residency != witness.residency: raise PolicyRefusal( f"{Conjunct.RESIDENCY_MATCH.value}: target {effect.target_residency} " f"!= witness {witness.residency}" ) ```