Skip to content
Agentic Control Plane

OpenClaw Hooks and Permissions: before_tool_call, Approvals and What Happens When ACP Is Down

David Crowe David Crowe · · Updated · 9 min read
openclaw hooks permissions reference
Share X HN LinkedIn

Just want the answer?

OpenClaw's control point is a plugin hook called before_tool_call, not a hooks.json file. Install the ACP plugin:

curl -sf https://agenticcontrolplane.com/install.sh | bash
# or by hand:
openclaw plugins install @agenticcontrolplane/openclaw

Full walkthrough: OpenClaw install guide. Native control model: OpenClaw permissions, explained.

OpenClaw is a personal-assistant gateway that fronts messaging channels, and it usually runs with nobody watching. It isn’t a terminal coding agent. Its hooks look different too. There’s no hooks.json to edit. Instead, plugins register a typed hook that runs before each tool call and can plug into OpenClaw’s own approval flow.

Two hook systems, and only one sees tool calls

OpenClaw has two kinds of hooks.

  • Plugin hooks are in-process TypeScript, registered from a plugin’s entry point. before_tool_call and after_tool_call live here, next to agent and message events.
  • Internal hooks are shell scripts you write, triggered by command and gateway events. They can’t see tool calls. A tool:before / tool:after pair has been requested but doesn’t exist.

So if someone says they added a hook to control what OpenClaw’s tools do, ask which kind. Only a plugin hook can see a tool call before it runs.

before_tool_call: block, or ask for approval

before_tool_call can return { block: true }, which stops the call and any lower-priority handlers. Or it can return a requireApproval result. The approval resolves to allow-once, allow-always, deny, timeout or cancelled. That’s how a plugin can use OpenClaw’s own approval flow instead of adding a second approval screen.

Two checks before you rely on it:

  • Only the typed hook runner calls before_tool_call and after_tool_call. The older registerHook path still exists for backward compatibility, and it doesn’t fire them. A plugin registered the old way never sees a tool call.
  • before_tool_call sat in the codebase for a while before it was wired into the execution path. After any fresh install, run a real test call. Don’t trust that the hook name appears in the docs.

Installing the ACP plugin

curl -sf https://agenticcontrolplane.com/install.sh | bash

Or by hand:

openclaw plugins install @agenticcontrolplane/openclaw

Before each tool runs, the plugin sends it to ACP to check (POST /govern/tool-use). After it runs, the plugin sends the result (POST /govern/tool-output) for the log and content scanning. Each call, decision and identity lands in the activity log, with the sender attached where OpenClaw provides one.

When ACP says allow, the call runs. When it says deny, the call is blocked. When it says ask, the plugin uses OpenClaw’s approval prompt if your OpenClaw build supports that. If the build doesn’t, the call is blocked and the approval waits on the console. The plugin sends the OpenClaw prompt only after checking the build acts on it. If you get asked in OpenClaw and ACP has its own pending approval for the same call, approving in one place doesn’t clear the other.

The plugin maps agents to tiers. The agent named main is interactive. Every other named agent is a subagent. Rules can differ by tier.

What happens when ACP is down

This depends on the plugin version, and the docs disagree.

In the plugin source at version 0.2.1, an outage is handled by tier. The main agent counts as interactive. Its calls go ahead, the plugin reports them as ungoverned, and a line goes in ~/.acp/lapse.log. Named agents count as subagents. Their calls are blocked until ACP answers.

The plugin’s README still says the hook fails open on network errors, with no tier split. The source is newer than that sentence. Check the version you install.

One catch for OpenClaw. A gateway that runs the main agent unattended is still treated as interactive. In an outage, that agent’s calls run ungoverned, and nobody is there to see the warning. If that worries you, run the work under a named agent.

Using it with --local

Under --local, the installer skips the plugin step for Hermes, opencode, pi, Prime Agent, Grok Build, Muse Code, Antigravity and dsh. It prints that they need a workspace. It doesn’t skip OpenClaw, so openclaw plugins install @agenticcontrolplane/openclaw runs either way.

That doesn’t mean OpenClaw works offline. --local skips sign-in and writes ~/.acp/policy.json for the on-device engine that the Claude Code and Cursor hooks call. The OpenClaw plugin doesn’t read that file. It sends calls to ACP with a workspace key. So --local plus OpenClaw is untested. Don’t count on the local rules covering it.

What this hook doesn’t reach

before_tool_call is the tool-call control point. OpenClaw’s own hardening, such as approval binding and per-sender policy, sits above it. See OpenClaw permissions, explained.

Known limits

  • Hooks see tool calls, not tokens. ACP doesn’t meter OpenClaw’s model spend. The log has allow and deny decisions per call, not token cost.
  • Check that your OpenClaw version uses the typed hook runner. The old registerHook path doesn’t fire before_tool_call.
  • Internal shell hooks can’t see tool calls. That’s how OpenClaw is built, and no plugin changes it.
  • ACP runs as a plugin inside OpenClaw. Anyone who can change the OpenClaw install can remove it. The README shows how to pause it by moving ~/.acp/credentials.

How it compares to Claude Code hooks

Claude Code hooks are registered in settings.json and run as a separate process per call. OpenClaw’s are registered by a plugin and run in-process. OpenClaw’s approval has more outcomes than Claude Code’s allow, deny or ask. Either way, a hook that controls tools needs its own plan for when it can’t reach its backend. The Claude Code hooks reference covers that side.

Frequently asked questions

What hook fires before an OpenClaw tool call?

before_tool_call, an in-process TypeScript plugin hook. It can return { block: true } to stop the call, or a requireApproval result. The approval resolves to one of allow-once, allow-always, deny, timeout or cancelled.

Are OpenClaw's operator shell hooks the same thing?

No. Operator (internal) hooks are shell scripts triggered by command and gateway lifecycle events. They never see tool calls. If someone says they added a hook to control OpenClaw’s tools, ask which of the two systems they mean.

What happens if the ACP plugin can't reach ACP?

In the plugin source at version 0.2.1, it depends on the agent. The main agent counts as interactive, so the call goes ahead and the plugin reports it as ungoverned. Named agents count as subagents, and their calls are blocked until ACP answers. The plugin’s README still says it fails open on network errors with no tier split, so check the version you install.

Does OpenClaw's ACP plugin work with the installer's --local mode?

Treat it as untested. The installer doesn’t skip the OpenClaw step under --local, but the plugin has no on-device decision path, so a local policy file doesn’t govern OpenClaw calls. The plugin governs through a workspace key.

Where to read more

Running OpenClaw? One command adds a hook. Each tool call it sees is recorded, and a force-push, destructive SQL or curl | sh is blocked until you approve it on the console or from the email.

macOS · Linux · WSL
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
Windows · PowerShell
irm https://agenticcontrolplane.com/install.ps1 | iex

What the installer writes  ·  OpenClaw guide  ·  free up to 5 agents

Share X HN LinkedIn
Get the next data drop
What agents actually cost, new tool-surface captures, and the occasional incident post-mortem — sent when we publish something worth your inbox, not on a schedule. Unsubscribe anytime.
Share: Twitter LinkedIn
Related posts

← back to blog