🎁 福利专区全网大模型免费应用 + 新用户福利 + 注册活动入口,低成本玩转 AI

可靠执行护栏 fj2devivh/dsh-reliability-plugins

DeepSeek Harness
fj2devivh38 天前有提交已提供中文文档扫描:含敏感能力

用工具级隔离约束不可靠模型,防止越权与虚报完成

29.7/100
综合分
0
GitHub 星标
—
npm 周下载
—/5
用户评分

数据截至 2026/9/27 · 周下载取自 npm 全网(含 CI / 镜像),非本站安装数;综合分由星标、活跃度与兼容性检查合成。

安装命令 · 需先装 dsh CLI 引擎
dsh plugin --profile web add fj2devivh/dsh-reliability-plugins
该包不可直接 npm 安装,改从 GitHub 源安装(明细见下方安装检查)

状态速览

判定依据:实装验证 · 静态安装检查 · 自动扫描 · 仓库维护状态
信任档位:已验证
是什么
dsh 原生插件 · security
装得上吗
本站已真实安装成功
非静态推断
L4 · 真实安装等级说明 →
安全吗
本站尚未对该插件做风险分级
暂未覆盖,不等同于无风险
还在维护吗
更新放缓:最近一次提交在 38 天前
档位由哪些信号合成

本站实装验证(真实安装 L4 覆盖全站;L5 为运行时冒烟或实机截图,覆盖范围小于 L4) · 验证所用 dsh 版本 · 静态安装检查 · 风险分级 · 仓库维护状态。 下方各区块是它的证据明细。

验证判据与等级说明 →
社区实装还没有人打卡 · 装过的第一个就是你
安全扫描自动 · 静态分析源码
v2.7.0
🔵 扫描:含敏感能力尚无人工评估
展开查看扫描说明与证据 ↓

静态扫描发现插件具备触达本地系统的能力:执行外部命令、读写/删除本地文件、读取剪贴板或密钥类环境变量(至少其一)。这是能力清单,不是危险判定——具体能力项与证据见下方,安装前请自行判断是否需要。

