developerdh/dsh-sandbox-allowlist1

dsh-sandbox-allowlist

DSH sandbox extension: configurable trusted writable roots outside the workspace, for both sandboxed CLI commands and the write/edit tools. 为 DSH 默认沙箱增加可配置的「沙箱授权目录」,允许工作区外的受信修改。

包名
dsh-sandbox-allowlist
版本
0.1.0
许可证
MIT
最近更新
2026年8月21日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:developerdh/dsh-sandbox-allowlist

配置(设置页 / settings.yaml)

沙箱授权目录清单通过 sandbox-allowlist 设置 namespace 管理(设置页可编辑,写入 $DSH_HOME/settings.yaml,实时生效):

sandbox-allowlist:
  allowedDirs:
    - 'D:\Shared\Tools'    # 字面目录:整棵子树可写
    - 'D:\Shared\**'       # 子树(含根自身与未来子目录)
    - 'D:\Data\logs\*'     # 现存的一级子目录
    - 'D:\Work\202?'       # ? 匹配单个非分隔符字符
    - '/opt/tools/**'      # POSIX 写法同样支持

⚠️ 安全警示:沙箱授权目录将被沙箱内的 AI 代理直接写入(无需审批)。请只添加 完全信任的目录;目录必须已存在且归当前用户所有;撤销信任删除条目即可 (Windows 上旧目录的 ACE 用 node scripts/revoke.mjs 清理)。

通配符在每次调用前懒展开(TTL 缓存,expandTtlMs 可调);不存在的路径跳过 并告警(strict: true 可改为抛错);锚定盘符/根目录且带 ** 的模式被拒绝 (防整盘遍历)。