DeepSeek Harness (DSH) adopts a plugin-based architecture. In agent development, local file systems and child processes are common execution primitives, but they introduce certain security risks. The DSH plugin dsh-agentenv-sandbox addresses this issue. It migrates a Harness process’s file operations and command execution capabilities to a remote environment, running them on a Firecracker microVM backend provided by AgentENV.
Plugin Introduction¶
This plugin is the AgentENV/E2B execution-world bundle for DeepSeek Harness. It replaces the local file system and subprocess providers built into DSH, uses the official Harness E2B adapter, and runs on the AgentENV microVM backend. After installation, Bash commands, file tools, persistent terminals, and LSP processes share the same remote Linux world.
- Owner: ztting01
- Category: admin-security
- License: MIT
- Core value: Safely execute agent operations in a microVM environment.
Core Features¶
- Provider replacement: Replaces local file system and subprocess providers with the E2B adapter, so all agent operations are sent to the remote environment through
ctx.fsandctx.subprocess. - Execution environment: Built on the AgentENV Firecracker microVM backend.
- Supported capabilities: Supports Bash commands, file tools, persistent terminals, and LSP processes.
- Version compatibility: Compatible with DeepSeek Harness 0.1.0-rc.7, E2B 2.29.1, and AgentENV 0.1.0 and 0.1.3.
- Environment requirements: Requires a Node.js 22.19+ or 24+ environment.
Installation and Configuration¶
This plugin does not include installation scripts for AgentENV or DeepSeek Harness, and it does not automatically build templates. It requires users to complete the deployment of AgentENV and Harness in advance and to have built the template.
1. Environment and Prerequisites¶
- Operating system: WSL 2 or Linux only. Native Windows is not supported (DSH will refuse to start).
- Node.js: The version must be 22.19.0 or later, or 24.0.0 or later.
- Dependencies: DeepSeek Harness and AgentENV must be preinstalled and running.
2. Build Template¶
Before using the plugin, you need to build an AgentENV template. The plugin includes a sandbox/Dockerfile, which defines a tool environment with Node.js 24, Bash, Git, and other tools.
# 在 AgentENV 安装并认证后,从插件根目录运行
aenv build ./sandbox/Dockerfile --name dsh-agentenv-node24 --cpu 2 --memory 4096
3. Configure Environment Variables¶
In the shell that starts the Harness process, you must set the following environment variables to connect to a local or remote AgentENV service.
export AENV_API_KEY='<agentenv-api-key>'
export E2B_API_URL=http://127.0.0.1:8000
export E2B_SANDBOX_URL="$E2B_API_URL"
export E2B_API_KEY="$AENV_API_KEY"
export AENV_TEMPLATE_ID=dsh-agentenv-node24
4. Install Plugin¶
Download the precompiled release package and add it to Harness’s web profile.
curl -LO https://github.com/ztting01/dsh-agentenv-sandbox/releases/download/v0.1.5/dsh-agentenv-sandbox-0.1.5.tgz
dsh plugin --profile web add "$PWD/dsh-agentenv-sandbox-0.1.5.tgz"
dsh --profile web --dump-config
Important Notes¶
- Fail-closed mechanism: This plugin uses a “fail-closed” policy. If AgentENV creation, setup, or workspace upload fails, the remote provider will not load and will not fall back to host execution. This guarantees isolation.
- Host dependencies: The DSH process itself, model calls, the Cordis service, session persistence, etc. remain on the host; only adapter-mediated operations run inside the microVM.
- Pure-code plugin restrictions: Pure-code plugins cannot directly access Node.js native
fsorchild_process; they must go through the adapter. - Version pinning: The current version has been tested on DeepSeek Harness 0.1.0-rc.7. Please ensure the versions match.
Summary¶
dsh-agentenv-sandbox is the standard solution for replacing DSH’s local execution environment with a remote isolated environment. Through the E2B adapter and AgentENV microVM, it allows agents to run Bash and file operations in a safer, persistent sandbox. During deployment, pay attention to installing prerequisites and building templates, and ensure it runs in a WSL 2 or Linux environment.