← Back to Leaderboard
DDicklesworthstone

Dicklesworthstone/destructive_command_guard

Rust pre-execution hooks that block destructive AI-agent shell commands

View on GitHub ↗
Engineering Health (Methodology)
A · 77/100
Maintenance Activity
● Updated today
Latest Release
v0.17.2
Commercial License Check
Custom / Check Repo

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption16/25
Release Cadence20/20
License Clarity6/20
MCPCLI
Total Stars
★ 6,394
24h Growth
+3
7d Growth
+18
Forks
274

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

Dicklesworthstone/destructive_command_guard Star History (2026-01-06 - 2026-12-04) ALL-TIME STAR HISTORY (2026-01 – 2026-12) +6.4k in 332d · avg +19/day 6.8k 3.4k 0 2026-01-06: ★ 12026-01-31: ★ 2942026-02-21: ★ 5422026-03-14: ★ 6572026-04-04: ★ 7942026-04-25: ★ 8582026-05-16: ★ 9992026-06-06: ★ 1,0762026-06-27: ★ 1,1082026-07-18: ★ 5,0302026-08-08: ★ 5,6102026-08-29: ★ 5,8122026-09-19: ★ 5,9612026-10-10: ★ 6,1072026-10-31: ★ 6,2092026-11-21: ★ 6,3592026-12-04: ★ 6,394 ★ 6.4k 2026-01 2026-06 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Destructive Command Guard (dcg) is a local Rust CLI that sits between an AI coding agent and the shell tool it is about to invoke. A client hook or plugin provides the tool-call context, dcg evaluates the command text against configured rule packs, and the client applies the returned decision. The evaluation pipeline combines SIMD-accelerated filtering, context classification, and a dual regex engine with lazily compiled patterns. The manifest uses Rust edition 2024 and sets a minimum Rust version of 1.95.

Integration is client-specific. Codex CLI 0.125.0+ uses a Bash PreToolUse hook; dcg identifies its payload by a nonempty turn_id and writes only the supported denial fields to stdout, reserving stderr for human-readable output. OpenCode instead uses a native tool.execute.before plugin. The integration surface is hooks, plugins, and a CLI; no MCP server interface is established.

Key Capabilities & Differentiators

With no configuration, dcg checks for destructive filesystem, Git, and disk operations. The filesystem and Git core packs always participate in evaluation, while system.disk can be disabled. windows.filesystem and windows.system also come on by default on native Windows and can activate on other hosts when the request is recognized as Cmd or PowerShell; a Windows-looking string by itself is not enough. More than 50 packs extend coverage to PostgreSQL and other databases, Kubernetes, Docker, cloud CLIs, Terraform, and more.

Context classification distinguishes command text used as data from operations that would actually run, and evaluation extends to heredocs and inline scripts. dcg explain exposes the matched policy and resolved mode, while scan mode brings command checks into pre-commit and CI. Agent profiles can add or remove eligible packs and change allowlist handling. trust_level is an audit label, not a control that changes evaluation.

Trade-offs & Limitations

Compared with Git hooks, dcg can inspect agent-issued shell calls before execution and apply the same policy to filesystem, infrastructure, and database commands. Compared with a sandbox or service-side authorization, its strength is early, explainable feedback, not containment. It depends on the client routing calls through a working hook and honoring the result. Aider is limited to Git hooks, while Continue is detection-only. Keep OS isolation and least-privilege credentials for operations that require a hard boundary.

Broader pack coverage gives teams more control but increases the policy they must tune and test. Pack-wide warn or log does not relax critical rules: they resolve back to deny unless overridden individually. Analysis timeouts can produce explicit review or block outcomes. Cargo.toml references a LICENSE file without identifying the license by SPDX identifier; inspect the actual terms before approving commercial use or redistribution.

Hardware & Deployment Guide

