Clawreins
Intervention layer with audit logs for OpenClaw agents. Browser-aware. Trajectory-aware. Human-routable.
Install / Use
/learn @pegasi-ai/ClawreinsREADME
OpenClaw is powerful. That's the problem. ClawReins is the watchdog layer.
ClawReins sits between an AI agent and the real world. It’s the watchdog layer for computer-using agents. ClawReins protects agents at two stages:
- Before runtime → security scanning
- During runtime → action interception
Think of it as sudo for AI agents. The first production integration is OpenClaw. ClawReins plugs into the before_tool_call event and adds:
- Prevent destructive actions before they execute
- Pause for human approval with YES / ALLOW / CONFIRM flows
- Prove what happened with durable audit logs and post-incident review
OpenClaw cannot be its own watchdog. Neither can any CUA.
Demo

Hero example: an OpenClaw agent tries to bulk-delete 4,382 Gmail messages. ClawReins blocks it before execution.
That is the core runtime story:
- destructive action detected
- execution paused before side effects
- human approval required
- decision written to the audit trail
In The News
- TechCrunch (February 23, 2026): A Meta AI security researcher said an OpenClaw agent ran amok on her inbox
Intercept Example

Runtime Interception
Runtime interception is the enforcement layer. It is what stops an agent mid-trajectory when the action is destructive, irreversible, or operating under risky browser state.
Core capabilities:
- Browser-state awareness for CAPTCHA, 2FA, and challenge walls
- Irreversibility scoring for risky versus catastrophic actions
- Runtime intervention across terminal and messaging approval channels
- ToolShield-aligned hardening for new tool rollouts
- Full audit logging for every approval decision
Security Scan
ClawReins includes a security scanner that audits the local OpenClaw environment for high-signal misconfigurations before runtime problems turn into incidents.

