ZhijiangTang/dsh-safeguard0

dsh-safeguard

DSH plugin: block dangerous shell commands and secret leakage before execution (tools/pre-execute veto)

AI Analysis

核心用途是为 AI 智能体执行环境提供安全防护。适合担心 AI 误操作执行高危命令(如 rm -rf)或意外泄露敏感 API 密钥的安全敏感型用户。

Package
dsh-safeguard
Version
0.1.1
License
MIT
Last updated
Aug 16, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ZhijiangTang/dsh-safeguard

配置项

在 profile 的 cordis.patch.yml(或 bundle 配置)中覆盖:

- insert:
    - id: guard
      name: dsh-safeguard
      config:
        enableDanger: true      # 危险命令拦截开关(默认 true)
        enableSecrets: true     # 密钥泄漏拦截开关(默认 true)
        extraPatterns:          # 额外正则字符串(额外危险命令规则)
          - 'curl.*\|.*bash'
        allowList:              # 精确豁免名单(字符串完全一致才豁免)
          - 'rm -rf /tmp/safe-dir'
配置项类型默认说明
enableDangerbooleantrue是否拦截危险命令
enableSecretsbooleantrue是否拦截密钥泄漏
extraPatternsstring[][]额外危险命令正则(非法正则以警告跳过)
allowListstring[][]精确豁免:危险命令按整条命令、密钥按命中片段做完全一致匹配