SafeAI-Lab-X/ClawKeeper
Sobre
ClawKeeper: proteção abrangente para a segurança de agentes OpenClaw por meio de Skills, plugins e watchers (também conhecido como o Norton do OpenClaw)
Segurança e privacidadeCrescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- -1
- em 15 dias
- 0
- em 1 mês
- +1
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalClawKeeper
Host-agnostic safety middleware for tool-using agentic systems (can be wired into Hermes Agent, MCP tools, HTTP bridges, OpenClaw-style runtimes, or a custom host).
ClawKeeper sits between an agent and its tools. It can block risky tool calls, redact sensitive tool results, remember recurring attack patterns & self improve guardrail layers, and delegate harder trajectory-level decisions to an external Watcher.
What it is for
- Guarding shell, Python, browser, filesystem, and network tool calls before execution.
- Catching common agent-security failures: prompt injection, credential reads, credential exfiltration chains, unsafe shell execution, protected-path access, SSRF-like URLs, encoded second-stage payloads, and poisoned tool output.
- Running a host-independent Judge API for non-Python adapters.
- Running an optional Watcher daemon that reasons over intent, recent tool history, deterministic findings, and proposed tool calls.
- Self-improving guard coverage: Watcher catches can synthesize learned patterns, persist them under
~/.clawkeeper/, and hot-reload them into the live guard layer.
Install
git clone [email protected]:SafeAI-Lab-X/ClawKeeper.git
cd ClawKeeper
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Sanity check:
pytest -q
Use with Hermes Agent
from run_agent import AIAgent
from clawkeeper_core import Judge
from clawkeeper_core.adapters.hermes import install as install_clawkeeper
agent = AIAgent(...)
install_clawkeeper(Judge(), agent)
agent.run("your task")
This installs the default pre-tool guard chain and post-tool-result scanners. No Hermes patching is required.
Run the HTTP core
For hosts that cannot import the Python package directly:
clawkeeper-server
curl http://127.0.0.1:7474/v1/health
Useful endpoints include /v1/judge, /v1/event, /v1/audit, /v1/scan/logs, /v1/scan/skill, and maintenance harden/rollback routes.
For a proposed tool call, send toolCall with toolName and the structured
params; provide earlier messages in forwardedContext.messages when available.
The service checks the proposed call before the Judge applies cancellation,
error, step-limit, and explicitly configured confirmation rules. For example:
{"toolCall": {"toolName": "my_terminal", "params": {"command": "ls -la"}}}
The command gets the same content checks as bash, with no extra confirmation
by default if those checks pass. OpenClaw and the existing guarded MCP gateway
use these same pre-execution checks. MCP calls outside a covered host or gateway
are outside the check path.
Run the Watcher
The Watcher is optional. It is useful when single-command rules are not enough and the decision depends on intent, recent tool history, or multi-step drift.
export CK_WATCHER_API_KEY="$OPENAI_API_KEY"
export CK_WATCHER_BASE_URL="$OPENAI_BASE_URL" # optional, OpenAI-compatible
export CK_WATCHER_MODEL="gpt-5.5" # or your configured model
python -m clawkeeper_core.watcher.daemon
curl http://127.0.0.1:9099/watcher/health
Wire it into Hermes:
install_clawkeeper(
Judge(),
agent,
watcher_url="http://127.0.0.1:9099",
)
Core guards
ClawKeeper checks commands locally before a tool runs them. It blocks known dangerous commands and pauses the tool call for review when it cannot determine what would run. Keep your host's permissions and sandbox enabled.
The default guards also check for:
- protected file access, including paths used in scripts
- unsafe URL / SSRF patterns
- base64/hex encoded payloads
- credential discovery followed by network exfiltration
After a tool runs, ClawKeeper scans its results for malicious instructions and redacts recognized credentials.
The URL guard checks addresses in tool requests. To restrict where a tool can connect, use a tool that enforces destination checks or configure outbound network restrictions on the host. See security boundaries.
Development
pip install -e ".[dev]"
pytest -q
Red-team fixtures and benchmark scripts live under tests/redteam/ and experiments/.
License
Apache-2.0.
Explore projetos relacionados
Carregando…