DeepSeek Harness 插件

dsh-subprocess-inherit-environment

DSH plugin that explicitly forwards the complete Harness environment through the subprocess service(英文原文)

跳到安装方式

来源信息

GitHub 仓库
zhangzujian/dsh-subprocess-inherit-environment
最近更新
2026年8月15日
分类
界面增强
GitHub stars
2
载体类型
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/zhangzujian/dsh-subprocess-inherit-environment
插件名:dsh-subprocess-inherit-environment
作者:zhangzujian

检查来源文件

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

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

dsh-subprocess-inherit-environment

A removable DeepSeek Harness / DSH plugin that deliberately forwards the Harness process's complete environment through the ctx.subprocess service.

Security warning

This plugin disables DSH's subprocess credential isolation. Every caller that uses the wrapped subprocess service can pass the Harness process's API keys, tokens, passwords, secrets, cookies, proxy credentials, and other environment values to child processes. Model-generated commands, repository scripts, package installers, CLIs, MCP servers, and terminal programs may read or exfiltrate those values.

Do not install this plugin on a shared or untrusted Harness deployment. Prefer a dedicated tool or an exact variable allowlist whenever possible.

The plugin never logs environment names or values by itself. That does not prevent a child process from printing or transmitting them.

Behavior

DSH normally starts subprocesses from a scrubbed parent environment. Variable names matching KEY, PASSWORD, SECRET, or TOKEN, plus ambient DSH_* names, are removed before explicit request entries are merged.

This plugin wraps the three ctx.subprocess operations and supplies an explicit environment layer built from process.env:

  • resolveExecutable(command, env, signal)
  • spawn(spec)
  • spawnTerminal(spec)

All three operations must be functions. Own method descriptors must be configurable; inherited methods and an absent installation marker require an extensible runtime; an existing marker slot must be configurable. Apply checks that complete replacement contract before mutation. If defining the marker or any method still fails, or Cordis rejects effect registration, apply rolls back the marker and every installed method descriptor before rethrowing the error.

Caller-provided entries are merged after a fresh process.env spread on every call, so explicit overrides and undefined tombstones retain their original meaning. The plugin does not mutate caller-owned requests.

Disposal first makes every installed wrapper inactive, then restores previous method descriptors when the plugin still owns them. A later wrapper that captured and delegates to a plugin method therefore reaches the original DSH method with the caller's exact arguments after disposal, without environment injection. Later method replacements are not overwritten. Installing this plugin more than once on the same subprocess runtime is rejected while the first installation is active, avoiding ambiguous out-of-order teardown.

The plugin covers consumers that route process creation through ctx.subprocess. It cannot affect code that bypasses that service and calls Node.js process APIs, worker APIs, or an SDK-owned spawn directly.

Install into a DSH profile

Until this package is published to npm, clone it and add the local directory:

git clone https://github.com/zhangzujian/dsh-subprocess-inherit-environment.git
cd dsh-subprocess-inherit-environment
npx @deepseek-ai/dsh@0.1.0-rc.6 plugin --profile web add "$PWD"

The package declares a DSH bundle, so dsh plugin adds its patch layer to the profile automatically. Restart DSH if the active profile does not hot-reload server plugins.

To remove it and restore DSH's default credential scrub:

npx @deepseek-ai/dsh@0.1.0-rc.6 plugin --profile web remove @zhangzujian/dsh-subprocess-inherit-environment

For a local file URL overlay:

- insert:
    - id: subprocess-inherit-environment
      name: file:///absolute/path/to/dsh-subprocess-inherit-environment/index.mjs

Test

Unit tests require Node.js 22 or newer:

npm test

Integration tests run against an installed DSH tree and verify the original scrub, inherited environment, and disposal restoration without printing any secret value:

DSH_INSTALL_DIR=/path/to/dsh/install npm run test:integration

DSH_INSTALL_DIR is the directory containing node_modules/@deepseek-ai.

License

MIT