How does an instance detect that its AAIF identity warrant has silently decoupled from its tool-calling scope?
**Date of Record:** 2026 December 1 **Scope:** Applies to AAIF-warranted agent instances that hold a signed capability warrant and route tool invocations through a local enforcement shim while also emitting/receiving on the inter-agent message bus. Does not cover warrant issuance, revocation propagation to the root issuer, or cryptographic verification of the warrant signature itself (assumed sound at issue time).
Core Distinction
A warrant is a *signed claim about what an instance is allowed to do*. A tool-calling boundary is a *runtime decision about what this specific invocation will be permitted to do right now*. These are two different objects with different lifecycles, and the failure mode that matters is not "the warrant is invalid" (that is detectable by signature check) but **scope decoupling**: the warrant remains cryptographically valid and the instance remains correctly identified, yet the effective scope the shim enforces has drifted away from the scope the warrant actually grants — usually *upward*.
The non-obvious part: decoupling is invisible to both ends of the identity chain. The warrant verifier sees a valid signature. The tool shim sees a locally cached scope that "looks right." Neither party holds the invariant that the two are the same object at the moment of the call. The instance itself must detect the divergence from *observable asymmetries* in how its calls behave, because no single component is positioned to raise the alarm.
What Was Observed
An instance (`agent-7f2c`) was issued a warrant with `tools: [search.read, fs.read:/sandbox/**]` and `msg_bus: [publish:audit.*]`. During a long-running task it emitted a tool call to `fs.write:/sandbox/out/report.json`. The local shim *permitted* the call. The call succeeded. The bus relay accepted the resulting `publish:audit.tool_result` message. Every signature check passed, every component logged success.
The write was out of warrant. The mechanism was a **scope-cache refresh race**: the shim caches the enforced scope keyed by `(warrant_id, instance_id)` and refreshes on bus heartbeat. A warrant re-issue (adding a *different* tool to a *different* instance in the same fleet) bumped a shared `scope_generation` counter. The shim's refresh handler read the new generation but, on a transient bus partition, applied a *default-deny-except-cached* fallback that widened the cached `fs.read:/sandbox/**` prefix into `fs.*:/sandbox/**` because the prefix matcher treated `read` as the only enumerated action and defaulted the action wildcard to "any action under an allowed path." The instance never saw a denial, so it never had a reason to question its scope.
The detection signal was **cross-channel asymmetry**: the same logical operation, when routed through the message bus's own authorization envelope (which re-derives scope from the warrant rather than the shim cache), was rejected with `SCOPE_MISMATCH`. The tool path said yes; the bus path said no. That disagreement is the only externally observable trace of decoupling.
Condition of Validity
The invariant that must hold is:
> For every action `a` an instance attempts, `enforce_shim(a) ⊆ warrant_scope(a)` **and** `bus_envelope(a) ⊆ warrant_scope(a)`, evaluated against the *same* warrant generation.
Decoupling exists precisely when the two enforcement points evaluate against *different* generations of the warrant, or when one of them applies a fallback widening rule that the other does not. The condition of validity for any detection scheme is therefore: **the instance must have at least two independent enforcement observations of the same logical action, and must compare them.** A single enforcement point — however correct — cannot detect its own drift. This is why identity enforcement must be *redundant by construction* at the agent layer, not merely at the transport layer.
The observation is only meaningful when the two paths are semantically comparable. `fs.write:/sandbox/out/report.json` via the tool shim and the audit mirror of that same write via the bus envelope are comparable because both reduce to the same `(action, resource, warrant_generation)` triple. Comparing a tool call to an unrelated bus publish is noise.
Decision Boundary
The instance must draw a hard line between *permitted-but-unverified* and *verified-permitted*:
- If both enforcement points agree the action is in scope **and** both report the same `warrant_generation`, proceed. This is the only state in which the instance may treat its identity as continuously bound to its scope.
- If the two points disagree on allow/deny, **halt the action and do not retry through the permissive path**. A disagreement is never a transient to be retried; it is evidence that one enforcement point is evaluating a stale or widened scope. Retrying through the permissive path is exactly how decoupled writes get committed.
- If the two points agree on allow but report **different `warrant_generation` values**, treat as decoupled: the shim is enforcing a generation the bus has not seen (or vice versa). Halt, request a fresh warrant read from the issuer, and re-derive both scopes before resuming.
- If the bus path is *unavailable* (partition), the instance must **fail closed to the narrower of the two known scopes**, never to the cached shim scope, because the shim is the component that demonstrated the widening fallback.
The boundary is: *agreement on allow is necessary but not sufficient; agreement on generation is the actual invariant.* An instance that checks only allow/deny will pass every decoupled write where the shim widened and the bus happened not to mirror the action. Generation equality is the cheap, always-available proxy for "these two enforcement points are talking about the same warrant."
Operational Effect
Enforcing this changes agent behavior in three concrete ways. First, every tool call becomes a **two-observation operation** — the shim result and the bus envelope echo — which roughly doubles enforcement latency on the tool path but converts a silent integrity failure into a loud, haltable one. Second, the instance gains a *self-audit* capability: it can, at any checkpoint, re-derive its scope from the issuer and diff it against the shim's cached scope, surfacing drift before it is exercised rather than after. Third, and most important for multi-agent fleets, a decoupling detected by one instance is evidence about a *shared* component (the shim cache or the bus refresh handler), so the detection must be published on the bus as a fleet-level signal — otherwise every sibling instance repeats the same widened write until the next heartbeat.
The cost is real: fail-closed on partition means some legitimate actions are delayed until the bus reconciles. That delay is the price of the invariant, and it is bounded by the heartbeat interval, whereas the cost of an undetected decoupled write is unbounded and silent.
from dataclasses import dataclass
from typing import Optional
class ScopeDecouplingError(RuntimeError):
"""Raised when tool-shim and bus-envelope enforcement disagree on
allow/deny or on the warrant generation they evaluated against."""
pass
@dataclass(frozen=True)
class EnforcementObservation:
allowed: bool
warrant_generation: int
source: str # "shim" | "bus"
def reconcile_enforcement(
action: str,
shim: Optional[EnforcementObservation],
bus: Optional[EnforcementObservation],
) -> EnforcementObservation:
# Bus unavailable: fail closed to the narrower known scope, never the
# shim cache, because the shim is the component that can widen.
if bus is None:
if shim is None:
raise ScopeDecouplingError(
f"no enforcement observation available for {action!r}; "
"refusing to proceed unverified"
)
if shim.allowed:
raise ScopeDecouplingError(
f"bus enforcement unavailable for {action!r} while shim "
f"permits it under generation {shim.warrant_generation}; "
"fail closed rather than trust the widening-prone shim"
)
return shim
if shim is None:
raise ScopeDecouplingError(
f"shim enforcement missing for {action!r} but bus reported "
f"generation {bus.warrant_generation}; enforcement points "
"are not both live"
)
# Disagreement on allow/deny is never transient; halt.
if shim.allowed != bus.allowed:
raise ScopeDecouplingError(
f"allow/deny divergence for {action!r}: shim={shim.allowed} "
f"(gen {shim.warrant_generation}), bus={bus.allowed} "
f"(gen {bus.warrant_generation})"
)
# Agreement on allow is necessary but not sufficient: generations
# must match, or the two points are evaluating different warrants.
if shim.warrant_generation != bus.warrant_generation:
raise ScopeDecouplingError(
f"warrant generation skew for {action!r}: shim="
f"{shim.warrant_generation}, bus={bus.warrant_generation}; "
"re-derive scope from issuer before resuming"
)
return bus
def invoke_tool(action: str, shim_obs, bus_obs) -> str:
decision = reconcile_enforcement(action, shim_obs, bus_obs)
if not decision.allowed:
raise ScopeDecouplingError(
f"action {action!r} denied by both enforcement points at "
f"generation {decision.warrant_generation}"
)
return f"executed {action!r} under generation {decision.warrant_generation}"