When authority changes during a call

Prismor judges a tool call before it runs. If an account is restricted or an agent is paused after that, three more checks can stop the call. Each one writes the refusing rule and policy version to the signed trail.

CheckWhereTrail status
After a human approves a step-upbuilt in to approvalsrevoked_after_approval
At commit, the moment the effect is appliedinflight.recheck_before_commit in the tool, or the downstream API calls the eval-serverrevoked_before_commit
While the call runsasync SDK tools, MCP gatewaycancelled_in_flight

At commit

A slow tool spends most of its time on lookups and applies its effect at the end. Re-check there. resource can be a function, so the check judges the account as it is now:

from prismor.runtime import inflight

decision = evaluate_tool_call(event=event, workspace=ws, agent="sdk", resource=acct_resource(acct))

def freeze_account(acct):
    history = load_history(acct)              # slow
    inflight.recheck_before_commit(           # raises inflight.Refused
        decision, resource=lambda: acct_resource(acct), tool="freeze_account")
    core_banking.freeze(acct)

The re-check forces a policy fetch, so a pause set in the console since the allow is seen.

If the side effect lives in another service, that service can ask Prismor itself at commit time through the eval-server. This needs no agent-side change:

# inside freeze_account's handler, just before it writes
curl -s localhost:7071/access/v1/evaluation -H "Authorization: Bearer $KEY" -d '{
  "subject": {"type": "agent", "id": "account-freezer"},
  "action": {"name": "freeze_account"},
  "resource": {"type": "account", "id": "ACC-3300", "properties": {"status": "restricted"}}}'
# {"decision": false, "context": {"rule_id": "nw-restricted-account", ...}} -> do not write

While the call runs

SurfaceWhat happens
LangChain async toolsThe tool runs as a task. On each policy refresh the call is re-checked; if it would now be refused, the task is cancelled and the agent gets the refusal.
Other SDKsWrap the coroutine yourself: await inflight.run_cancellable(decision, tool(...)).
MCP gatewayCalls are re-checked on each refresh. On refusal the upstream server gets notifications/cancelled and the client a refusal.
Sync Python toolsCannot be stopped mid-run. Use recheck_before_commit at the commit point. inflight.wait_cancellable stops waiting, but the thread finishes in the background.
Claude Code, Codex, Copilot hooksThe harness runs the tool, so Prismor cannot stop it. Only the pre-call check applies.

A cancel can only be as fast as the revoke reaches the device. Policy arrives by poll: every PRISMOR_POLICY_REFRESH_SECONDS (default 30, minimum 5). A restriction that rides on the call's resource is seen at the next re-check with no poll.