Install the local binary and register it with the client's hook or plugin mechanism. The Codex installer detects codex on PATH or an existing ~/.codex/ directory, merges into ~/.codex/hooks.json, preserves other hooks, and refuses to overwrite malformed JSON. OpenCode uses dcg install --opencode. Start with the default policy, add workload-specific packs in the dcg TOML configuration, and use dcg doctor --strict in the agent's launch environment. Validate both allow and deny behavior end to end before expanding rollout. Source builds require Rust 1.95; the guard itself does not need a model, GPU, or hosted inference service.

The release sequence shows why both test layers matter: v0.17.0 expanded PowerShell truncation coverage and fixed Antigravity hook registration; v0.17.1 introduced a tri-state distinction between action, inert input, and input that cannot be proven safe in the affected guardrail; v0.17.2 added the opt-in system.processes pack for shared agent hosts.

Enforcement point: pre-execution hooks and a Rust CLI; an MCP server interface is not established.
Protocol fidelity: Codex CLI 0.125.0+ receives minimal denial JSON on stdout, with human-readable details on stderr.
Default policy: filesystem and Git core packs always evaluate; disk protection is enabled by default and can be disabled.
Context analysis: distinguishes quoted data from executable commands and inspects heredocs and inline scripts.
Policy tuning: 50+ packs, agent-specific profiles, and per-rule overrides for relaxing critical rules.
Operational checks: dcg explain diagnoses rule decisions, dcg doctor --strict surfaces configuration failures, and scan mode supports pre-commit and CI.
Best For

Teams running hook-capable coding agents that want a consistent, explainable check against accidental damage to worktrees, disks, and infrastructure, with CI scanning as a second check.

Skip If

You need a standalone MCP server or a hard boundary over all processes, filesystem access, or production credentials. Use isolation and service-side access controls for those requirements.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

MCPCLI
dcg allowlist add-command "mytool publish --to https://artifacts.corp.internal" \
  -r "First-party internal publisher" --user

Comparison vs. Top Coding, Skills & MCP Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
destructive_command_guard ★6.4k+18Rust—Rust pre-execution hooks that block destructive AI-agent shell commands
rtk88.7k+684RustApache-2.0A local Rust CLI wrapper that trims command output before coding agents read it.
ECC316.1k+4.2kJavaScriptMITPlugins and CLI workflows for planning, reviewing, and verifying agent-written c
ponytail204.4k+4.1kJavaScriptMITA prompt-driven coding-agent plugin for smaller changes and focused tests.

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/Dicklesworthstone/destructive_command_guard.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

Dicklesworthstone/destructive_command_guard Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about destructive_command_guard

How does dcg enforce a decision in Codex CLI?

The Codex CLI 0.125.0+ integration registers a Bash PreToolUse hook in ~/.codex/hooks.json. On denial, dcg exits 0 and sends minimal hookSpecificOutput JSON on stdout; the human-readable explanation goes to stderr. An allowed command produces no output. After installation, verify that the client actually honors a denial in a disposable workspace.

What hardware and runtime does dcg require?

No GPU or VRAM is needed for dcg itself. It is a local Rust CLI that analyzes command text, not a model runtime. The manifest requires Rust 1.95 for source builds. No RAM figure or workload-specific latency budget is established; measure hook latency with the scripts, packs, and concurrency you expect to use.

Can we deploy dcg internally or bundle it commercially?

Cargo.toml points to a LICENSE file but does not give an SPDX license identifier, and the license text is not available here. Review the actual file before approving commercial use, redistribution, or bundling. Local execution avoids a hosted-service dependency for the guard itself, but does not establish licensing rights.

How does dcg compare with Git hooks or a sandbox?

Use dcg when one policy needs to follow agent shell calls across clients and explain specific denials. Git hooks are narrower: they cannot inspect arbitrary shell calls or cover cloud and database CLIs. Use sandboxing, least-privilege credentials, and cloud or database authorization when enforcement must hold regardless of which client or process issues the command.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining Dicklesworthstone/destructive_command_guard? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature Dicklesworthstone/destructive_command_guard on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare