AI Agent Hub
Back to plugins
⚙️

dsh-subprocess-inherit-environment

Workflow Updated 2026.08.15

Run the following command in DeepSeek Harness:

dsh plugin install zhangzujian/dsh-subprocess-inherit-environment

Paste the following prompt into your AI chat to install this plugin:

Run the dsh plugin install command to clone the repository at https://github.com/zhangzujian/dsh-subprocess-inherit-environment into a local directory and add it to your DSH profile, enabling environment inheritance for child subprocesses.

About this plugin

By default, DeepSeek Harness (DSH) scrubs sensitive variables from child process environments: any entry whose name contains KEY, PASSWORD, SECRET, or TOKEN, along with DSH_* prefixed names, is removed before the subprocess starts. This credential isolation protects most workloads, yet it also blocks tools that legitimately depend on the full parent environment, such as certain MCP servers, package installers, or CLI utilities.

The dsh-subprocess-inherit-environment plugin wraps the three ctx.subprocess operations (resolveExecutable, spawn, spawnTerminal) and injects a complete copy of the current process.env as an explicit environment layer on every call. Caller-supplied entries are merged after a fresh spread of process.env each time, preserving the original semantics of explicit overrides and undefined tombstones without mutating the caller object. Upon disposal the plugin restores the original method descriptors, so any later wrapper still delegates correctly to the native DSH implementation.

This plugin is well suited for developers and researchers running trusted, single-user environments where CLI tools, MCP servers, or installer scripts need access to the full parent environment. A critical caveat: once loaded, any child process spawned through ctx.subprocess can read API keys, tokens, passwords, and other secrets. In shared deployments, untrusted repositories, or multi-user setups, prefer an exact variable allowlist or a dedicated isolation mechanism instead of forwarding the entire environment.

Use Cases

  • MCP servers or CLI tools that require the full parent API keys and proxy config
  • Local package installers that depend on parent proxy credentials to execute
  • Solo developer debugging where child scripts need every environment variable

Best For

  • Developers running DSH in a trusted single-user deployment
  • Engineers whose MCP servers or tooling need full subprocess environment access
  • Contributors verifying environment passthrough in sandboxed DSH instances