Destructive Command Guard CLI
dcg is an agent command-checking hook that explains matched rules; a disputed command can be examined without executing it.
- 6,259 ★ on the repository
- Last commit
Extended access
Why this level
- The installer changes agent hook configuration, and rules affect command allowance or denial.
Install
- Works in
Manual install
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.sh?$(date +%s)" | bash -s -- --easy-modeFirst README Quick Install. The script selects a binary and configures supported hooks; review it before running.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The installer changes agent hook configuration, and rules affect command allowance or denial.
This is third-party code. Review the repository files before installing.
What it does
Destructive Command Guard runs as a supported agent’s pre-execution hook. It inspects command text and available parameters, then allows, denies or requests review. Denials explain the matched rule. Rule packs cover Git, files, databases and infrastructure. Separate CLI commands explain decisions and inspect setup without executing the analyzed command. The installer registers detected clients, and that registration should be verified.
Who it is for. Owners of agent workspaces seeking to intercept destructive commands before files or infrastructure change.
Good fit when
- An agent works with uncommitted changes and destructive Git operations need interception.
- A project needs explainable blocking for certain destructive shell commands.
- A team connects multiple clients and must verify protective hooks.
- A disputed command needs rule analysis without execution.
Not a fit when
- You need operating-system isolation of arbitrary code.
- You expect coverage for clients without hook support or integration checks.
- The team would treat an allowed command as proof of safety.
Example request
Check dcg registration in my Codex setup and explain its decision for git status. Do not change permission settings yet.Limitations
dcg checks a command only when the client calls the registered hook; it does not restrict operating-system access rights. Malformed JSON may allow execution with a warning by default. `general.fail_closed = true` denies execution in that case. If analysis of an extracted command does not finish, dcg requests review or denies it. The license is MIT-based with additional terms; read it before organizational use.
How to disable. Remove dcg registration from the selected agent while preserving other hooks, then uninstall the binary through its original method.
FAQ
Does Homebrew register hooks automatically?
Homebrew installs only the binary. Run `dcg install` separately to register agent integrations, then read the diagnostic results.
How do I inspect a decision?
Use `dcg explain "git status"` or another command string. It explains without executing that string.
Why did doctor exit zero despite a problem?
Normal diagnostics may exit zero even when a check fails. `dcg doctor --strict` changes the diagnostic exit status; malformed hook JSON is controlled separately by `general.fail_closed`.
Does installation cover every database automatically?
No. Configuration enables rule packs for the databases and tools in use. An installed binary alone does not mean the required pack is active.
Is Codex supported?
Yes. Support is documented for Codex CLI 0.125.0 or newer. After setup, compare the client version and hook-registration diagnostic results.
Discussion
No questions or reviews yet.
Related
CLI toolsA guard for coding agents: blocks destructive Git and file system commands and attempts to read sensitive files before they run
HOL Guard checks an AI agent's shell commands, secret reads, MCP calls and package installs before they run and holds risky actions until you decide
MCP checks shell commands, while shellfirm hooks apply rules to supported agent calls before they execute
A CLI with policies that intercepts dangerous AI agent commands like rm -rf, force push or reading .env before they run
An AI security verification CLI: scans models and code, probes live endpoints and MCP servers, and analyzes recorded agent runs
A local guard for coding agents: blocks secret writes and force pushes to main, warns about risky commands.
README in short
dcg includes a scan mode for code review and CI. Decision explanation output is distinct from the live-hook protocol.