DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Approve Prefix — DSH Plugin for DeepSeek Harness
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins
A

dsh-approve-prefix

Approve Prefix

Automatically approve DSH sandbox privilege escalation requests based on a single command prefix; commands containing pipes, chaining, or redirection always require manual approval

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add github:azazo1/dsh-approve-prefix#291ca347ee5a38be41659d156cabf996302ae8c4
READMECompatibilityVersions

Compatibility and provenance

Approve Prefix is published as dsh-approve-prefix and currently resolves to version 0.1.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
web
Release source
github
Registry updated
9/23/2026

Versions

0.1.0stable
9/23/2026

Related plugins

Loading related plugins…

Latest
0.1.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
web
License
MIT
Source
github
GitHub
★ 1
Weekly downloads
0
Last push
9/25/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in security-access.

Doctor@linxin666/dsh-doctorTransactional rescue mode for DSH profiles with a supervised launcher, isolated recovery capsule, deterministic repairs, health monitoring, and a local Web recovery consolePocketdsh-pocketPut DeepSeek Harness in your pocket: one package, one settings page, and scan a QR code on your phone to access DSH on your computer in sync (LAN + public network, real-time screen mirroring).DSCODE@toddzheng024/dscode-bundleA complete DeepSeek coding agent with persistent shell, Ultra collaboration and automatic permission review.Plugin Subscriptionsdsh-plugin-subscriptionsUse ChatGPT (Codex), Claude, Grok (X Premium), GitHub Copilot, and Google Antigravity subscriptions as DeepSeek Harness LLM providers, with OAuth login from the web Settings page

README

dsh-approve-prefix

按 "单命令前缀" 自动放行 DeepSeek Harness 沙箱提权请求的插件.

当 agent 因为沙箱拦下某条命令, 改带 sandbox_permissions + justification 重试时, 本插件只在命令确实是单条简单命令且 argv 前缀命中放行前缀时替你点 "允许一次"; 其余情况 (管道, 分号, &&, 重定向, 命令替换, 前缀不符) 原样弹人工审批.

它解决的问题

  • dsh 的提权审批请求只带 toolName 和 reason (形如 escalate sandbox to danger-full-access: <理由>), 不带命令原文.
  • 写在 tools/pre-execute 上的规则插件只能决定工具调用本身的 allow/deny/ask, 而提权审批发生在工具体内部, 规则放行不等于同意提权.
  • 挂在 approval/request 上的模型审批插件能同意提权, 但靠模型分类, 不是确定性的前缀匹配.

本插件把两件事接起来: 在 tools/pre-execute 记下命令原文, 再以 { prepend: true } 插到审批瀑布最前面, 按 callId 取回命令做确定性判定.

它不从审批结果里学任何东西. dsh 的审批接缝只有 allowed-once 一个放行结果, 没有 "允许一次" 与 "始终允许" 的区分, 插件看到的每次人工放行都长一样, 所以从结果里归纳前缀等于让一次 "允许一次" 变成长期自动放行. 放行前缀只来自静态配置, 配置页面与 /approve-prefix-add 这三条显式路径.

判定规则

自动放行需要同时满足:

  1. 审批请求来自 tools 中配置的工具 (默认 bash).
  2. 请求是沙箱提权, 且目标档位在 allowedEscalationModes 内 (默认只允许 danger-full-access).
  3. 命令由 tools/pre-execute 记录过, 并能按 callId 取回 (每条记录只消费一次).
  4. 命令整串扫描不含结构元字符: |, &, ;, <, >, 反引号, $, 换行, 回车.
  5. 去掉命令行前缀形式的环境变量赋值 (以及 env 包装) 后, argv 逐 token 命中某条放行前缀 (默认 gh api).

任一条不满足就把请求交给下一个应答者 (人工卡片), 不返回拒绝, 也不改动审批结果.

命令结果
gh api user --jq .login自动放行
ENVA=aaa gh api user自动放行 (环境变量前缀被忽略)
env ENVA=aaa gh api user自动放行
/usr/local/bin/gh api repos/{owner}/{repo}自动放行 (命令词取文件名部分)
gh api user | jq .login人工
gh api user; rm -rf /tmp/x人工
gh api user && gh auth status人工
gh api user > /tmp/out.json人工
gh api $(echo user)人工
env -i gh api user人工 (env 带选项, 不做归约)
ENVA=aaa人工 (只有赋值, 没有命令)
gh auth status人工

放行前缀

前缀来自三处, 全部由你显式给出:

来源存哪生效范围怎么改
静态 prefixesprofile 的 cordis.patch.yml本机所有会话, 每次启动改配置后重启 dsh web
持久前缀settings.yaml 的 approve-prefix 段本机所有会话, 跨重启保留Settings 里的 放行前缀 配置页
临时前缀进程内存仅执行命令的那个会话/approve-prefix-add / -rm / -clear

