The Destructive Command Guard (dcg) is a high-performance hook designed to block destructive git and shell commands from executing, thereby protecting code from accidental deletion across various AI coding agents.
Source: Official README and linked documentation View on GitHub →dcg is being discussed because its unique focus on preventing accidental destructive commands in AI coding environments. It addresses the pain point of data loss caused by AI agents executing dangerous commands. The project differs through its zero-config protection, broad support for various AI coding agents, and its ability to integrate with existing workflows without significant changes.
Source: Official README and linked documentationBlocks dangerous git/filesystem commands out of the box, requiring no additional configuration.
Source: Official README and linked documentationSupports a variety of security packs for databases, Kubernetes, Docker, AWS/GCP/Azure, Terraform, and more to provide broad protection.
Source: Official README and linked documentationUtilizes SIMD-accelerated filtering to ensure minimal latency, making it unnoticeable to the user.
Source: Official README and linked documentationDetects and blocks destructive commands based on context, avoiding false positives for commands like 'grep' that are not intended to be executed.
Source: Official README and linked documentationProvides clear explanations and suggestions on stderr when a command is blocked, aiding users in understanding why a command was blocked and how to proceed safely.
Source: Official README and linked documentationThe architecture of dcg is modular, with clear separation of concerns. It includes a core module for command analysis and blocking, various security packs for specific contexts, and integration modules for different AI coding agents. The project uses Rust for performance and reliability, with dependencies on libraries for serialization, regex matching, and configuration management.
Source: Official repository tree and dependency filesserdeserde_jsonschemarsserde_yamltomltoml_editchronofancy-regexregexmemchraho-corasicksmallveccoloreddirsglobshell-wordslibcclapclap_completeonce_celldcg is suitable for developers using AI coding agents such as Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, and others. It is useful in scenarios where AI agents are used to automate coding tasks, but there is a risk of accidental destructive commands being executed. This includes development environments where code is frequently modified and reviewed, and where data loss could be catastrophic.
Source: Official README and linked documentationAs of 2026-09-23, the latest version is v0.14.4, released on 2026-09-16. This edition fixes misjudgments such as SQL keywords as file name, POSIX--, proven safe temporary variables, bun/deno inline payload, hyphenated Git executable name, and duplicate hook key, and lets dcg explain report final policy mode.
Source: github.com/Dicklesworthstone/destructive_command_guard/releases/tag/v…status: docs-only | checked_at: 2026-09-23 | environment: Only check the official README, license, Codex integration instructions and v0.14.4 release | limitations: No local installation or runtime verification was performed. Did not download and install dcg, did not modify native hook, did not perform blocking test, dcg scan, dcg explain, bypass or fail-closed test | observed_output: The official latest version is v0.14.4, released on 2026-09-16; Codex support requires 0.125.0+; README explicitly deforms the original hook JSON to allow and record audit warnings by default
Source: github.com/Dicklesworthstone/destructive_command_guard/releases/tag/v…Codex's own sandbox and approval policy restricts the file system and network at the process level and determines when approval is required; dcg makes judgments based on specific dangerous modes and rule packages before executing commands, and can also cover multiple agents. The two check levels are different: the sandbox is responsible for the permission boundary, the dcg is responsible for identifying the high-risk command shape, and the actual use should be superimposed instead of replacing each other.
Source: developers.openai.com/codex/securityDestructive Command Guard is a project for developers using AI coding agents. Its focus on preventing accidental destructive commands is a critical need in the modern development field. The project's ease of use and broad compatibility make it a tool for teams looking to enhance the safety of their development processes.
The official latest version is v0.14.4, released on 2026-09-16; Codex support requires 0.125.0+; README explicitly deforms the original hook JSON to allow and record audit warnings by default No local installation or runtime verification was performed.
The review environment was: Only check the official README, license, Codex integration instructions and v0.14.4 release destructive_command_guard behavior outside that scope still needs a local check.