DeepSeek Harness 插件

dsh-approve-for-me-shifan3

Approve-for-me mode for DeepSeek Harness: an LLM safety reviewer auto-approves ordinary approval requests, while destructive high-risk commands still ask the human.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
shifan3/dsh-approve-for-me
最近更新
2026年8月17日
分类
安全与权限
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/shifan3/dsh-approve-for-me
插件名:dsh-approve-for-me-shifan3
作者:shifan3

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器4 个文件
README.md来源说明 · 只读预览
README 语言

dsh-approve-for-me

中文说明见 README.zh.md

A DeepSeek Harness (DSH) host plugin that adds an approve-for-me approval mode.

When enabled, every approval request that reaches the DSH answerer chain is judged by an LLM safety reviewer against a summary of the prior conversation. The model answers ALLOW or REJECT. Destructive high-risk commands — rm -r, rm -rf, drop table, drop database, and friends — skip the model entirely and are sent to the normal interactive user prompt.

> The plugin does not add a new approve-for-me policy enum (that is hardcoded in the host package dsh-user-approval). It works inside the existing ask approval policy: the plugin's enabled state is the mode switch. The DSH approval audit events (approval/asked + approval/decided) are still recorded normally.

Behavior

  • Listens on approval/request with prepend: true, so it runs before the interactive (user-prompt) answerer.
  • Extracts the concrete action text for the request:

- command from bash-family tool-call arguments, - tool arguments JSON for other tools, - or the request reason as a fallback.

  • If the action (or the request reason) matches a high-risk pattern → next(), i.e. the normal user approval prompt.
  • Otherwise it sends the LLM:

- the conversation summary (most recent ~12k chars of user messages, assistant tool activity, and tool calls), - the requested action (tool name, reason, command/args).

  • The model must reply with exactly one word: ALLOW or REJECT.

- ALLOWallowed-once - REJECTrejected - unparseable / timeout / model error / no model service → next() (falls back to asking the user; never silently allows, never silently rejects)

High-risk patterns

The following are matched as exact patterns against the extracted action text (case-insensitive regex, no g flag):

  • rm -r, rm -rf, rm -fr, rm -R, rm -rfv, ... (any rm with an r flag)
  • rm ... / (recursive/force remove targeting the filesystem root)
  • drop table, drop database, drop schema
  • truncate table ...
  • delete from ...
  • mkfs, mkfs.ext4, ...
  • dd if=
  • shred, wipefs
  • git push -f / git push --force
  • git reset --hard
  • chmod -R 777, chown -R
  • fork bomb :(){ :|:& };:

Install (static, survives restart)

Option A: dsh plugin add (recommended)

The package declares dsh.bundle.patch, so dsh plugin add installs it and adds it to the profile's dsh.profile.bundles automatically — no manual patch editing.

Clone the repo, then from the directory that contains it run:

git clone https://github.com/shifan3/dsh-approve-for-me.git
dsh plugin --profile web add ./dsh-approve-for-me

Or by absolute path:

dsh plugin --profile web add /path/to/dsh-approve-for-me

Or, once it is published to npm:

dsh plugin --profile web add dsh-approve-for-me

Then restart dsh web. The command runs pnpm add inside ~/.dsh/profiles/web/, then reconciles dsh.profile.bundles against the installed package. The row that activates the plugin lives in this repo's cordis.patch.yml.

Option B: manual home patch layer

If you prefer not to use dsh plugin, clone the repo into your DSH home and insert the row into ~/.dsh/cordis.patch.yml yourself (applies to every profile):

mkdir -p ~/.dsh/plugins
git clone https://github.com/shifan3/dsh-approve-for-me.git ~/.dsh/plugins/approve-for-me

Then create or extend ~/.dsh/cordis.patch.yml with:

- insert:
    - id: approve-for-me
      name: '../../plugins/approve-for-me/lib/index.js'
      config:
        enabled: true
        provider: deepseek-official
        model: deepseek-v4-flash
        maxTokens: 512
        summaryMaxChars: 12000
        timeoutMs: 60000

Then restart dsh web. The relative name resolves against each profile directory (~/.dsh/profiles/<name>/), so ../../plugins/... reaches ~/.dsh/plugins/... for the shipped web, tui, and cc-tui profiles.

> If you previously installed via Option B and then switch to Option A, > remove the approve-for-me insert from ~/.dsh/cordis.patch.yml first so > the row is not defined twice.

Enable / disable / configure

  • Disable: set enabled: false in the row config and restart.

- Option A: add an id-targeted override to the profile patch (~/.dsh/profiles/web/cordis.patch.yml): ``yaml - id: approve-for-me config: enabled: false ` - Option B: edit the insert block in ~/.dsh/cordis.patch.yml`.

  • Uninstall:

- Option A: dsh plugin --profile web remove dsh-approve-for-me, then restart. - Option B: remove the insert block (or the whole patch file), then restart.

  • Config keys (all optional):

- enabled (default true) - provider (default deepseek-official) - model (default deepseek-v4-flash) - maxTokens (default 512) - summaryMaxChars (default 12000) - timeoutMs (default 60000) - reasoningEffort (default off; keep it off so the verdict is not consumed by reasoning tokens)

Install (dynamic, per-run)

If you prefer not to write to ~/.dsh, you can load host-code.js as a dynamic Cordis Host package (does not survive restart):

  • Web UI: open the Cordis panel → new Plugin (id prefix such as afm) → paste host-code.js as the Host code → run.
  • With cordis_define / cordis_run: read host-code.js and pass it as code.host.

Files

  • lib/index.js — static host plugin (ESM, no runtime dependencies).
  • host-code.js — dynamic Cordis Host package variant (same logic, sandbox-safe subset).
  • cordis.patch.yml — bundle patch (declared via dsh.bundle.patch) that activates the plugin row.

Limitations

  • The dynamic variant runs in the DSH dynamic-host vm sandbox: no setTimeout / AbortController, so its timeout relies on the LLM adapter's streamIdleTimeoutMs (default 300s). The static variant uses a real AbortSignal.timeout.
  • The session approval policy still displays as ask; the plugin is a prepended answerer, not a new policy enum.
  • Only one approve-for-me answerer should be active: if you load both the static and the dynamic variant, the later-prepended one wins.

License

MIT