🛡️

dcg

Seguro 🌐 Acceso a red📁 Acceso al sistema de archivos⚙️ Comandos externos

在執行前阻擋危險指令

AI 編碼代理可能會意外執行破壞性指令,如 rm -rf 或 git reset --hard。這個高效能的 Rust 掛鉤會在執行前攔截危險指令,並提供清楚的說明來阻擋它們。

Soporta: Code(CC)
📊 69 Adecuado
1

Descargar el ZIP de la skill

2

Subir en Claude

Ve a Configuración → Capacidades → Skills → Subir skill

3

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

Seguro
v5 • 1/17/2026

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

2
Archivos escaneados
628
Líneas analizadas
3
hallazgos
5
Auditorías totales

Factores de riesgo

🌐 Acceso a red (5)
📁 Acceso al sistema de archivos (11)
⚙️ Comandos externos (130)
SKILL.md:14 SKILL.md:15 SKILL.md:16 SKILL.md:17 SKILL.md:27-30 SKILL.md:30-49 SKILL.md:49-50 SKILL.md:50-51 SKILL.md:51-52 SKILL.md:52 SKILL.md:52-53 SKILL.md:53-59 SKILL.md:59 SKILL.md:59-60 SKILL.md:60-66 SKILL.md:66-67 SKILL.md:67-73 SKILL.md:73 SKILL.md:73 SKILL.md:73 SKILL.md:73-81 SKILL.md:81 SKILL.md:81 SKILL.md:81 SKILL.md:81 SKILL.md:81 SKILL.md:81 SKILL.md:81 SKILL.md:81 SKILL.md:81 SKILL.md:81 SKILL.md:81 SKILL.md:81-87 SKILL.md:87-88 SKILL.md:88-89 SKILL.md:89-90 SKILL.md:90-91 SKILL.md:91 SKILL.md:91-92 SKILL.md:92-93 SKILL.md:93-95 SKILL.md:95-97 SKILL.md:97-100 SKILL.md:100-110 SKILL.md:110-111 SKILL.md:111-117 SKILL.md:117-118 SKILL.md:118-119 SKILL.md:119-120 SKILL.md:120-121 SKILL.md:121-127 SKILL.md:127-128 SKILL.md:128-129 SKILL.md:129-135 SKILL.md:135-136 SKILL.md:136-137 SKILL.md:137-143 SKILL.md:143-144 SKILL.md:144-145 SKILL.md:145-151 SKILL.md:151-152 SKILL.md:152-153 SKILL.md:153-159 SKILL.md:159-160 SKILL.md:160-161 SKILL.md:161-167 SKILL.md:167-168 SKILL.md:168-172 SKILL.md:172-180 SKILL.md:180-186 SKILL.md:186-187 SKILL.md:187-188 SKILL.md:188-189 SKILL.md:189-190 SKILL.md:190-196 SKILL.md:196-204 SKILL.md:204-208 SKILL.md:208-210 SKILL.md:210-218 SKILL.md:218-220 SKILL.md:220-236 SKILL.md:236-244 SKILL.md:244-247 SKILL.md:247-269 SKILL.md:269-273 SKILL.md:273-277 SKILL.md:277 SKILL.md:277-293 SKILL.md:293-294 SKILL.md:294-300 SKILL.md:300-306 SKILL.md:306-310 SKILL.md:310-321 SKILL.md:321-327 SKILL.md:327 SKILL.md:327-328 SKILL.md:328-329 SKILL.md:329-330 SKILL.md:330-336 SKILL.md:336-340 SKILL.md:340-344 SKILL.md:344-349 SKILL.md:349-355 SKILL.md:355-360 SKILL.md:360-364 SKILL.md:364-370 SKILL.md:370-378 SKILL.md:378-379 SKILL.md:379-381 SKILL.md:381-382 SKILL.md:382-383 SKILL.md:383-398 SKILL.md:398 SKILL.md:398-400 SKILL.md:400-401 SKILL.md:401-408 SKILL.md:408-418 SKILL.md:418-420 SKILL.md:420-426 SKILL.md:426-430 SKILL.md:430 SKILL.md:430-432 SKILL.md:432 SKILL.md:432-434 SKILL.md:434-438 SKILL.md:197 SKILL.md:200 SKILL.md:203 SKILL.md:196-204 SKILL.md:203

Puntuación de calidad

38
Arquitectura
100
Mantenibilidad
87
Contenido
20
Comunidad
100
Seguridad
83
Cumplimiento de la especificación

Lo que puedes crear

防止意外的 git 歷史記錄遺失

阻止 AI 代理意外執行 git reset --hard 或強制推送,這可能會破壞未提交或遠端的工作。

阻擋破壞性基礎設施指令

防止 AI 代理在生產目錄上執行 rm -rf 或在沒有明確批准的情況下執行 terraform destroy。

保護資料庫免於意外刪除

當 AI 代理與資料庫互動時,防範意外的 DROP TABLE 或 FLUSHALL 指令。

Prueba estos prompts

安裝 DCG
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 支援 Windows,但需要 WSL 或預建的 Windows 執行檔。Linux 和 macOS 具有原生支援。
DCG 對 Claude Code 的效能影響是什麼?
DCG 使用 SIMD 模式匹配增加了次毫秒級的延遲。大多數使用者報告沒有明顯的效能影響。
DCG 可以與其他 AI 編碼工具整合嗎?
DCG 是為 Claude Code PreToolUse 掛鉤設計的。與其他工具的整合需要自訂實作。
DCG 是否會收集或傳輸任何使用者資料?
DCG 在本地執行,僅在本地分析指令。不會收集或傳輸任何資料到外部伺服器。
為什麼我的安全 git 指令被阻擋了?
在 GitHub 儲存庫上提交問題。白名單優先設計意味著安全指令不應被阻擋。
DCG 與 git 掛鉤或安全指令相比如何?
DCG 在 AI 代理層級運作,在 git 程序啟動之前捕捉錯誤。Git 掛鉤在指令已經形成後才執行。

Detalles del desarrollador

Estructura de archivos

📄 SKILL.md