Install
openclaw skills install dcg-guardHard-blocks dangerous shell commands (rm -rf, git push --force, etc.) before execution via OpenClaw's before_tool_call plugin hook. Zero noise on safe comman...
openclaw skills install dcg-guardAn OpenClaw plugin that hard-blocks dangerous shell commands before they execute. Works on any OpenClaw installation (Windows, macOS, Linux, local, VPS, anywhere). No binary dependencies required.
Intercepts every exec/bash tool call via OpenClaw's before_tool_call plugin event. Pipes the command through DCG (Dangerous Command Guard). Safe commands pass silently with zero overhead. Dangerous commands are blocked before execution.
Blocked (Unix): rm -rf ~, git push --force, git reset --hard, git clean -fd, git branch -D
Blocked (Windows): Remove-Item -Recurse -Force, rd /s /q, del /s, Format-Volume, reg delete HKLM
Allowed: ls, cat, echo, git status, npm install, dir, Get-ChildItem
# After clawhub install dcg-guard:
bash install.sh
Or manually:
# 1. Install DCG binary
curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/master/install.sh | bash
# 2. Link plugin into OpenClaw
openclaw plugins install -l /path/to/dcg-guard
openclaw gateway restart
exec with a commandbefore_tool_call (runs before execution){ block: true } returned to OpenClaw, command never executesv1.1.0: Built-in rules work without the DCG binary. DCG binary is optional (adds extra unix rules). Windows fully supported out of the box.
execFileSync (not execSync). No injection risk.Optional, in openclaw.json under plugins.entries.dcg-guard.config:
{
"enabled": true,
"dcgBin": "/custom/path/to/dcg"
}
Default DCG path: ~/.local/bin/dcg
Override with env var: DCG_BIN=/path/to/dcg
Add to your workspace AGENTS.md:
When a command is blocked by DCG Guard, do NOT retry it.
Ask the user for explicit permission before attempting any alternative.
The block exists because the command is destructive or irreversible.