destructive_command_guard — What is it?

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.

⭐ 1,787 Stars 🍴 70 Forks Rust NOASSERTION Author: Dicklesworthstone
Source: Official README and linked documentation View on GitHub →

Why it matters

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 documentation

Core Features

Zero-Config Protection

Blocks dangerous git/filesystem commands out of the box, requiring no additional configuration.

Source: Official README and linked documentation
50+ Security Packs

Supports a variety of security packs for databases, Kubernetes, Docker, AWS/GCP/Azure, Terraform, and more to provide broad protection.

Source: Official README and linked documentation
Sub-Millisecond Latency

Utilizes SIMD-accelerated filtering to ensure minimal latency, making it unnoticeable to the user.

Source: Official README and linked documentation
Smart Context Detection

Detects 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 documentation
Rich Terminal Output

Provides 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 documentation

Architecture

The 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 files

Project Knowledge Graph

Knowledge graph: project (center) + core features (inner hexagons) + key dependencies (outer chips) serde serde_json schemars serde_yaml toml Zero-Config ProtectionZero-Config Protect… 50+ Security Packs Sub-Millisecond LatencySub-Millisecond Lat… Smart Context DetectionSmart Context Detec… Rich Terminal Output destructive_command_… Project Core feature Key dependency

Tech Stack

LanguageRustFrameworkDoes not use any specific frameworks, relying on Rust's standard library and various crates for functionality.
serdeserde_jsonschemarsserde_yamltomltoml_editchronofancy-regexregexmemchraho-corasicksmallveccoloreddirsglobshell-wordslibcclapclap_completeonce_cell
Not specified in README or files, but likely to be platform-independent and run on standard Unix-like systems.
Source: Official repository tree and dependency files

Quick Start

Quick Install: ```bash curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.sh?$(date +%s)" | bash -s -- --easy-mode ```Windows (native, PowerShell): ```powershell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.ps1"))) -EasyMode -Verify ```
Source: Official README and linked documentation

Use Cases

dcg 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 documentation

Strengths & Limitations

Strengths

  • Provides broad protection against accidental destructive commands in AI coding environments.
  • Easy to install and configure with zero-config protection.
  • Supports a wide range of AI coding agents and integrates direct with existing workflows.

Limitations

  • The project is relatively new and may not have been thoroughly tested in all scenarios.
  • The project's licensing status is not explicitly stated, which may be a concern for some users.
Source: Official README and linked documentation

Latest Release

As 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…

Verification and evidence

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…

Comparison

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/security

Verdict

Destructive 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.

Frequently Asked Questions

What did the documentation review verify for destructive_command_guard on 2026-09-23?

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.

What evidence boundary applies to this destructive_command_guard review?

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.

Sources and review scope
This review is based on the project's public documentation. Versions, installation commands, and feature boundaries can change upstream; check the cited sources and current release before use. Sources checked on: 2026-09-23 13:55.

Reference materials: README, GitHub API, dependency files