dsh-sandbox-argument-normalizer

by Hanihahaha

0 开发与运行时github 检测到 manifest package.json#dsh收录于 08-17

DeepSeek Harness 宿主插件:在原生工具分发前剔除无效的沙箱权限与理由参数

A DeepSeek Harness host plugin that removes invalid sandbox permissions and justification arguments before native tool dispatch.

安装

dsh plugin --profile web add github:Hanihahaha/dsh-sandbox-argument-normalizer

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗

安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。

README

English

一个 DeepSeek Harness 宿主插件,会在原生工具分派前移除无效的 sandbox_permissions 和 justification 参数。

安装

# 在仓库根目录执行。
dsh plugin --profile web add ".\dsh-sandbox-argument-normalizer"

安装后重启 dsh web。

解决的问题

部分模型或 OpenAI-compatible 网关会在普通的 pwsh、write、edit 调用中填入所有已公开的可选参数。当注入的 sandbox_permissions 与当前会话模式相同,或比当前模式更窄时,DSH 会在命令实际执行前正确拒绝该调用,例如:

sandbox escalation to "workspace-write" is not strictly wider than this call's current "workspace-write" mode

当会话已经是 danger-full-access 而模型仍传入任一已公开的升级模式时,也会出现同类错误。这不是真实的 sandbox 拒绝:会话本已具有足够权限,但无效的升级字段阻止了预期的工具调用执行。

它只会移除不比调用会话当前 sandbox 模式更宽的请求。真正的提权请求保持不变,继续走 DSH 原有的审批流程。

示例:

  • workspace-write 会话传入 sandbox_permissions: workspace-write:移除。
  • danger-full-access 会话传入任一已公开模式:移除。
  • read-only 会话传入 sandbox_permissions: workspace-write:保留,交给常规审批流程。

插件挂接 tools/execute waterfall。它不会自动批准请求,也不会变更会话权限状态。

原始 README: https://github.com/Hanihahaha/dsh-sandbox-argument-normalizer/blob/main/README.zh.md ↗