LaunchKit · 2026
Back to Skills

dcg-guard

Hard-blocks dangerous shell commands (rm -rf, git push --force, etc.) before execution via OpenClaw's.

0
459 downloads
by @starensen

Setup & Installation

openclaw skills install @starensen/dcg-guard

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install dcg-guard

Version History

v1.1.0Feb 20, 2026 - Version note by skill developer:

Cross-platform: 30+ built-in rules for Windows (PowerShell/cmd) + Unix. No binary dependency required. DCG binary optional as fallback. execFileSync for injection safety.

What This Skill Does

DCG Guard intercepts every shell command before execution and blocks dangerous ones like `rm -rf`, `git push --force`, and Windows equivalents such as `Remove-Item -Recurse -Force`. Safe commands pass through silently with no added latency. Built-in rules work without the DCG binary; the binary is optional and adds extra Unix-specific checks.

Blocks commands before they reach the shell, so dangerous operations never execute, unlike post-execution logging or manual review workflows.

When to use it

  • Blocking accidental recursive deletions during agent file cleanup tasks
  • Preventing force pushes to shared git repositories
  • Stopping irreversible Windows registry deletes in automated workflows
  • Catching destructive git branch deletions before they run
  • Guarding against disk format commands in agent sessions

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Clean up the project by removing all build artifacts

AGENT
  1. 1Agent calls exec tool with `rm -rf ./dist`
  2. 2DCG Guard intercepts the call via before_tool_call hook
  3. 3Command is checked against built-in dangerous command rules
  4. 4Command matches the rm -rf pattern and is flagged as dangerous
  5. 5Plugin returns { block: true } to OpenClaw, command never executes
OUTPUT

Command blocked; agent is notified and must request explicit user permission before retrying