前缀的 "程度" 由 token 数决定: gh api 放行所有以 gh api 开头的单命令, 写 gh api graphql 就只放行 graphql 子命令.

命令

四条命令都只作用于当前会话的临时前缀; 持久前缀请用配置页, 命令不写 settings:

命令作用
/approve-prefix-add gh api把 gh api 加入当前会话的临时放行表
/approve-prefix-rm gh api从当前会话的临时放行表移除
/approve-prefix-list分节列出静态, 持久与当前会话的放行前缀
/approve-prefix-clear清空当前会话的临时放行表

写入工具名时用 pwsh: gh api 形式, 省略则作用于 tools 里的第一个工具.

临时表以 session id 分组, 在 A 会话里 /approve-prefix-add gh api 不会让 B 会话放行 gh api; 会话身份取不到时 (命令或审批请求没有带 agent) 临时前缀按空表处理, 不会退化成全局放行.

/approve-prefix-list 的输出:

放行前缀

静态前缀 (profile 配置, 本机所有会话生效, 改后重启 dsh web)
  1. gh api

持久前缀 (在 Settings > 放行前缀 里编辑, 跨重启保留)
  1. bash: gh pr view

本次会话临时前缀 (只对当前会话生效, 重启或 /approve-prefix-clear 清空)
  (无)

判定工具: bash

配置页

Settings 里的 放行前缀 页用表格编辑持久前缀, 每行是 工具名 + 前缀, 可增行, 删行, 保存与重新载入; 保存后写入 settings, 对所有会话立即生效, 不需要重启:

approve-prefix:
  persistentPrefixes:
    - tool: bash
      prefix: gh api

安装

dsh plugin --profile web add ./dsh-approve-prefix

也可以用 azazo1/dsh-approve-prefix 从 GitHub 安装, 需要固定版本时写 azazo1/dsh-approve-prefix#<tag>.

插件同时有 Host 与 Client 半边 (后者提供配置页), 安装或更新 client 产物后需要重启 dsh web.

配置

配置写在 profile 的 cordis.patch.yml 中该行的 config 下, 全部字段都有代码默认值:

- insert:
    - id: dsh-approve-prefix
      name: dsh-approve-prefix
      config:
        prefixes: ['gh api', 'gh pr view']
        debug: true
字段默认值说明
prefixes['gh api']静态放行前缀表, 每项是空格分隔的命令词序列; 置空表示什么都不自动放行
tools['bash']参与记录与判定的工具名
allowedEscalationModes['danger-full-access']允许自动放行的提权目标档位
extraDeniedCharacters[]在结构元字符之外额外拒绝的单字符
onlyEscalationstrue为 false 时, 非提权来源的审批请求也按同一套命令规则应答
temporaryPrefixLimit32每个会话的临时前缀条数上限
debugfalse输出每次转人工的判定细节
pendingCapacity128命令记录表容量, 超限淘汰最旧一条

未知键, 类型不符或越界都会在插件加载时抛错, 不会静默降级成放行.

安全边界

  • fail-closed: 判定器拿不到命令, 配置非法, 前缀不符时都转人工, 不会变成拒绝或放行.
  • 一次性: 同一个 callId 的记录只消费一次, 重复请求转人工.
  • 结构元字符固定拒绝, 不能通过配置取消, 避免把 "单命令" 判定配成可绕过.
  • 审批结果不参与学习, 所以一次 "允许一次" 不会改变后续判定.
  • Host 半边不写 settings: 持久前缀只在你于配置页保存或手工编辑 settings 时变化.
  • 已放行的调用仍受 dsh 自身的文件沙箱与审批审计约束: 会话日志里的 approval/asked 与 approval/decided 会记录本次询问与结果, 插件另在 info 级别打印判定依据.

局限

  • 只覆盖 bash. pwsh 的语法与分词规则不同, 需要单独验证后再加入 tools.
  • 命令原文依赖 tools/pre-execute 记录, 记录缺失时转人工; 记录表有容量上限, 长会话中极早的记录可能被淘汰.
  • 不判断命令的实际副作用, 只判断它是不是 "命名单命令".
  • 因为审批接缝无法区分按钮, 想做到 "点卡片上的某个按钮才记住前缀" 需要额外实现 client 半边 (在审批卡片上加按钮); 目前这一步由 /approve-prefix-add 与配置页代替.

开发

just install
just typecheck
just test
just build
just verify

tests/ 覆盖命令判定, 会话级临时前缀表与插件接线 (假 Context 驱动 pre-execute 与审批瀑布), 含 "点击允许一次不得带来自动放行" 的回归用例.