← 返回列表
D

dsh-plugin-search-gate

v0.1.0 · 4 天前发布

DeepSeek Harness plugin: gate the glob/grep search tools to the workspace root so paths outside it are denied before ripgrep runs.

dshdsh-plugindeepseek-harnesssandboxsecurityripgrep

README

dsh-plugin-search-gate

DeepSeek Harness 插件:给 glob / grep 搜索工具加工作区路径围栏

背景

dsh-tool-fs-search 通过 ctx.subprocess 直接运行 ripgrep,没有任何 sandbox policy 或路径约束(--no-ignore --hidden 还枚举隐藏文件)。path 参数可指向机器上任意目录(C:\Users\...\.ssh$DSH_HOME\.credentials.yaml 等),把工作区外的文件内容读进模型上下文——与 bash/write/edit 的沙箱体系不一致。

效果

注册一个 tools.guard:对 grep/globpath 参数做解析后包含性检查,越界即拒绝执行并返回 [search-gate] ... 拒绝原因(工具调用整体失败,模型能看到原因)。

安装

bash
dsh plugin --profile web add dsh-plugin-search-gate

然后在 profile 的 cordis.patch.yml 或 agent preset 中挂载:

```yaml

  • id: search-gate

  • name: dsh-plugin-search-gate
    config:
    # root 缺省 = ctx.sandboxPolicy.workspaceRoot(部署进程的 cwd)。
    # 实测:Web profile 下它是启动目录(如用户主目录),比会话工作区宽。
    # 要按会话工作区收紧,请显式配置,例如:
    # root: C:/Users/<you>/Deskto

    版本兼容矩阵

    DSH 版本状态说明
    dsh@0.1.0-rc.6 ❓ 未知 metadata 缺失
    dsh@0.1.0 ❓ 未知
    dsh@0.2.0 ⚠️ 待验证 待实测(API 可能在变)
    dsh@0.3.0+ ❓ 未知 尚未发布

    💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正

    元数据

    License
    MIT
    npm
    dsh-plugin-search-gate
    Repo
    Engines
    {"node":">=18"}
    Weekly DL
    0
    Monthly DL
    0
    dsh.bundle
    {}