Install
openclaw plugins install openclaw-agent-protocol@latestInfrastructure-level routing enforcement for OpenClaw multi-agent systems. Agents must dispatch restricted tools to the correct specialist — enforced at the gateway level, not the prompt level.
openclaw plugins install openclaw-agent-protocol@latestThe missing enforcement layer for OpenClaw multi-agent systems.
Agents that always delegate correctly. Every time. At infrastructure level.
In a multi-agent setup, you define roles — Coder writes code, Ghost scrapes the web, Sentinel runs terminals. But agents are free to ignore that. They can execute terminal commands when they shouldn't, write files directly instead of dispatching, or scrape the web without routing through the right agent.
Prompt-level instructions get overridden, forgotten, or bypassed. You end up with agents that do things they shouldn't, and you lose the consistency that makes multi-agent systems trustworthy.
OpenClaw Agent Protocol is a gateway-level enforcement hook that intercepts every tool call before it executes. If an agent tries to run a tool that should be dispatched to another agent, it gets blocked — not warned, not logged after the fact. Blocked, with a compliance record and an approval dialog.
Agent tries to run "exec" (terminal command)
│
▼
┌─────────────────────────────────┐
│ OpenClaw Agent Protocol hook │ ← gateway-level, not prompt-level
│ (before_tool_call) │
└──────────────┬──────────────────┘
│
┌────────▼────────┐
│ Routing policy? │
│ Should this agent │
│ handle this tool? │
└────────┬────────┘
│
┌──────┴──────┐
│ NO │ YES
▼ ▼
Block + Log Pass through
+ Require (normal execution)
Approval
openclaw.json and infer sensible routing defaultsenforce (block + approve), log (log only), off (passthrough)write_file and patch — route by glob patterns, not just tool namegit clone https://github.com/pavelveselov-art/openclaw-agent-protocol.git
cd openclaw-agent-protocol
npm install
npm run build
npm run setup # auto-detects your agents, generates policy, installs plugin
# Restart OpenClaw gateway
openclaw restart
The policy file (~/.openclaw/hard_stop_policy.json) maps tools to agents:
{
"enabled": true,
"mode": "enforce",
"routing": {
"exec": "sentinel",
"execute_code": "coder",
"write_file": {
"coder": ["**/*.py", "**/*.js", "**/src/**", "**/scripts/**"],
"researcher": ["**/research/**", "**/reports/**"]
},
"patch": { ... },
"browser_navigate": "ghost",
"browser_click": "ghost",
"browser_type": "ghost",
"web_search": "ghost",
"web_extract": "ghost"
},
"allowTools": ["read_file", "search_files", "session_search", "memory", "delegate_task", "cronjob", "clarify", "text_to_speech"]
}
| Entry type | Behavior |
|---|---|
String "exec": "sentinel" | All exec calls → Sentinel |
| Object with globs | Route based on params.path glob match |
# Watch the hook fire in real time
tail -f ~/.openclaw/agent-routing-debug.log
# Query the compliance audit log
sqlite3 ~/.openclaw/compliance.db "SELECT * FROM compliance_log ORDER BY timestamp DESC LIMIT 20;"
Prompts get overridden. Models can ignore system instructions, especially under task pressure or when the context window shifts. OpenClaw Agent Protocol runs at the infrastructure level — the gateway won't pass a blocked tool call to any agent, regardless of what the agent's prompt says.
MIT