Rightshold™ Sign up

Answers · agent safety

How do I re-check agent authority at execution time, not only at plan time?

Last updated

TL;DR: A plan-time "yes" is not a standing warrant. Issue a short-lived execution grant that names the exact action, binds a hash of the arguments, and records the policy version (or settings hash) that was in force when the human or classifier approved. Immediately before the side effect — shell, MCP tools/call, payment, or deploy — load that grant again, confirm it is unexpired and unused, re-hash the arguments, and compare the live policy version. If the policy changed, the grant is missing, or the arguments drifted, fail closed and ask again. Claude Code re-evaluates permission rules on each tool call (deny → ask → allow) and applies /permissions edits from the next call in the same turn; Cursor Auto-review evaluates each shell, MCP, and Fetch call before it runs. Your own runners should do the same with an external grant store the agent cannot edit.

What should I check, step by step?

1. Split plan from execute: planning/read-only work can use a broad explore mode; anything that writes, pays, sends, or reaches the network needs an execution-time check.

  1. When you approve (human or policy engine), mint a grant: grant id, agent id, action type, argument hash, policy_version (or hash of permissions.json / spend policy / CLAUDE settings), issued_at, expires_at (minutes, not days), and single-use.
  2. Store the grant outside the agent's editable session (server DB, ledger, or checkpointer the agent's tools cannot UPDATE). Give the agent only the grant id.
  3. In the tool runner, on every risky call: load grant by id → reject if missing/expired/consumed → recompute argument hash → reject on mismatch → load current policy_version → reject if ≠ grant.policy_version → then run and mark the grant consumed.
  4. Wire client-native per-call checks too: Claude Code permission modes and /permissions rules are enforced per tool call; Cursor Run Modes (Auto-review / Allowlist) gate shell, MCP, and Fetch before execution — do not disable them because you already "approved the plan."
  5. On policy edits (spend caps, deny rules, allowlists, mode changes), bump policy_version so in-flight grants fail closed instead of silently following the old yes.
  6. Log allows, denies, expiries and policy-mismatch failures with the grant id and policy_version so you can audit which authority was live at the moment of execution.
  7. Never treat chat memory, a checkbox in the prompt, or approved=true in session JSON as the authority check at execution time.

Why isn't plan-time approval enough?

Between "looks good" and the write/pay call, the user can tighten deny rules, lower a spend cap, revoke a credential, or the agent can change arguments (amount, path, recipient) after the yes.

How do short-lived grants tie to a policy version?

Policy version is a monotonic integer or content hash of the rules that mattered: spend caps, tool allow/deny lists, permission mode, and network allowlists. Stamp it on the grant at approve time.

What can go wrong?

The plan was approved in Plan/ask mode, then the session switched to bypassPermissions or Run Everything and no second check ran.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “Before my agent executes this risky tool call, ask me to approve the exact action, bind the yes to a hash of the arguments and to the current policy version, expire it quickly, and wait for my decision.”

One-click setup

{
  "tool": "request_human_approval",
  "arguments": {
    "summary": "Allow deploy-agent to run kubectl apply for manifests/payments-v3.yaml in prod (policy_version 14)",
    "action": {
      "type": "tool_call",
      "tool": "kubectl_apply",
      "path": "manifests/payments-v3.yaml",
      "cluster": "prod",
      "policy_version": 14
    },
    "expires_in_minutes": 15
  }
}

Rightshold records approval requests, spend authorizations and signed receipts for agents that call it. It does not replace Claude Code permissions, Cursor Run Modes, or your orchestrator's tool runner. Fail closed in those runners when the grant or policy_version check fails. Not legal advice.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'