@agentapprove/opencode
v0.1.5
Published
Agent Approve plugin for OpenCode - approve or deny AI agent tool calls from your iPhone and Apple Watch
Maintainers
Readme
@agentapprove/opencode
Agent Approve plugin for OpenCode. Approve or deny AI agent tool calls from your iPhone and Apple Watch.
Why Agent Approve?
- Visibility -- see what your OpenCode agent is doing in real time from your mobile device
- Centralized policy -- define your default stance (allow, deny, or ask) and manage custom allowlists and denylists for tools, parameters, and commands
- Mobile approval -- when human approval is required, review and respond from your iPhone or Apple Watch with a tap
You decide the rules. Agent Approve enforces them.
Important
- A valid Agent Approve subscription is required to use this plugin.
- You must download the iOS app, run
npx agentapprove, and pair your device. - This plugin is currently pre-launch software. Public App Store availability is not open yet.
- If a valid token is not configured, permission checks are denied and setup guidance is printed locally.
How it works
This plugin hooks into OpenCode's event system to enforce your approval policy:
- permission.ask -- evaluates each tool call against your policy and blocks until allowed/denied
- tool.execute.before / tool.execute.after -- logs tool lifecycle events
- chat.message -- logs user prompt activity
- event / experimental.session.compacting -- logs session lifecycle and compaction events
Install
- Download Agent Approve from the App Store and start your 7-day free trial
- Run the installer on each machine where you use OpenCode:
npx agentapproveThe installer handles pairing, token setup, and OpenCode plugin activation. Select OpenCode when prompted for which agents to configure.
- Restart OpenCode to load the plugin
That's it. Tool calls will now be evaluated against your policy, and approval requests will appear on your paired device when needed.
Manual setup (advanced)
If you already have Agent Approve configured and just need to add the OpenCode plugin, add @agentapprove/opencode to your OpenCode config:
~/.config/opencode/opencode.json
{
"plugin": [
"@agentapprove/opencode"
]
}OpenCode automatically installs npm plugins listed in the plugin array at startup. Restart OpenCode to activate.
Configuration
Plugin behavior is configured through Agent Approve environment settings in:
~/.agentapprove/env
| Setting | Default | Description |
|---------|---------|-------------|
| AGENTAPPROVE_TIMEOUT | 300 | Seconds to wait for an approval response |
| AGENTAPPROVE_FAIL_BEHAVIOR | ask | Default policy when API is unreachable: allow, deny, or ask |
| AGENTAPPROVE_PRIVACY | full | What tool data is stored in event logs: minimal, summary, or full |
| AGENTAPPROVE_DEBUG | false | Write debug logs to ~/.agentapprove/hook-debug.log |
| AGENTAPPROVE_AGENT_NAME / AGENTAPPROVE_OPENCODE_NAME | OpenCode | Display name for this agent |
| AGENTAPPROVE_E2E_ENABLED | false | Enable end-to-end encryption for non-approval event content |
Requirements
- OpenCode runtime
- Agent Approve iOS app and active subscription ($9.99/month or $99/year, 7-day free trial)
Supported agents
Agent Approve works with OpenCode, OpenClaw, Claude Code, Cursor, Gemini CLI, VS Code Agent, Copilot CLI, OpenAI Codex (coming soon), and more. Run npx agentapprove to configure multiple agents at once.
