Agent Approve for OpenHands

Centralized approvals, guardrails, and activity monitoring for OpenHands from your phone

OpenHands logo
Autonomous agentCLIHook integration

Agent Approve adds a supervision layer to your OpenHands setup using OpenHands' native .openhands/hooks.json lifecycle hooks. Approve or deny shell commands, MCP tool calls, file writes, and reads from your iPhone or Apple Watch, with push notifications so you know the moment OpenHands needs a decision.

When the agent finishes a turn, the blocking stop hook holds the run open while Agent Approve waits for an iPhone-supplied follow-up command — type or dictate the next instruction, and OpenHands continues with it as the next user message. The same shared allow and deny rules cover OpenHands and every other agent you supervise: Cursor, Claude Code, Gemini CLI, Codex, Pi, OpenCode, OpenClaw, Hermes, Windsurf, and Copilot.

Install OpenHands

Quick start

1

Download Agent Approve from the App Store and complete onboarding.

2

Run npx agentapprove on your machine and select OpenHands.

3

The installer writes ~/.openhands/hooks.json with the six lifecycle events wired to the Agent Approve dispatcher.

4

Scan the QR code to pair, then start using OpenHands — approval requests and stop-input prompts arrive on your phone.

Install command

npx agentapprove

Agent Approve config: ~/.agentapprove/

OpenHands hook config: ~/.openhands/hooks.json


Recommended configuration

  • OpenHands resolves hooks per workspace from <project>/.openhands/hooks.json. The installer writes a user-global default at ~/.openhands/hooks.json; if OpenHands does not auto-resolve it in a specific workspace, copy or symlink the file into that project.
  • Pre-tool and stop events block synchronously (exit 2 / decision:deny). Session and post-tool events run async: true so they never delay the agent loop.

Capabilities

Approval requests
Follow-up commands
Voice input
Activity monitoring
Push notifications
MCP tool tracking

Good to know

1

Six lifecycle eventspre_tool_use, post_tool_use, user_prompt_submit, stop, session_start, session_end all route through a single bundled dispatcher (openhands-hook.sh).

2

Blocking pre-tool approval – Shell commands, file writes, file reads, and MCP tool calls all flow through pre_tool_use. A deny on your phone returns {"decision":"deny","reason":"..."} so OpenHands cancels the tool call and surfaces your reason to the agent.

3

Follow-up commands on stop – OpenHands' stop hook is blocking, so Agent Approve holds the run open while you type or dictate the next instruction on your phone. The reply comes back as decision:deny with the follow-up text as reason, and OpenHands acts on it as the next user message — same UX as Cursor and Claude Code.

4

Voice input – Especially useful when OpenHands runs headless on a server or in a sandbox. Dictate the follow-up from your watch or phone instead of switching back to the terminal.

5

MCP tracking – Tools with the mcp__server__tool naming convention are grouped by server in your activity history so you can see which MCP servers OpenHands actually used.

6

User prompts are logged, never blockeduser_prompt_submit emits a telemetry event so prompts appear in activity history, but Agent Approve never blocks the prompt itself; this product is self-governance for indie developers, not corporate prompt surveillance.

7

Bulk command parsing – Policy evaluation splits shell commands chained with && into individual sub-commands evaluated independently. A dangerous command like rm -rf hidden as the third step in a chain is caught even when the batch starts with safe commands.

8

Stay up to date – Run npx agentapprove again to refresh hooks. The installer is idempotent and preserves any non-Agent-Approve entries already in your hooks.json.


Use cases

Block destructive shell commands and risky MCP tool calls from iPhone or Apple Watch before OpenHands runs them.

Send voice or text follow-ups from your phone the moment OpenHands finishes a turn — useful when the agent runs headless on a server.

Track OpenHands prompts, tool calls, MCP usage, and stop events in the same unified activity history as your other agents.

Apply the same deny rules to OpenHands that you use for Cursor, Claude Code, Gemini CLI, Codex, Pi, OpenCode, OpenClaw, Hermes, and Copilot.

See what OpenHands is doing in a sandbox or remote workspace when you are away from the terminal — push notifications surface the moments that need a decision.


Questions about OpenHands

A few common questions about how Agent Approve fits alongside OpenHands.