@dannyliv

Agent Guard

Automatic prompt-injection screening for OpenCLAW tool calls. Auto-registers a before_tool_call hook that screens web fetch/search results and other untrusted tool content.

当前版本
v0.5.0
code-plugin社区source-linked

agent-guard-openclaw

Automatic prompt-injection screening for OpenCLAW tool calls. This is the OpenCLAW plugin half of agent-guard-plugins.

What it does

Once installed, OpenCLAW discovers and activates this plugin automatically (activation.onStartup: true). It registers a before_tool_call hook that runs on every tool call. The hook collects the tool's textual params (web page text, search results, email body, GitHub issue text, MCP tool output, and similar untrusted content) and screens them with the Content Guard engine from agent-guard-plugins. Risky content blocks the tool call before the agent acts on it. Trusted / authorized channels are skipped per your Content Guard config.

No manual wrapping. No AGENTS.md step. Install it and it is active.

Install

The plugin needs both the npm package (the OpenCLAW seam) and the Python package (the screening engine):

# Python screening engine — provides the `agent-guard-openclaw` bridge
pip install agent-guard-plugins

# OpenCLAW plugin — auto-registers the before_tool_call hook
openclaw plugins install agent-guard-openclaw

Configuration

Screening policy (trust list, block threshold, block/warn mode) lives in the Content Guard config file at ~/.agent-guard/content_guard.toml. See the agent-guard-plugins README for that file's schema. The plugin itself reads:

Env varDefaultPurpose
AGENT_GUARD_OPENCLAW_DISABLEDunset1/true loads the plugin but screens nothing (kill switch).
AGENT_GUARD_PYTHONpython3Python executable that has agent_guard_plugins installed.
AGENT_GUARD_OPENCLAW_TIMEOUT_MS15000Per-tool-call budget for the screening subprocess.

Fail-open

If the screening bridge cannot run (Python missing, model load failure, timeout), the hook returns no decision and the tool call proceeds. A broken guard never wedges the agent.

Maintainer and license

Maintained by @dannyliv. Report issues or vulnerabilities on the main repository. Licensed under Apache-2.0.

源码与版本

源码仓库

dannyliv/agent-guard-plugins

打开仓库

源码提交

4a9df8dfa4d902aebb872595bfb5831a4ac5117c

查看提交

安装命令

openclaw plugins install clawhub:agent-guard-openclaw

元数据

  • 包名: agent-guard-openclaw
  • 创建时间: 2026/05/17
  • 更新时间: 2026/05/17
  • 执行代码:
  • 源码标签: main

兼容性

  • 构建于 OpenClaw: 2026.5.7
  • 插件 API 范围: >=2026.3.24-beta.2
  • 标签: latest
  • 文件数: 4