Introduction¶
In DeepSeek Harness (DSH), an agent mode must clearly define its source of actions and source of output; otherwise, inconsistencies easily arise between tool calls and the final response. DSH’s plugin system allows extending modes and toolsets via Host plugins without modifying DSH itself.
This article introduces wth373737/dsh-plugin-sandbox-mode: it provides DSH with a dedicated agent mode (preset) that uses a single document as the single source of truth for both actions and output, implementing a strict two-phase “think — record — execute — emit” workflow.
What It Is¶
This is a workflow-categorized DSH plugin that implements a strict sandbox mode. The mode creates a dedicated directory for each session, records the agent’s reasoning in THOUGHTS.md, writes planned actions and the final output to SANDBOX.md, reads actions from the document to execute them via sandbox_run, and finally uses sandbox_emit to output the result and generate an OUTPUT.md file card. All other tools are blocked in the current mode by a preset-scoped guard, and global tools are also hidden, preventing the model from seeing irrelevant schemas in the tool list.
The maintainer is wth373737. The plugin uses Cordis effects to register tools, prompt snippets, guards, and global tool restrictions within the preset scope, and refreshes the visible toolset when an Agent joins the preset or when a session switches presets.
Core Features¶
- Dedicated mode: Adds a
sandboxrow to DSH’s mode selector without introducing new panels or competing controls. - Seven dedicated tools:
sandbox_status,sandbox_think,sandbox_doc_read,sandbox_doc_set,sandbox_set_actions,sandbox_run,sandbox_emit. - Two-phase workflow: The model first calls
sandbox_thinkto record its reasoning, then fills in planned actions viasandbox_set_actions.sandbox_runreads and executes them from SANDBOX.md, and finallysandbox_emitoutputs the output section into the tool result, writes it to OUTPUT.md, and registers it as a deliverable card. - Document as source: SANDBOX.md is the single source of truth for both actions and output. All actions are executed by reading from this document, and the final output is the output section of this document.
- Deliverable card:
sandbox_emitreturns the absolute path to OUTPUT.md and the exact text, writes the file, registers deliverables/presented records, and displays OUTPUT.md and SANDBOX.md as cards in the Web UI. - Tool restriction: A preset-scoped guard blocks all tool calls except the seven
sandbox_*tools. Global tools are also hidden and do not consume schema tokens. - Session isolation: Each session maps to a
.sandbox/<session-id>directory; multiple sessions do not share documents. - Shell-only actions:
sandbox_runsupports only theshellaction type. Each action runs in an independent shell, inheriting the session’s working directory and the existing file policy (read-only / workspace-write / danger-full-access), with configurablecontinueOnError.
Installation & Activation¶
Install from GitHub (recommended):
- In DSH, open Plugins → + Add plugin.
- Enter:
github:wth373737/dsh-plugin-sandbox-mode
- Restart DSH once after installation to complete preset and guard registration.
Install from a local checkout (development):
plugin_manager action=install_bundle target=<absolute-path>
After installation, a new row preset-sandbox appears in the preset list with its sub-plugin sandbox-mode. No existing presets, menus, or settings need to be modified.
Environment requirements: A DSH profile with mounted tools, systemPrompt, and shell services (the default Web profile satisfies this); the operating system must be Windows or POSIX (PowerShell 7 is used by default on Windows; bash is used in other environments).
Typical Usage¶
- User asks: “What is in the workspace?”
- The model calls
sandbox_statusto check the sandbox path and current file policy. - The model calls
sandbox_thinkto write its analysis into THOUGHTS.md. - The model calls
sandbox_set_actionswith an action list (shell only):
[
{
"type": "shell",
"command": "Get-ChildItem",
"description": "List workspace files",
"timeoutMs": 120000,
"continueOnError": false
}
]
- The model calls
sandbox_doc_readto review the command in SANDBOX.md. - The model calls
sandbox_runto execute the shell action from the document. - The model calls
sandbox_doc_setto write the final answer into the output section. - The model calls
sandbox_emitto output the result, write OUTPUT.md, and end the turn with a deliverable card.
Use Cases & Caveats¶
- Use cases: Workflow scenarios that require actions and outputs to be recorded in a traceable document, such as debugging, auditing, and script orchestration.
- Caveats:
- This mode increases token consumption because every action and the final output require a document write, a read-back verification, and a run/emit call. The mode selector will display a token warning.
- The plugin runs with the permissions of the current DSH process. Review the source code and license before installing.
- The mode does not provide a security boundary against the model itself; it only controls the source of actions and output. The model may still emit non-tool text in assistant messages — explicitly prohibit prose in the system prompt.
- Shell actions can read and write SANDBOX.md, so the document is the single source for actions and output rather than an immutable “security isolation file.”
- Long-running sandbox sessions support regular file compaction.
Summary¶
Sandbox Mode provides DSH with a document-centric workflow: thinking is recorded in THOUGHTS.md, planning and execution live in SANDBOX.md, and the final output is generated by sandbox_emit into OUTPUT.md and presented as a deliverable card. Through preset-scoped guards and global tool hiding, this mode adds a single row to the mode selector without disturbing other settings, making it suitable for workflow scenarios that require traceable and auditable actions and outputs.
- Directory page: https://www.skillhub.cn/plugins/wth373737/dsh-plugin-sandbox-mode
- GitHub: https://github.com/wth373737/dsh-plugin-sandbox-mode