Preface¶
DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture, where plugins expose capabilities through a tool interface. When it is necessary to invoke the locally installed AgentRanch CLI (aw-cli.exe) from within a DSH plugin, the conventional approach often requires bypassing DSH’s sandbox or executing directly in the host process, which raises issues around unclear permission and security boundaries. The agentranch-dsh plugin provides the ability to invoke AgentRanch aw-cli in a controlled, bounded manner within DSH, bringing AgentRanch operations under DSH’s tool contract and permission model.
What This Is¶
agentranch-dsh is a DSH plugin targeting Windows AgentRanch 0.2.0, maintained by gongxianjin. It does not bundle AgentRanch itself, nor does it provide remote execution authorization, SSH/MCP bridging, or key management functionality. Instead, it leverages the DSH host to invoke the plugin entry point, constraining the execution of aw-cli.exe to a specified root directory, and applies sanitization and bounded control to output and side effects.
Core Features¶
- Invokes aw-cli.exe via an absolute path configured in the DSH host, restricting the working directory and file access scope.
- Provides four tools: agentranch_identity, agentranch_check, agentranch_local_check, agentranch_run_once.
- Tool parameters are validated by schema; arbitrary argv, shell execution, environment variable overrides, long-running modes, or external executable substitution are not supported.
- Runner and controller modes trigger AgentRanch side effects; each invocation requires explicit host approval of the current agent and call.
- Results retain bounded, sanitized stdout/stderr, exit code, timeout status, and diagnostic information, and return JSON whenever possible.
- Private keys, token/password/API key assignments, and bearer Authorization values are redacted in model-visible output.
Installation and Enablement¶
This plugin is not installed directly through the DSH plugin manager. It must first be built and packed into a tarball, then installed via the DSH profile/plugin manager.
- Run the build and pack commands in the plugin repository directory:
npm.cmd run build
npm.cmd pack --pack-destination .\release
- Install the generated tarball through the DSH profile/plugin manager (the specific command depends on the DSH environment and must reference this tarball).
Configuration¶
The DSH host provides configuration when invoking the plugin entry point. The absolute path to aw-cli and at least one allowed root directory must be specified. Example configuration:
{
"awCliPath": "C:\\Program Files\\AgentRanch\\aw-cli.exe",
"allowedRoots": ["C:\\Users\\me\\AgentRanch-workspaces"],
"defaultTimeoutMs": 30000,
"maxOutputBytes": 65536
}
- awCliPath: configuration-only; cannot be overridden by tool parameters.
- allowedRoots: must include the absolute paths of configPath and stateDir.
- Symbolic links, junctions, and Windows reparse points are not permitted.
- Configuration changes are a user action, not a model action.
Tools¶
The plugin registers four tools:
agentranch_identity({})→ invokes aw-cli –identity.agentranch_check({ configPath, timeoutMs? })→ invokes aw-cli check –config. agentranch_local_check({ stateDir, timeoutMs? })→ invokes aw-cli local-check –state-dir. agentranch_run_once({ mode: "runner" | "controller", configPath, timeoutMs? })→ invokes aw-cli–config –once.
All parameters are validated by schema. Arbitrary argv, shell, cwd, environment variable overrides, executable overrides, MCP, SSH gateway, owner commands, fixture commands, or long-running modes are not supported.
Result Semantics¶
- Results retain bounded, sanitized stdout/stderr, exit code, timeout status, diagnostic information, and best-effort JSON.
- Model-visible output redacts private key material, token/password/API key assignments, and bearer Authorization values.
- For agentranch_check, active_probe is false and external_readiness is not_probed; it performs only a local configuration check and does not serve as proof of external readiness.
- agentranch_local_check on Windows returns exit code 2 with the message “local fixture timed out; uncertain task remains in ledger”: the fixture child process ran and was verified (sum=6, exit 0), but the run only transitions to done under acknowledged M0 owner evidence, which only the Linux owner-exec path can produce. An unknown run status and a retained reservation are honest results, not errors to be retried. This is a local simulation fixture, not a genuine remote AO/Reason/model execution.
- A successful process exit does not mean AgentRanch completed the remote job; inspect the returned JSON and diagnostics.
Non-Goals¶
- Not a GUI replacement, remote execution authorization layer, SSH/MCP bridge, key manager, or AgentRanch evidence gate substitute.
- Does not modify configurations, create keys, upload files, or publish data.
Applicable Scenarios and Notes¶
- Suitable for scenarios that require invoking the local AgentRanch aw-cli within DSH under a tool contract, especially for agent development and debugging with explicit permission and output boundary requirements.
- The plugin runs with the permissions of the current DSH process. Review the source code and license (MIT) before installation.
- Ensure DSH 0.2.2-rc.1 and Node.js >=24.9.0 are installed, and confirm the target AgentRanch version is 0.2.0.
Closing¶
agentranch-dsh brings local AgentRanch aw-cli execution under DSH’s plugin contract and permission model, providing bounded, controlled tool interfaces. It is well suited for scenarios requiring stable AgentRanch invocation within DSH. Visit the directory page and GitHub for more information: https://www.skillhub.cn/plugins/gongxianjin/agentranch-dsh and https://github.com/gongxianjin/agentranch-dsh.