FengLingYaaa/dsh-gpt-perm-strip

DSH插件:移除当前会话权限并非严格更宽的残留GPT沙箱权限。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness, and it only operates on GPT-family models. Its core purpose is to resolve a common error triggered when GPT sends duplicate sandbox permission fields that are not strictly wider than the current session’s permission level. Before the sandbox escalation check runs, the plugin strips unnecessary sandbox_permissions and justification fields while leaving genuine permission escalation requests untouched. It works by wrapping each tool’s execute method to modify a cloned copy of the call arguments, so the original tool call record stored by DSH still shows the full output the model generated.

Any developer using GPT-family models with DeepSeek Harness will benefit from this plugin, as GPT commonly adds permission fields even when they are not needed for a new tool call. Without this plugin, calls that include duplicate permission fields fail immediately with an error about the escalation not being strictly wider. The plugin fixes this failure case automatically without requiring any manual changes to how you write prompts or configure tools. It only activates for matching GPT models, so all other models you use with DSH will not be affected by the plugin’s logic.

Installing the plugin is straightforward, and you can add it directly from GitHub with the single command dsh plugin --profile web add github:FengLingYaaa/dsh-gpt-perm-strip. If you prefer to modify the plugin or install it from a local clone, you can run git clone, install dependencies with pnpm, run tests, build, then add it to your DSH profile from the local directory. The plugin offers several configuration options, including toggling logging of stripped fields, adding custom model patterns, and toggling a GPT-specific context prompt. It is released under the open source MIT license, so you can use, modify, and distribute it freely for any purpose.

这是一款专为 DeepSeek Harness 开发的原生插件,仅针对 GPT 系列模型生效。它的核心功能是在 DSH 的沙箱权限升级检查执行前,移除参数中权限宽度不超过当前会话的 sandbox_permissions 和 justification 字段,避免 GPT 习惯性发送重复权限导致调用失败。它通过包装工具执行逻辑修改参数,同时保留原始调用记录,不会影响真实需要的权限升级流程。

GPT 系列模型(包括 OpenAI 兼容网关托管的 GPT 模型,默认也包含 o1/o3/o4 这类推理模型)会触发本插件的处理逻辑,非 GPT 模型如 Grok、DeepSeek 则不会触发,除非你手动配置额外模型匹配规则。当你使用 GPT 模型在 DSH 中调用带沙箱权限的工具时,插件会自动运行,过滤掉不必要的权限字段,让原本失败的调用可以正常执行。

你可以通过 dsh plugin --profile web add github:FengLingYaaa/dsh-gpt-perm-strip 命令一键安装,也可以克隆本地仓库后,通过 pnpm 编译安装。插件支持多项自定义配置,包括是否包含 OpenAI 推理模型、额外模型匹配正则、是否注入提示、是否记录日志等。本项目采用 MIT 许可证开源,完全免费供用户使用和修改。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:FengLingYaaa/dsh-gpt-perm-strip

把 FengLingYaaa/dsh-gpt-perm-strip 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-gpt-perm-strip

A DeepSeek Harness plugin that runs only for GPT-family models. Before a tool body hits DSH's sandbox escalation check, it removes sandbox_permissions / justification that are not strictly wider than the current session.

Why

DSH requires sandbox_permissions to be strictly wider than the session. The same (or a narrower) mode fails immediately:

sandbox escalation to "danger-full-access" is not strictly wider than this call's current "danger-full-access" mode

GPT-family models habitually send a permission field even when the session already has that access. This plugin drops those leftover fields and leaves real escalations (workspace-write → danger-full-access) untouched.

tools/pre-execute cannot rewrite frozen arguments. The plugin wraps each tool's execute and passes a cloned argument object with the unnecessary fields removed. The durable tool/call record still shows what the model emitted.

GPT-only

Matching is by model id, not provider (OpenAI-compatible gateways often host GPT, Grok, and DeepSeek under one provider):

  • gpt-4o, gpt-5.6-sol, chatgpt-4o-latest, openai/gpt-4.1, ft:gpt-4o:…
  • optional: o1 / o3 / o4 (includeOpenAiReasoning, default on)

Grok and DeepSeek are ignored unless you add extraModelPatterns.

Repo: https://github.com/FengLingYaaa/dsh-gpt-perm-strip

Install

dsh plugin --profile web add github:FengLingYaaa/dsh-gpt-perm-strip

Or from a local checkout:

git clone https://github.com/FengLingYaaa/dsh-gpt-perm-strip.git
cd dsh-gpt-perm-strip
pnpm install
pnpm test
pnpm build
dsh plugin --profile web add .

Config

Field Default Meaning
includeOpenAiReasoning true Treat o1/o3/o4 as GPT-family
extraModelPatterns [] Extra regexes against provider, model, or provider/model
injectPrompt true GPT-only runtime-context reminder
logStrips true Log each strip as [gpt-perm-strip] stripped …

Behavior

Session GPT argument Result
danger-full-access sandbox_permissions: danger-full-access stripped, call runs
workspace-write sandbox_permissions: workspace-write stripped
workspace-write sandbox_permissions: danger-full-access kept (real escalation)
read-only sandbox_permissions: workspace-write kept
non-GPT model any permission unchanged

permission / permissions are treated as sandbox fields only when the value is a known sandbox mode.

← 上一个 Prev aifp-mcp 下一个 Next dsh-computer-use-plugin →