可执行外部命令读写/删除本地文件
查看扫描证据(共 108 处,展示前 64 条)
  • 读取本地文件
    dsh-executor-gate/_verify-tool-register.mjs:57
    if (!existsSync(path)) {
  • 写入本地文件
    dsh-executor-gate/index.js:1883
    appendFileSync(settings.auditFile, JSON.stringify({ at: new Date().toISOString(), ...record }) + '\n', 'utf8')
  • 读取本地文件
    dsh-executor-gate/index.js:2083
    ? existsSync(join(process.env.ProgramFiles ?? 'C:\\Program Files', 'PowerShell', '7', 'pwsh.exe'))
  • 读取本地文件
    dsh-executor-gate/smoke.mjs:45
    ].find((candidate) => existsSync(candidate))
  • 读取本地文件
    dsh-executor-gate/smoke.mjs:63
    if (!existsSync(cordisPath) || !existsSync(scopePath)) {
  • 读取本地文件
    dsh-executor-gate/smoke.mjs:65
    if (!existsSync(cordisPath)) console.error(` - 找不到真 cordis:${cordisPath}`)
  • 读取本地文件
    dsh-executor-gate/smoke.mjs:66
    if (!existsSync(scopePath)) console.error(` - 找不到真 @deepseek-ai/dsh-scope:${scopePath}(本回归用它铸造真实 scoped agent ctx)`)
  • 读取本地文件
    dsh-executor-gate/smoke.mjs:973
    if (!existsSync(presetFile)) {
  • 读取本地文件
    dsh-intent-guard/index.js:459
    if (!existsSync(absolute)) return { ok: false, text: `【指南针】没有这个文件:${String(rawPath)}` }
  • 读取本地文件
    dsh-intent-guard/index.js:462
    info = statSync(absolute)
  • 读取本地文件
    dsh-intent-guard/index.js:470
    text = readFileSync(absolute, 'utf8')
  • 读取本地文件
    dsh-intent-guard/index.js:509
    entries = readdirSync(dir, { withFileTypes: true })
  • 读取本地文件
    dsh-intent-guard/smoke.mjs:59
    ].find((candidate) => existsSync(candidate))
  • 读取本地文件
    dsh-intent-guard/smoke.mjs:78
    ].find((candidate) => existsSync(candidate))
  • 读取本地文件
    dsh-intent-guard/smoke.mjs:81
    ].find((candidate) => existsSync(candidate))
  • 读取本地文件
    dsh-intent-guard/smoke.mjs:87
    if (cordisPath === undefined || scopePath === undefined || !existsSync(ASAR) || PRESET_FILE === undefined) {
  • 读取本地文件
    dsh-intent-guard/smoke.mjs:91
    if (!existsSync(ASAR)) console.error(` - 找不到 app.asar:${ASAR}(工具名出处的唯一真身)`)
  • 读取本地文件
    dsh-intent-guard/smoke.mjs:223
    const PRESET_TEXT = readFileSync(PRESET_FILE, 'utf8')
  • 写入本地文件
    dsh-intent-guard/smoke.mjs:1006
    mkdirSync(join(ws, 'notes', '_endstate', 'audits'), { recursive: true })
  • 写入本地文件
    dsh-intent-guard/smoke.mjs:1007
    mkdirSync(join(ws, 'private_app'), { recursive: true })
  • 写入本地文件
    dsh-intent-guard/smoke.mjs:1008
    writeFileSync(join(ws, 'notes', 'AGENTS.md'), '# 我的原话\n> 排班顺序不许自己发明\n', 'utf8')
  • 写入本地文件
    dsh-intent-guard/smoke.mjs:1009
    writeFileSync(join(ws, 'notes', '_endstate', 'spec.json'), '{"schema":"endstate-spec/v1","clauses":[]}\n', 'utf8')
  • 写入本地文件
    dsh-intent-guard/smoke.mjs:1010
    writeFileSync(join(ws, 'notes', '_endstate', 'audits', 'T-001-x.json'), '{"clause":"T-001","verdict":"conforms"}\n', 'utf8')
  • 写入本地文件
    dsh-intent-guard/smoke.mjs:1011
    writeFileSync(join(ws, 'notes', '_state.json'), '{"workers":12}\n', 'utf8')
  • 删除本地文件递归
    dsh-intent-guard/smoke.mjs:1075
    rmSync(lab, { recursive: true, force: true })
  • 读取本地文件
    preflight-dsh.mjs:105
    ].find((candidate) => existsSync(candidate))
  • 读取本地文件
    preflight-dsh.mjs:110
    if (existsSync(npxRoot)) {
  • 读取本地文件
    preflight-dsh.mjs:111
    for (const entry of await readdir(npxRoot, { withFileTypes: true })) {
  • 读取本地文件
    preflight-dsh.mjs:114
    if (existsSync(candidate)) binCandidates.push(candidate)
  • 读取本地文件
    preflight-dsh.mjs:120
    if (!existsSync(profileDir)) {
  • 读取本地文件
    preflight-dsh.mjs:122
    console.error('可用的 profile:' + (existsSync(PROFILES_DIR) ? (await readdir(PROFILES_DIR, { withFileTypes: true })).filter((e) => e.isDirectory() && e.n
  • 执行外部命令来自配置/变量
    preflight-dsh.mjs:429
    execFileSync(process.execPath, [binPath, '--profile', PROFILE, '--dump-config'], {
  • 删除本地文件递归
    preflight-dsh.mjs:456
    await rm(LAB, { recursive: true, force: true })
  • 写入本地文件
    preflight-dsh.mjs:458
    await mkdir(labProfile, { recursive: true })
  • 写入本地文件
    preflight-dsh.mjs:470
    await mkdir(labShare, { recursive: true })
  • 写入本地文件
    preflight-dsh.mjs:482
    await mkdir(labModules, { recursive: true })
  • 执行外部命令来自配置/变量
    preflight-dsh.mjs:492
    child = spawn(process.execPath, [binPath, '--profile', bootProfile], {
  • 删除本地文件递归
    preflight-dsh.mjs:546
    else await rm(LAB, { recursive: true, force: true })
  • 写入本地文件
    preflight-dsh.mjs:568
    await mkdir(probeDir, { recursive: true })
  • 写入本地文件
    preflight-dsh.mjs:574
    await writeFile(badPath, "export const name = 'bad'\nexport function apply() {}\nexport const Config = { autoResume: { type: 'boolean', default: true
  • 写入本地文件
    preflight-dsh.mjs:576
    await writeFile(
  • 删除本地文件递归
    preflight-dsh.mjs:596
    await rm(probeDir, { recursive: true, force: true }).catch(() => {})
  • 删除本地文件递归
    preflight-dsh.mjs:629
    await rm(LAB, { recursive: true, force: true }).catch(() => {})
  • 读取本地文件
    repair-profiles.mjs:57
    if (!existsSync(script)) {
  • 执行外部命令来自配置/变量
    repair-profiles.mjs:63
    const out = execFileSync(process.execPath, [script, ...argv], { encoding: 'utf8', timeout: 300_000 })
  • 读取本地文件
    repair-profiles.mjs:78
    if (!existsSync(profileDir)) {
  • 读取本地文件
    repair-profiles.mjs:101
    const present = existsSync(index)
  • 读取本地文件
    snapshot.mjs:78
    return sha256(await readFile(path))
  • 读取本地文件
    snapshot.mjs:87
    entries = await readdir(dir, { withFileTypes: true })
  • 读取本地文件
    snapshot.mjs:112
    if (!existsSync(SNAPSHOT_ROOT)) {
  • 读取本地文件
    snapshot.mjs:116
    const items = (await readdir(SNAPSHOT_ROOT, { withFileTypes: true })).filter((e) => e.isDirectory())
  • 读取本地文件
    snapshot.mjs:125
    if (existsSync(manifestPath)) {
  • 读取本地文件
    snapshot.mjs:126
    const manifest = JSON.parse(await readFile(manifestPath, 'utf8'))
  • 写入本地文件
    snapshot.mjs:183
    await mkdir(outDir, { recursive: true })
  • 写入本地文件
    snapshot.mjs:196
    await mkdir(dirname(to), { recursive: true })
  • 写入本地文件
    snapshot.mjs:310
    await writeFile(join(outDir, 'manifest.json'), `${JSON.stringify(manifest, null, 2)}\n`, 'utf8')
  • 写入本地文件
    snapshot.mjs:414
    await writeFile(join(outDir, '快照说明.md'), restoreDoc, 'utf8')
  • 读取本地文件
    verify-all.mjs:56
    if (!existsSync(path)) {
  • 执行外部命令来自配置/变量
    verify-all.mjs:63
    out = execFileSync(process.execPath, [path, ...args], { encoding: 'utf8', timeout })
  • 读取本地文件
    verify-all.mjs:88
    if (!existsSync(join(DSH_HOME, 'profiles', profile))) {
  • 读取本地文件
    verify-all.mjs:99
    if (existsSync(FALLBACK_HOME)) {
  • 读取本地文件
    verify-all.mjs:111
    if (!existsSync(path)) {
  • 读取本地文件
    verify-all.mjs:116
    const bytes = readFileSync(path)
  • 读取本地文件
    verify-all.mjs:127
    const text = readFileSync(path, 'utf8')
扫描于 2026/10/31(1 天前) · 范围 全包扫描 · 来源 GitHub 仓库

静态扫描只反映源码中出现的调用,不构成安全背书;人工评估与自动扫描相互独立、互不覆盖。

给这个插件打分还没有人投票↓
用户评分
还没有人投票,来当第一个

功能亮点

  • 能力级意图隔离
  • 预算租约式执行
  • 负对照验证

给 DeepSeek Harness 的 10 插件可靠性层:能力级意图隔离、预算租约式执行、负对照验证。把不可靠的 LLM 当作既定前提,在工具 schema 层把它圈住。

README

由 DeepSeek 最新模型翻译生成
DSH 可靠性插件 一个构建在 DeepSeek Harness(DSH)——DeepSeek 开源、基于插件的 agent 运行时——之上的 10 插件可靠性层,它将不可靠的 LLM 视为既定前提,并通过能力级隔离而非提示词层面的客套来约束它们。此处发布了两个插件和四个独立工具作为参考实现;其余为内部生产组件。 在一个高强度的一周内构建完成(2026-09-15 → 09-22),作为我的个人生产系统,通过真实事故不断迭代,并在机制层面的市场对比中,针对官方生态系统的 601 个插件进行了验证。 ⚠️ 这是一个以精选形式发布的个人生产环境。代码由 AI 在设计优先、验证密集的工作流下生成:我负责架构、验收标准和阴性对照测试框架;模型编写了大部分代码行。我认为这种分工——人类判断输入,生成代码输出,机器验证——才是本仓库的真正主题。
展开完整文档(README 剩余 1 节)
DSH 可靠性插件

一个构建在 DeepSeek Harness(DSH)——DeepSeek 开源、基于插件的 agent 运行时——之上的 10 插件可靠性层,它将不可靠的 LLM 视为既定前提,并通过能力级隔离而非提示词层面的客套来约束它们。此处发布了两个插件和四个独立工具作为参考实现;其余为内部生产组件。

在一个高强度的一周内构建完成(2026-09-15 → 09-22),作为我的个人生产系统,通过真实事故不断迭代,并在机制层面的市场对比中,针对官方生态系统的 601 个插件进行了验证。

⚠️ 这是一个以精选形式发布的个人生产环境。代码由 AI 在设计优先、验证密集的工作流下生成:我负责架构、验收标准和阴性对照测试框架;模型编写了大部分代码行。我认为这种分工——人类判断输入,生成代码输出,机器验证——才是本仓库的真正主题。

问题

用多 agent harness 驱动真实项目时,我不断遭遇三类系统性故障:

| 故障类别 | 表现 | 根本原因 |
| 上下文污染 | 意图层读取原始源代码和日志来“检查”执行器,被细节淹没(“被施工灰尘呛住”),并开始自行其是——忘记了整体设计 | 决策与执行之间没有分离 |
| 虚假完成 | 执行器在未完成时报告“完成”;没有人重新检查 | 没有独立的验收层 |
| 向上污染 | 脏的中间状态流入到达用户/上层的报告 | 现场数据与决策上下文之间没有隔离 |

这些问题正是如今业界归类为上下文工程和agent 可靠性的同一批问题。区别在于:大多数产品用更好的提示词来解决它们。我则通过让被禁止的操作在工具 schema 层面变得不可能来解决。

架构

用户的言辞与标准 (notes/*/.md)
│
▼
┌──────────────────┐
│ 意图层 │ 理解、分解、 │ (双预设) │ 定义验收、接受 │ │ │ intent-guard: │ • 无 write/edit schema(完全看不到“修改”) │ 能力级 │ • 无 read/glob/grep/shell schema(看不到现场) │ 隔离 │ • 只有 compass:白名单报告与人类言辞 └────────┬─────────┘ 任务书 + 权限租约 │ ▼ ┌──────────────────┐ │ 执行层 │ 生成的子 agent,拥有自己的上下文 │ │ │ executor-gate: │ • 出生时默认冻结 │ 预算租约 │ • 按任务解锁:工具 × 范围 × 配额 │ │ • 预算耗尽 → 自动停止,报告“未完成” │ executor-loop: │ • 目标状态机跨会话与进程重启持续存在 │ 0-token 判据 │ └────────┬─────────┘ │ dispatch_audit(黑盒) ▼ ┌─────────────────────────────────────────────┐ │ AUDIT LAYER │ │ 在阴性对照下运行,不写入任何内容 │ → 结构化验收报告 │ 报告落在 notes/_endstate/audits/ │ (intent 唯一可读取的内容) └─────────────────────────────────────────────┘

配角阵容:criteria-gate(规则不得在任务书内部被发明——每条规则都必须追溯到人工编写的源文件)、knowledge-gate、endstate-loop(差距测量器 + 累积账本)、endstate-view / executor-view(可观测性面板;endstate 面板通过真实工具调用编辑状态,而不唤醒模型)。

关键设计决策

1. 能力层 > 提示层。 read/glob/grep/pwsh/bash 已从 intent 层的工具表中移除——已在真实 ToolRuntime 上验证:intent 看到 4 个工具,executor 看到 11 个。不是“请不要看”——而是眼睛根本没有安装。
2. 大声失败,逐名处理。 tools.restrict() 在遇到未知工具名时会抛出异常;一个错误名称会静默导致整个掩码未被应用。因此掩码按名称逐个分发,任何“存在但未被移除”的情况都会引发警告。
3. 默认冻结的 executor 配合预算租约。 权限 = 工具 × 范围 × 配额,按任务授予。耗尽是一次正确的停止,而非懒惰。gate 自身的源代码永远不可被租用;三次约束挑战 → 熔断。
4. 状态判据,零 token。 目标延续由宿主侧状态机判定(每次检查 0 token),对比市场上将日志重放给评判模型的做法(每轮一次 LLM 调用)。
5. 处处阴性对照。 预检 gate、冒烟测试——每项检查都嵌入一个必须变红的探针;如果反例保持绿色,整个判定就不可信。
6. 事后复盘驱动的规则。 apply() 永不抛出异常(2026-09-15 的教训:一个会抛异常的插件导致整个窗口无法启动)。每一次事故都变成了一件工具或一条法则。

诚实的边界

- 工具模式隔离不是文件系统沙箱。intent 层仍然可以派发子代理去查看——它读取的是报告,而不是自己爬取站点。真正的只读需要操作系统级挂载,这超出了本文范围。
- 第二道防护层(judgeCleanRoom)被明确标注为启发式——它捕捉的是“随意窥探”,而非蓄意绕过。其上的能力层则不是启发式的。
- 这些插件所挂钩的 harness API 尚处于 1.0 之前,将会发生变化;而这些理念(负向对照、预算租约、能力隔离)并不绑定于 DSH。
- 模型无关是必然要求。 harness 接受多个模型提供方,而此处修复的每一类故障——污染、虚假完成、向上污染——都与模型无关。一个较弱的捆绑模型并不会削弱这一层;反而让护栏变得更加必要。模型越差,能力级隔离就越有价值。

工程纪律

- preflight-dsh.mjs——在重启之前预测“桌面端是否仍能启动?”,并内置负向对照。退出码:0 绿色 / 1 无法打开(附原因)/ 2 缺少依赖。
- verify-all.mjs——总闸门:补丁 YAML、真实 profile 组合、回退 home、已链接插件、app.asar 完整性、快照健康。
- snapshot.mjs + 回滚脚本——一条命令回到已知良好状态。
- 语义化退出码——smoke.mjs:0 通过 / 1 断言失败 / 2 缺少依赖(绝不伪装成失败)。

市场对照

针对官方 awesome-dsh-plugin 列表中 601 个插件的机制级对照(docs/市场对照分析.md)。举一个例子:对比 dsh-loop-continue——该插件会恢复一个在叙述中途停止的 agent 回合(回合内,每次检查调用一次 LLM 裁判);而我的 executor-loop 回答的是另一个问题——目标能否在会话压缩和进程重启后存活(跨会话,0 token)。两者可以共存。这次练习还抓出了我自己的两条错误建议(把单插件框架套用于架构级问题);它们已在文档中撤回,并附上理由。

证据

- 意图层工具表(真实 ToolRuntime):subagent, dispatch_audit, read_compass, list_compass——4 个工具。执行层:11 个。
- 幸存下来的事故:intent-guard 曾锁死所有会话;executor-loop 手写的 Config 曾让桌面端变砖。两者都成了回归测试。
- 回归套件运行真实的 Context、真实的 apply、从 app.asar 中提取的真实工具名——没有 mock,没有重新实现的逻辑。

仓库地图(发布时)

dsh-intent-guard/ 意图层的能力级隔离 (已发布) dsh-executor-gate/ 默认冻结的执行 + 预算租约 (已发布) preflight-dsh.mjs 带负向对照的启动预测器 (已发布) verify-all.mjs 总验证闸门 (已发布) snapshot.mjs 已知良好快照与恢复 (已发布) repair-profiles.mjs profile 修复工具 (已发布) docs/ 架构笔记、市场对照、演示脚本内部生产组件(在 docs/DUAL-MODE.md 中描述,尚未发布): dsh-criteria-gate/ 规则来源门禁 dsh-executor-loop/ 持久目标状态机 knowledge-gate、endstate-loop、endstate-view、executor-view

许可证

工具采用 MIT 许可证。插件作为参考实现发布——它们编码的是我的生产策略;请分叉并根据你的策略重新调整。

作者: 刘新月——会计专业出身,后转型为 AI 系统构建者;曾在中国排名前 20 的会计师事务所工作 6 个月(完整经历忙季,参与 10 个以上项目),之后全力投入智能体工程。正是在会计师事务所的现场工作经历,让这个仓库如此重视验收证据。简历
预览分享卡片长什么样 ↓fj2devivh/dsh-reliability-plugins
分享 · DeepSeek Harness Hub
fj2devivh/dsh-reliability-plugins

用工具级隔离约束不可靠模型,防止越权与虚报完成

回到顶部