destructive_command_guard

A fast Rust safety hook that blocks destructive shell, git, and filesystem commands before AI coding agents run them. 50+ security packs (databases, Kubernetes,

What is destructive_command_guard?

A fast Rust safety hook that blocks destructive shell, git, and filesystem commands before AI coding agents run them. 50+ security packs (databases, Kubernetes, Docker, cloud, Terraform), heredoc/inline-script scanning, CI scan mode, and explain mode; works with Claude Code, Codex, Gemini, Copilot, Cursor, and more.

Overview of destructive_command_guard

What it is

dcg (Destructive Command Guard) is a high-performance safety hook for AI coding agents. It intercepts destructive shell, git, and filesystem commands before they execute, protecting work from accidental deletion. It supports Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, VS Code Copilot Chat, Cursor IDE, Hermes Agent, Posit Assistant, Grok (xAI), Oh My Pi, and other tools.

Key features

  • Blocks destructive shell, git, and filesystem commands out of the box - 50+ security packs covering databases, Kubernetes, Docker, AWS/GCP/Azure, Terraform, and more - Heredoc and inline script scanning catches embedded dangerous commands - CI scan mode for pre-commit hooks and code review - Explain mode shows why a command is blocked - Sub-millisecond latency with SIMD-accelerated filtering - Agent-specific profiles allow per-agent configuration of packs and allowlists

Use cases

  • Preventing AI coding agents from accidentally running git reset --hard, rm -rf, or DROP TABLE
  • Protecting uncommitted work during agent-assisted development - Integrating into CI/CD pipelines to catch dangerous commands in pull requests - Adding a safety layer for any tool that invokes shell commands

Getting started

bash curl -fsSL 'https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.sh?$(date +%s)' | bash -s -- --easy-mode For native Windows (PowerShell): powershell & ([scriptblock]::Create((irm 'https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.ps1'))) -EasyMode -Verify Works on Linux, macOS, and Windows via WSL. The installer auto-detects the platform, downloads the correct binary, and configures supported agent hooks.

License and pricing

The license is not stated in the repository metadata (NOASSERTION). The project is listed as open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/dicklesworthstonedestructive-command-guard.svg)](https://yunodb.com/tools/dicklesworthstonedestructive-command-guard?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/dicklesworthstonedestructive-command-guard?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/dicklesworthstonedestructive-command-guard.svg" alt="Featured on YunoDB" height="20"></a>