clawreins scan audits a local OpenClaw installation for high-signal security misconfigurations, writes an HTML report to ~/Downloads/scan-report.html, and prints a file:// link directly in the terminal.
Usage:
# Run the 13-check audit and save the HTML report
clawreins scan
# Save the report and try to open it automatically
clawreins scan --html
# Machine-readable output for CI
clawreins scan --json
# Apply supported auto-fixes after confirmation
clawreins scan --fix
# Apply supported auto-fixes without prompting
clawreins scan --fix --yes
# Compare against the last saved baseline and alert on drift
clawreins scan --monitor
# Compare against the baseline and invoke a notifier when drift is detected
clawreins scan --monitor --alert-command "/path/to/send-openclaw-alert.sh"
Supported auto-fixes:
- Rebinding gateway host from
0.0.0.0to127.0.0.1 - Tightening config file permissions to
600 - Injecting a default
tools.exec.safeBinsallowlist - Disabling
authBypass/skipAuth/disableAuthstyle flags
Before any fix is applied, ClawReins creates a timestamped backup in ~/.scan-backup/.
Drift Monitoring
Drift monitoring is opt-in. It is designed for scheduled runs, not enabled by default.
Default monitoring behavior:
- disabled by default
- run every 24 hours when scheduled
- compare against
~/.openclaw/clawreins/scan-state.json - alert only on worsened posture: verdict worsening, new
WARN, or newFAIL - no background auto-fix
- HTML report still written to
~/Downloads/scan-report.html
Manual run:
clawreins scan --monitor
The first run creates a baseline. Later runs compare the current report against that saved baseline and only alert when posture worsens.
If you want scheduled jobs to notify through your own transport, add --alert-command. This command runs only when drift is detected. ClawReins exports these environment variables to the notifier:
CLAWREINS_SCAN_SUMMARYCLAWREINS_SCAN_VERDICTCLAWREINS_SCAN_REPORT_PATHCLAWREINS_SCAN_REPORT_URLCLAWREINS_SCAN_STATE_PATHCLAWREINS_SCAN_WORSENED_CHECKS
That makes it easy to route alerts through:
- an OpenClaw messaging wrapper
- a webhook sender
- email, Slack, Telegram, or WhatsApp bridge scripts
Notifier example:
clawreins scan --monitor \
--alert-command "$HOME/bin/send-openclaw-alert.sh"
The alert hook is generic on purpose. The scan CLI does not directly call the in-process OpenClaw plugin API from cron or system schedulers, so the notifier command is the bridge if you want alerts to land through OpenClaw-managed messaging.
Scheduled Runs
Recommended operating model:
- run once per day
- use
--monitorso each run compares against the last saved baseline - add
--alert-commandif you want drift notifications delivered outside the terminal - never use
--fixin scheduled jobs
What happens on scheduled runs:
- The first scheduled run creates the baseline in
~/.openclaw/clawreins/scan-state.json. - Later runs compare the current
ScanReportagainst that saved baseline. - ClawReins alerts only when posture worsens: verdict gets worse, a check changes from
PASStoWARN, or a check changes fromPASSorWARNtoFAIL. - Every run still writes
~/Downloads/scan-report.htmlso the latest full report is easy to inspect.
Recommended scheduler settings:
- frequency: every 24 hours
- stdout/stderr: append to a dedicated log file such as
~/.openclaw/clawreins/scan-monitor.log - environment: set
HOMEandOPENCLAW_HOMEexplicitly - notifier: use
--alert-commandfor OpenClaw wrappers, webhooks, or messaging bridges
Example daily job with drift logging only:
0 9 * * * /usr/bin/env \
HOME=$HOME \
OPENCLAW_HOME=$HOME/.openclaw \
/usr/local/bin/clawreins scan --monitor \
>> $HOME/.openclaw/clawreins/scan-monitor.log 2>&1
Example daily job with drift alert delivery:
0 9 * * * /usr/bin/env \
HOME=$HOME \
OPENCLAW_HOME=$HOME/.openclaw \
/usr/local/bin/clawreins scan --monitor \
--alert-command "$HOME/bin/send-openclaw-alert.sh" \
>> $HOME/.openclaw/clawreins/scan-monitor.log 2>&1
If you want the scheduled job to fail loudly for automation, the exit codes stay the same in monitor mode:
0forSECURE1forNEEDS ATTENTION2forEXPOSED
That makes scheduled monitoring usable from cron, systemd, CI, or any wrapper that reacts to non-zero exit codes.
Security Checks
| Check | Severity | Detects | Auto-fix |
|------|----------|---------|----------|
| GATEWAY_BINDING | Critical | Gateway listening on 0.0.0.0 or missing localhost binding | Yes |
| API_KEYS_EXPOSURE | Critical | Plaintext API keys, tokens, passwords, or secrets stored directly in config files | No |
| FILE_PERMISSIONS | Critical | Config files readable by group or other users instead of 600 | Yes |
| HTTPS_TLS | Warning | Missing HTTPS/TLS or certificate-related configuration | No |
| SHELL_COMMAND_ALLOWLIST | Critical | Missing safeBins or equivalent shell allowlist / unrestricted shell execution | Yes |
| SENSITIVE_DIRECTORIES | Warning | Agent environment can still reach directories like ~/.ssh, ~/.gnupg, ~/.aws, or /etc/shadow | No |
| WEBHOOK_AUTH | Warning | Webhook endpoints configured without auth tokens or shared secrets | No |
| SANDBOX_ISOLATION | Warning | No Docker or sandbox isolation detected | No |
| DEFAULT_WEAK_CREDENTIALS | Critical | Default, weak, undefined, or missing gateway credentials | No |
| RATE_LIMITING | Warning | No gateway throttling or rate limit configuration | No |
| NODEJS_VERSION | Critical | Node.js versions affected by CVE-2026-21636 permission-model bypass window | No |
| CONTROL_UI_AUTH | Critical | Control UI authentication bypass flags enabled | Yes |
| BROWSER_UNSANDBOXED | Critical | Browser skill config missing headless: true or sandbox: true protection | No |
Exit codes:
0=SECURE1=NEEDS ATTENTION2=EXPOSED
Why?
OpenClaw can execute shell commands, modify files, and access your APIs. OS-level isolation (containers, VMs) protects your host machine, but it doesn't protect the services your agent has access to.
ClawReins solves this by hooking into OpenClaw's before_tool_call plugin event. Before any dangerous action executes (writes, deletes, shell commands, API calls), the agent pauses and waits for your decision. In a terminal, you get an interactive prompt. On messaging channels (WhatsApp, Telegram), the agent asks for YES/NO/ALLOW or explicit CONFIRM token (for irreversible actions) via a dedicated clawreins_respond tool. Every choice is logged to an immutable audit trail. Think of it as sudo for your AI agent: nothing happens without your explicit permission.
Features
- Prevent Stop destructive actions before execution, score irreversibility, detect risky browser state, and harden tool rollout with ToolShield-aligned guardrails.
- Pause Route high-impact actions through terminal or messaging approva
