Analysis updated 2026-05-18
Stop an AI coding agent from accidentally running git reset hard or rm -rf on your project.
Add stricter rule packs to block dangerous database, Kubernetes, or cloud commands.
Use scan mode in CI or pre-commit hooks to catch destructive commands during code review.
Configure different trust levels for different AI agents on the same machine.
| dicklesworthstone/destructive_command_guard | serenity-rs/serenity | imageoptim/gifski | |
|---|---|---|---|
| Stars | 5,319 | 5,504 | 5,509 |
| Language | Rust | Rust | Rust |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 3/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Uses a custom, non-standard license rather than a common open source license.
This project, called dcg, is a safety tool for people who let AI coding agents run shell commands on their behalf. AI assistants like Claude Code, Codex, Gemini CLI, GitHub Copilot, Cursor, and several others occasionally issue commands that are genuinely destructive, things like git reset hard, rm -rf on a source folder, or dropping a database table, and those commands can wipe out hours of work in seconds. dcg sits in front of these agents as a hook and inspects every command before it is allowed to run, blocking the dangerous ones and explaining why, with a suggestion for a safer alternative. Installation is a single script that auto detects your operating system, whether Linux, macOS, or Windows through WSL, downloads the right binary, and wires itself into whichever supported coding agents it finds on your machine. Windows also has its own native PowerShell installer that verifies the download's checksum and signature before installing. Out of the box, dcg blocks common dangerous git and filesystem commands, and it can be extended with more than fifty optional rule packs covering databases, Kubernetes, Docker, the major cloud providers, and infrastructure tools like Terraform. It is built to be fast enough that a user will not notice any delay, and it is designed to tell the difference between a command that is actually dangerous and one that merely mentions a dangerous pattern, so something like a grep search for the text "rm -rf" is not blocked while an actual rm -rf command is. The tool can also be configured per agent, since some AI agents are trusted with a wider set of allowed commands than others, and administrators can adjust which rule packs apply to which agent. There is also an explain command that shows exactly why a particular command would be blocked, and a scan mode meant for use in continuous integration pipelines and pre-commit hooks, catching dangerous commands during code review rather than at execution time. The full README is longer than what was shown.
A hook that intercepts and blocks destructive commands like rm -rf or git reset hard before an AI coding agent can run them.
Mainly Rust. The stack also includes Rust, CLI, Claude Code.
Uses a custom license rather than a standard open source license, check the LICENSE file for exact terms.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.