DSH Plugins
返回列表
⚙️

dsh-pwsh-guard

工作流 更新于 2026.10.20

在终端中运行以下命令:

dsh plugin install Steven-Qiang/dsh-pwsh-guard

将以下提示词粘贴到 DeepSeek Harness 对话框中:

在 DeepSeek Harness 中执行 dsh plugin install Steven-Qiang/dsh-pwsh-guard,或按资料从 https://github.com/Steven-Qiang/dsh-pwsh-guard 安装该插件。

插件介绍

在 DeepSeek Harness 里,Agent 仍常通过 PowerShell 或 bash 用 Get-Content、cat、grep、Select-String 等命令读文件、搜文本,既难审计,也容易和「用 read 读、用 grep 搜、用 glob 找文件」的工作流规范冲突。dsh-pwsh-guard 在 shell 真正执行前挂一层 guard,专门拦这类「用终端当文本 I/O」的用法,并在拒绝理由里写明应改用的工具。

插件在 pwsh、bash 与 ops_bash 上注册 ctx.tools.guard,按规则表识别文本搜索、文件读取、通过 node -e / python -c 等绕路读文件、滥用 sleep 以及 2>&1 管道合并 stderr 等模式。短别名只在命令起始位置匹配,引号内的字符串不参与匹配,并尽量放过 git gc、带 --grep 的 git log 等误报场景;拒绝文案随宿主语言输出中英文。

可选配置里 language 可设为 auto,会跟随 DSH_LOCALE、宿主 locale 或 LANG / LC_ALL。它不负责目录列举,也不是沙箱;需要更严格的破坏性命令或密钥访问防护时,应配合 cc-safety-net 等专用 guard 使用。

适合希望把「读搜定位走专用工具、少碰 shell 文本命令」写进 Agent 工作流的平台维护者、插件 profile 作者,以及正在规范 Harness 工具用法的团队。

使用场景

  • 希望 Agent 读文件时走 read,而不是 cat 或 Get-Content
  • 需要在 pwsh/bash 执行前自动拦截 grep、Select-String 等文本搜索
  • profile 里要统一禁止用 shell 绕路做 node -e 读文件

适合人员

  • DeepSeek Harness profile 维护者
  • 规范 Agent 工具用法的平台团队
  • 在 Cordis 插件栈里做工作流约束的开发者