- Startseite
- Plugins
- Gedächtnis
- dsh-plugin-sandbox-mode
dsh-plugin-sandbox-mode
wth373737/dsh-plugin-sandbox-mode
A separate agent mode for DeepSeek Harness: reasoning goes into a sandbox document, every action is written there first and then executed by reading it back, and the final answer is printed from that document. Direct tool calls are blocked per preset, and the output also lands as a file card. Deliberately more expensive, and the mode picker says so.
Installation
dsh plugin --profile web add github:wth373737/dsh-plugin-sandbox-modeREADME
Sandbox Mode for DeepSeek Harness
A separate agent preset (mode) for DSH. It implements a strict two-phase sandbox:
- The agent's reasoning is recorded in a thought log.
- Every intended action is first written into one sandbox document.
- Every action is executed by reading that document back, never from a one-off tool argument.
- The final answer is the
outputsection of that document, printed bysandbox_emit. sandbox_emitalso writes the exact text toOUTPUT.mdand registers both the output file and the full document as deliverables, so the Web UI shows a file card with a working path and preview. Its tool result starts with the absoluteOUTPUT.mdpath, followed by the exact text.- Direct calls to other tools are blocked per agent.
The mode appears in the existing mode picker beside the shipped modes. It does not add a panel, button, or option that competes with other settings.
Token warning. This mode is deliberately more expensive. Every action and the final answer goes through at least one document write, one read-back review, and a separate run/emit call. The mode picker shows this warning when you select it.
What it looks like
Agent reasoning
│ sandbox_think
▼
SANDBOX.md ── brief / prepared output / prepared actions / notes
│ sandbox_set_actions │ sandbox_doc_set
▼ ▼
sandbox_run sandbox_emit
│ │
▼ ▼
shell actions executed exact output printed, OUTPUT.md card
Install
From GitHub (recommended) — open Plugins → + Add plugin in DSH and enter:
github:wth373737/dsh-plugin-sandbox-mode
then restart DSH once (the preset and its guard are registered by the Host at startup).
From a local checkout (development) — install the bundle by absolute path, either through the plugin manager's install_bundle or by asking the agent to do it:
plugin_manager action=install_bundle target=<absolute path to this directory>
Either way the bundle inserts one preset row (preset-sandbox) and one child plugin row (sandbox-mode). The child plugin is this package; the preset resolves it from the profile after installation. No existing preset, menu, or setting is modified, and the new mode appears beside the shipped ones in the mode picker.
Requirements:
- A DSH profile with the
tools,systemPrompt, and shell services mounted (the standard Web profile has them). - Windows or POSIX. On Windows the action shell is PowerShell 7; elsewhere it is bash.
The mode protocol
The model sees exactly seven tools:
| Tool | Purpose |
|---|---|
sandbox_status | Show sandbox paths, document state, shell dialect, and file policy. |
sandbox_think | Append one reasoning record to THOUGHTS.md. |
sandbox_doc_read | Read the whole document or one section. |
sandbox_doc_set | Replace the brief, output, or notes section. |
sandbox_set_actions | Validate and replace the prepared action list. |
sandbox_run | Execute the prepared actions from the document. |
sandbox_emit | Print the output section, return its OUTPUT.md path, write OUTPUT.md, present the output file, and end the turn. |
All other tools are blocked by a preset-scoped guard. Global tools are also hidden from the agent with the same preset-scoped restriction, so they do not consume schema tokens or tempt the model.
The guard and the global-tool restriction are registered once in the preset scope, not only when a session is created with this mode. That matters because the Web mode picker creates a session under the previous mode and switches the preset immediately afterwards: a creation-time-only guard would miss that session entirely. In a verified test session the model's request header contained exactly the seven sandbox_* tools, with none of the profile's other tools.
The system prompt makes the rule explicit: do not write user-facing prose in assistant messages; every assistant message should contain only sandbox tool calls. The final answer is the sandbox_emit tool result.
Actions
Only shell actions are supported:
[
{
"type": "shell",
"command": "Get-ChildItem",
"description": "List workspace files",
"timeoutMs": 120000,
"continueOnError": false
}
]
Each action runs in a fresh shell with the session workspace as its working directory. The session's existing file policy (read-only / workspace-write / danger-full-access) still applies. By default sandbox_run stops after the first failed action; set continueOnError: true to continue.
Sandbox files
Each session gets its own directory inside the workspace:
.sandbox/<session-id>/
SANDBOX.md # the single source of truth for actions and output
OUTPUT.md # exact copy of the output section, written by sandbox_emit
THOUGHTS.md # append-only reasoning log
.gitignore # keeps the sandbox out of git
The plugin writes these files directly. They are plugin-owned metadata, so they remain writable even in a read-only session; the sandbox does not use the model's file tools.
Where is the output?
sandbox_emit does three things:
- returns the absolute path of
OUTPUT.mdand the exact output text as the tool result; - writes the same text to
OUTPUT.md; - appends a
deliverables/presentedrecord forOUTPUT.mdandSANDBOX.md.
The first line of the tool result is the path, so the file is visible in the chat even if the delivery card is collapsed. The last step uses the same delivery surface as the built-in present tool, so the turn ends with two clickable cards: OUTPUT.md (the exact answer) and SANDBOX.md (the full document, including the action list and notes). Clicking a card previews it in the right Sidebar; the open control opens the file in the system's default application. The absolute paths are also shown by sandbox_status.
Example
- The user asks: "What is in the workspace?"
- The agent calls
sandbox_status. - The agent calls
sandbox_thinkwith its analysis. - The agent calls
sandbox_set_actionswith[{ "type": "shell", "command": "Get-ChildItem" }]. - The agent calls
sandbox_doc_readto review the exact command. - The agent calls
sandbox_run; the transcript comes back. - The agent calls
sandbox_doc_setwith the final answer inoutput. - The agent calls
sandbox_emit; that output is the turn's final visible result.
Design notes and limits
- A mode plus a delivery card. The mode picker gets one extra row; the only other UI is the standard deliverables card at the end of the turn, which points at
OUTPUT.mdandSANDBOX.md. No new panel or competing control is added. - Tool calls are blocked, assistant prose is not. DSH has no plugin hook that erases text the model already streamed. The system prompt forbids prose, but a determined model can still emit it. The sandbox controls actions and the final output; it is not a security boundary against the model itself.
- Shell actions can edit the document. The document is a normal file. A shell action could rewrite
SANDBOX.md, so the guarantee is "the document is the only action/output source", not "the document cannot be tampered with by an action". - One session, one sandbox. The directory is keyed by session id, so parallel sessions do not share a document.
- Compaction is included. Long sandbox runs can compact normally.
Development
node --check index.js
node test-internals.mjs
The module only imports Node built-ins. It registers its tools, prompt section, guard, and global-tool restriction as Cordis effects in the preset scope. The restriction is refreshed when an Agent joins the preset and when a session selects the preset, so the visible tool set stays limited to the sandbox tools.
Because this is a Host plugin, DSH must be restarted once after installing a changed build; the running Host keeps the previous JavaScript generation until then. The mode itself needs no separate UI build.
License
MIT
Ähnliche Plugins
hindsight (coding-agents)
vectorize-io/hindsight
OpenViking (dsh-memory-plugin)
volcengine/openviking
MemOS (memos-local-plugin)
memtensor/memos
ReMe (dsh)
agentscope-ai/reme