TrendWhat rose on GitHub, every day at 07:30 KST · 한국어

GitHub · as of November 8, 2026 · View on GitHub →

Dicklesworthstone/destructive_command_guard

AI agent safety hook

Block dangerous commands before AI coding agents execute them

When an AI coding tool attempts to run commands like git reset --hard or rm -rf, this tool intercepts them before they reach the terminal, stopping execution. It acts as a safety layer to prevent AI agents from accidentally deleting important data or damaging the system. After installation, it automatically checks every command the agent runs, blocking dangerous patterns and explaining why the command was blocked along with safer alternatives.

Real-time interception before command execution

The tool intervenes just before an AI agent executes a command to analyze its content. The analysis is fast enough that users experience almost no latency. It goes beyond simple string matching to distinguish whether a command is actually being executed or merely mentioned as data. For example, it accurately differentiates between a text reference like grep "rm -rf" and an actual attempt to run rm -rf /, reducing false positives. When a block occurs, it displays a clear reason and alternative in the terminal so users can immediately understand the situation.

Expandable protection with over 50 security packs

By default, it blocks dangerous file system and Git commands, but you can add protection for other tools via configuration files. More than 50 security packs are available for databases, containers, cloud, and infrastructure tools, allowing you to enable them selectively based on your environment. For instance, you can block PostgreSQL's DROP TABLE, Docker's system prune, or AWS instance termination commands. Each pack is managed independently, and you can enable entire categories or select individual packs. This allows developers who primarily use specific tools to focus on managing only the dangerous commands for those tools.

Integration with various AI coding agents

It is compatible with major AI coding agents such as Claude Code, Codex CLI, Gemini CLI, GitHub Copilot, and Cursor. The installation script automatically detects the user's platform and agent to apply the necessary settings. Because each agent executes commands differently, it sends block signals according to that agent's protocol. For example, Codex CLI receives a JSON-formatted refusal message on standard output, while other agents receive a human-readable message on the error stream. This integration ensures the same level of protection without requiring separate configuration for each agent.

Installation and initial setup

It supports Linux, macOS, and Windows (WSL) and can be installed with a single command. The installation script detects the platform, downloads the correct binary, and automatically configures hooks for detected agents. In native Windows environments, a PowerShell installation script is used, verifying binary integrity through SHA256 checksums and signature verification. Even without a default configuration file, the most dangerous file system and Git commands are blocked automatically. If additional protection is needed, create the ~/.config/dcg/config.toml file to specify which security packs to enable.

Considerations before use

Since the tool checks every command an AI agent executes, you need a bypass method if you intentionally need to run dangerous commands. You can set the environment variable DCG_BYPASS=1 or use a temporary allow code to bypass specific commands. It is recommended to add frequently needed commands to an allow list. The core.filesystem and core.git packs are always active and cannot be disabled, so commands in this scope are always blocked. To lower the severity of specific rules, you must explicitly specify the rule ID; general configuration changes cannot relax critical-level rules. It is advisable to use the dcg explain command to check in advance which commands will be blocked in your workflow.

Written by AI from this repository's README on November 2, 2026. For the facts, the original on GitHub is the reference.

By the numbers

GitHub trending history
4 days between Jun 19, when Trend began recording, and Nov 8, 2026 · first on Jul 12 · best daily rank #1 (Jul 12)

Read from GitHub, as of November 2, 2026. None were read on November 8, 2026.

Language
Rust
Topics
ai-agents · cli · developer-tools · git · rust · safety
Stars
6,240
Contributors
6
Forks
263
Latest release
v0.16.0 · November 1, 2026
Commits
3,134
Last commit
November 2, 2026
Open issues
39
Open pull requests
1

Related repositories

View on GitHub →

README badge

trend.ondo.sh · GitHub daily trending #1 · July 12, 2026

The badge above shows the highest this repository has ranked on GitHub's daily trending since June 19, 2026, and the day it did. Paste the Markdown below into your README. The badge opens this page.

[![trend.ondo.sh](https://trend.ondo.sh/github/r/Dicklesworthstone--destructive_command_guard/badge.en.svg)](https://trend.ondo.sh/github/r/Dicklesworthstone--destructive_command_guard/en.html)