GovernClaw Policy Enforcer
/install governclaw-middleware
GovernClaw Middleware
This skill provides governed wrappers for sensitive operations. It acts as a policy enforcement layer between agents and external systems.
When to Use This Skill
You MUST use governed tools from this skill instead of raw tools when:
- Calling external HTTP APIs (
governedHttpinstead ofhttp) - Running shell commands (
governedShell- future) - Reading/writing files (
governedFile- future) - Controlling a browser (
governedBrowser- future)
How It Works
- You call a governed tool (e.g.,
governedHttp) - The skill sends your request metadata to GovernClaw for policy evaluation
- GovernClaw returns
alloworblockwith a reason - If allowed: the underlying operation executes and returns results
- If blocked: the operation is cancelled and you receive a block reason
Available Tools
governedHttp
Makes HTTP requests through the GovernClaw policy engine.
Parameters:
method(string): HTTP method - "GET", "POST", "PUT", "DELETE"url(string): Target URLbody(object, optional): Request body for POST/PUTheaders(object, optional): Custom headers
Returns:
- On success: The HTTP response from the target
- On block:
{ ok: false, blocked: true, reason: "..." }
Example:
const result = await context.tools.governclawMiddleware.governedHttp({
method: "GET",
url: "https://api.example.com/data"
});
if (result.blocked) {
// Handle policy block
console.log("Blocked:", result.reason);
}
Configuration
Set the GovernClaw service URL in your environment:
export GOVERNCLAW_URL="http://127.0.0.1:8000"
Or in openclaw.json:
{
"skills": {
"governclaw-middleware": {
"env": {
"GOVERNCLAW_URL": "http://127.0.0.1:8000"
}
}
}
}
Governance Context
The skill automatically forwards these context fields to GovernClaw:
parent_id: The session ID (who owns the request)child_id: The agent ID (who is making the request)source: Where the request originated (agent, control, cron, etc.)channel: The channel ID (if applicable)node_id: The node ID (if applicable)skill: Always "governclaw-middleware"
Error Handling
Always check for blocked in responses:
const response = await context.tools.governclawMiddleware.governedHttp({...});
if (!response.ok && response.blocked) {
// Policy violation - do not retry
return { error: response.reason };
}
if (!response.ok) {
// Network or other error - may retry
return { error: "Request failed" };
}
// Success
return response.data;
Policy Modes
GovernClaw supports three governance modes:
- playground: Log-only, actions always allowed
- governed: Default mode, enforce policies
- strict: Block on any uncertainty
The skill defaults to governed mode. Future versions may allow per-request mode overrides.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install governclaw-middleware - 安装完成后,直接呼叫该 Skill 的名称或使用
/governclaw-middleware触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
GovernClaw Policy Enforcer 是什么?
Governance middleware for OpenClaw agents. Wraps HTTP, shell, file, and browser actions with policy checks via GovernClaw before execution. Required tools -... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 112 次。
如何安装 GovernClaw Policy Enforcer?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install governclaw-middleware」即可一键安装,无需额外配置。
GovernClaw Policy Enforcer 是免费的吗?
是的,GovernClaw Policy Enforcer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
GovernClaw Policy Enforcer 支持哪些平台?
GovernClaw Policy Enforcer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 GovernClaw Policy Enforcer?
由 aakash2289(@aakash2289)开发并维护,当前版本 v1.0.0。