前言¶
DSH 走“一切皆插件”的路线。对智能体工作流来说,插件扩展能力,也扩大了工具调用面:bash、文件编辑、网络请求都可能直接执行。只靠事后日志不够,需要在调用执行前做策略判断,并留下允许、阻止和原因的记录。
下面介绍 @agenticcontrolplane/dsh。它是面向 DeepSeek Harness 的 native Cordis plugin,接在 dsh 的 typed interception points 上,不是 shell-hook shim。
这是什么¶
@agenticcontrolplane/dsh 的定位很直接:在每个工具调用运行前检查策略,并记录哪些调用被允许、哪些被阻止,以及原因。
仓库为 agentic-control-plane/dsh-acp-plugin,npm 包名为 @agenticcontrolplane/dsh,许可证为 MIT。它支持一个 workspace 覆盖 dsh、Claude Code、Codex、Cursor 和 OpenClaw。
注意区分:dsh 核心中的 packages/acp 是 Zed’s Agent Client Protocol,与这里的 Agentic Control Plane 插件无关。
核心功能¶
调用前策略决策¶
插件注册在 tools/pre-execute,支持三种决策:
allow:放行调用。deny:阻止调用,并记录原因。ask:交给 dsh 的 approval flow。
调用后输出扫描¶
插件注册在 tools/post-execute:
- 服务端阻断时,将结果转成 corrective feedback。
- shadow mode 下会给出通知。
决策记录¶
决策发送到控制台,包含 tool、input preview、decision、reason、latency、cost。
失败姿态¶
- 交互式会话在控制面不可达时 fail open loudly。
- 无人值守 agent 在控制面不可达时 fail closed。
- policy deny 不受 outage posture 影响。
- 在无 approval service 的 headless compositions 中,dsh 会把
ask解析为 deny。
工程形态¶
- 零依赖。
- plain ESM。
- 无构建步骤。
- 支持
cordis.patch.yml或环境变量配置。
安装与启用¶
先确认 dsh 使用 Node 22。dsh 要求 Node 22;Node 20 可能启动失败,且报错不一定直接说明版本问题。
使用安装脚本:
curl -sf https://agenticcontrolplane.com/install.sh | bash
安装后,用 profile 启动 dsh:
dsh --profile <your-profile>
手动安装命令如下:
dsh plugin --profile <your-profile> add @agenticcontrolplane/dsh
dsh --profile <your-profile>
安装包和挂载到 profile 是两件事。确认插件已挂载:
dsh --profile <your-profile> --dump-config | grep @agenticcontrolplane/dsh
如果没有命中,把 @agenticcontrolplane/dsh 加入该 profile 的 package.json 的 "dsh.profile.bundles" 列表。
凭据可放在 ~/.acp/credentials,也可通过 ACP_BEARER_TOKEN 提供。没有 key 时,插件会报告问题并保持不干预,不会让会话不可用。
典型用法¶
启动当前 profile:
dsh --profile <your-profile>
在会话中,工具调用会经过:
1、tools/pre-execute:返回 allow、deny 或 ask。
2、tools/post-execute:调用执行后进行输出扫描。
配置可通过 profile 的 cordis.patch.yml 覆盖。条目使用 id: acp、name: @agenticcontrolplane/dsh,配置项包括 governBase、agentTier、timeoutMs:
- id: acp
name: @agenticcontrolplane/dsh
config:
governBase: <your-govern-base>
agentTier: <your-agent-tier>
timeoutMs: <your-timeout-ms>
环境变量方式:
export ACP_GOVERN_BASE=<your-govern-base>
export ACP_BEARER_TOKEN=<your-bearer-token>
export ACP_AGENT_TIER=<your-agent-tier>
export ACP_SHADOW=off
运行测试:
npm test
适用场景与注意¶
适合:
- 对 dsh 的工具调用做执行前策略检查。
- 保留 allow、deny、ask 的决策记录。
- 在 dsh、Claude Code、Codex、Cursor、OpenClaw 中复用同一 workspace。
- 给无人值守 agent 设置更保守的失败策略。
注意:
- 插件以当前 dsh 进程权限运行。安装前应检查源码与 MIT 许可证。
- dsh 要求 Node 22;Node 20 可能启动失败,且错误不一定直接说明原因。
- 控制面不可达时,交互式会话 fail open loudly,无人值守 agent fail closed;policy deny 不受影响。
- 无 approval service 的 headless compositions 中,dsh 会把
ask解析为 deny。 - Claude Code bridge 可以使用未修改的
hooks.json,但 input rewriting 不被 honor;推荐 native plugin。 - 包名曾为
dsh-plugin-acp;旧名仍可安装,但已 deprecated。 - 社区目录是独立站点,与 DeepSeek / 幻方无官方从属关系,不应理解为官方应用商店。
结尾¶
@agenticcontrolplane/dsh 把工具调用策略移到执行前,并保留允许、阻止和原因的记录。GitHub:https://github.com/agentic-control-plane/dsh-acp-plugin。目录页链接未在已核实事实中确认,本文不直接给出 URL。