dcg
在執行前阻擋危險指令
AI 編碼代理可能會意外執行破壞性指令,如 rm -rf 或 git reset --hard。這個高效能的 Rust 掛鉤會在執行前攔截危險指令,並提供清楚的說明來阻擋它們。
Descargar el ZIP de la skill
Subir en Claude
Ve a Configuración → Capacidades → Skills → Subir skill
Activa y empieza a usar
Pruébalo
Usando "dcg". 安裝 DCG 並設定它來阻擋危險的 git 和檔案系統指令
Resultado esperado:
- ✓ 透過 curl 腳本安裝 DCG
- ✓ 在 ~/.config/dcg/config.toml 建立設定
- ✓ 在 ~/.claude/settings.json 設定 Claude Code 掛鉤
- ✓ 受保護的指令:git reset --hard、git clean、rm -rf(非臨時目錄)
- ✓ 重新啟動 Claude Code 以啟用保護
Usando "dcg". 嘗試在啟用 DCG 的情況下透過 Claude Code 執行 git reset --hard
Resultado esperado:
- ╔════════════════════════════════════════════════════════════════╗
- ║ BLOCKED dcg ║
- ╠════════════════════════════════════════════════════════════════╣
- ║ Reason: git reset --hard destroys uncommitted changes. ║
- ║ Use 'git stash' first. ║
- ║ ║
- ║ Command: git reset --hard HEAD~1 ║
- ║ ║
- ║ Tip: Run manually in terminal after stash. ║
- ╚════════════════════════════════════════════════════════════════╝
Usando "dcg". 設定 DCG 來保護資料庫和 kubernetes 資源
Resultado esperado:
- ✓ 啟用 database.postgresql 套件(阻擋 DROP/TRUNCATE)
- ✓ 啟用 database.mysql 套件(阻擋 DROP/TRUNCATE)
- ✓ 啟用 database.mongodb 套件(阻擋 dropDatabase)
- ✓ 啟用 kubernetes.kubectl 套件(阻擋 delete namespace)
- ✓ 啟用 kubernetes.helm 套件(阻擋 helm uninstall)
- ✓ 使用新設定重新啟動 DCG
Auditoría de seguridad
SeguroDocumentation-only skill describing a defensive safety tool. Pure markdown content with no executable code. The 223 static findings are FALSE POSITIVES - they flag documentation examples of dangerous commands that DCG is designed to BLOCK, not actual dangerous code. This skill contains only SKILL.md and skill-report.json, describing a protective Claude Code hook.
Factores de riesgo
🌐 Acceso a red (5)
📁 Acceso al sistema de archivos (11)
⚙️ Comandos externos (130)
Puntuación de calidad
Lo que puedes crear
防止意外的 git 歷史記錄遺失
阻止 AI 代理意外執行 git reset --hard 或強制推送,這可能會破壞未提交或遠端的工作。
阻擋破壞性基礎設施指令
防止 AI 代理在生產目錄上執行 rm -rf 或在沒有明確批准的情況下執行 terraform destroy。
保護資料庫免於意外刪除
當 AI 代理與資料庫互動時,防範意外的 DROP TABLE 或 FLUSHALL 指令。
Prueba estos prompts
Install and configure DCG Destructive Command Guard to protect against accidental destructive commands in my Claude Code setup.
Enable the database protection packs for PostgreSQL and MongoDB in DCG configuration.
Test that git reset --hard and rm -rf commands are properly blocked when running through Claude Code.
Explain how to temporarily bypass DCG when I need to run a legitimately destructive command.
Mejores prácticas
- 在重要專案上執行 AI 代理之前先安裝 DCG,以防止代價高昂的錯誤
- 根據您的基礎設施啟用額外的套件(資料庫、容器、雲端)
- 使用 git stash 而非被阻擋的 reset 指令來保留未提交的工作
Evitar
- 在沒有任何破壞性指令保護的情況下執行 AI 代理
- 使用 DCG_BYPASS=1 阻擋 DCG 來執行例行任務
- 忽略 DCG 阻擋訊息並在未檢查的情況下手動執行被阻擋的指令
Preguntas frecuentes
DCG 是否適用於在 Windows 上執行的 Claude Code?
DCG 對 Claude Code 的效能影響是什麼?
DCG 可以與其他 AI 編碼工具整合嗎?
DCG 是否會收集或傳輸任何使用者資料?
為什麼我的安全 git 指令被阻擋了?
DCG 與 git 掛鉤或安全指令相比如何?
Detalles del desarrollador
Autor
DicklesworthstoneLicencia
MIT
Repositorio
https://github.com/Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations/tree/main/skills/dcgRef.
main
Estructura de archivos
📄 SKILL.md