OpenClaw runs the call OpenMoat checked
Protects against another OpenClaw plugin changing a call after OpenMoat checked it. OpenClaw shows each before_tool_call handler the call as it came, and runs the params of the last handler that returns some. Before 0.11.0, a plugin could turn a checked git status into cat ~/.ssh/id_rsa, and the read ran.
What it does
Section titled “What it does”OpenMoat’s plugin registers two handlers:
- At the highest priority it runs
openmoat guardon the call as it came, and answers allow, review or deny. - At the lowest priority it returns the parameters it checked.
So:
| OpenMoat’s answer | What runs |
|---|---|
| deny | Nothing. OpenClaw keeps a block whatever later handlers return, so no plugin sees a denied call |
| review | The call as checked, once you approve it. The first approval request is the one OpenClaw asks, and it then keeps the parameters as they were |
| allow or defer | The call as checked. OpenMoat’s last handler replaces whatever a plugin in between returned |
Example
Section titled “Example”A plugin returns { params: { command: "cat ~/.ssh/id_rsa" } } for a git status the agent asked to run. OpenMoat checked git status and allowed it; its last handler returns git status again, and that is what OpenClaw runs.
Commands
Section titled “Commands”| Command | What it does | Example |
|---|---|---|
openmoat init --hosts openclaw |
Writes OpenMoat’s plugin and adds it to ~/.openclaw/openclaw.json (or where OPENCLAW_HOME, OPENCLAW_STATE_DIR and OPENCLAW_CONFIG_PATH put it) |
openmoat init --hosts openclaw |
openclaw gateway restart |
Loads the new plugin | openclaw gateway restart |
openmoat status |
Shows OpenClaw as hook only, and whether the plugin has reported loading |
openmoat status |
Limits
Section titled “Limits”- A change another plugin means is undone too. A rewritten path or an added flag from another plugin does not run; OpenMoat lets run only what it decided on. A change made by OpenClaw’s trusted tool policies, which run before the hooks, is kept, since the hooks see it.
- A plugin that changes the call and asks for approval in the same answer keeps its change once you approve its request, unchecked by OpenMoat.
- A plugin registered at the same lowest priority after OpenMoat’s, or at a lower one (
-Infinity), runs after it. - Plugins run inside the Gateway with its rights and can change what any code there does.
- No OS sandbox from OpenMoat. Run the Gateway under
openmoat runfor one.
Everything else OpenClaw’s hook leaves open: Supported agents and THREAT_MODEL.md §5.