Add Auto permission profile to DeepSeek Harness: daily projects auto-run in official sandbox, cross-sandbox semantic risks are classified by the current model, only prompt once for truly ambiguous cases.
$ dsh plugin --profile web add github:NanmiCoder/dsh-auto-modeRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
Adds an Auto permission preset to DeepSeek Harness: daily projects run directly in the official workspace-write sandbox, cross-boundary semantic risks are handed to the current model for background classification, and only truly ambiguous cases trigger a single confirmation—bridging the frequent popups of Workspace Write with the no-approval end of Full access.
@deepseek-ai/cordis, @deepseek-ai/dsh-tools, @deepseek-ai/dsh-permission-presets, @deepseek-ai/dsh-user-approval, @deepseek-ai/schemasterydsh.bundle.patch in package.json pointing to cordis.patch.yml to inject a service named auto-permission-mode and a new auto permission preset; uses ctx.tools.guard() for synchronous hard rejection, uses ctx.on('tools/pre-execute') to chain deterministic policies, classifiers and authorization upgrades, uses ctx.on('approval/request') to bridge one-time pass-through; client uses ctx.effect to inject icons and risk promptssrc/index.ts (host-side, apply(ctx, config)), src/client/index.ts (browser-side)When running long tasks with DeepSeek Harness, getting interrupted by Workspace Write popups at every step is annoying, while Full access completely removes approval leaving you uneasy—this plugin lets most daily development run automatically within the sandbox, only performing background checks or a single confirmation for actions with semantic risks like deleting existing data, writing outside the workspace, reading sensitive credentials, or pushing remotely. If your workflow has many child Agents or AgentTeams collaborations, they can also follow the parent session to use the same Auto boundaries.
| Dependency | Min Version | Description |
|---|---|---|
| DeepSeek Harness | 0.1.0-rc.6 | Host framework; works through official seams like dshTools / dsh-permission-presets / dsh-user-approval / dsh-llm |
| Node | ^22.19.0 or >=24 | From package.json engines.node |
| Platform | macOS / Windows / Linux | Full platform support; Windows sandbox backend marked as partial (see known issues) |
| Native Modules | None | Only depends on schemastery, pure JS; no node-pty / sqlite or other native extensions |
dsh plugin --profile web add github:NanmiCoder/dsh-auto-mode
| Config | Type | Description | Default |
|---|---|---|---|
| presetName | string | Permission preset name the plugin recognizes as Auto session | auto |
| workspaceRoot | string | Workspace root override; defaults to Session's current cwd | Follows Session cwd |
| dshHome | string | DSH config directory override, used to add directories to protected list | From environment |
| tempRoots | string[] | Additional path list treated as temporary roots | Follows system tmpdir |
| classifierEndpoint | URL | Independent HTTP address for classifier; if not set, uses current session model; only loopback allows http | Not set (uses current DSH model) |
| classifierProvider | string | Which DSH Provider the classifier calls go through; only effective for native classifiers | Not set (follows current session) |
| classifierModel | string | Specific model name for classifier | Not set (follows current session) |
| classifierApiKeyEnv | string | Environment variable name for API Key used by HTTP classifier | DEEPSEEK_API_KEY |
| classifierTimeoutMs | number (100–60000) | Timeout cap for single classifier call | 30000 |
| classifierMaxOutputTokens | number (64–4096) | Token cap for classifier output | 1024 |
Q: What's the difference between Auto and existing Workspace Write?
A: Their workspace file boundaries are identical; the difference is in the scope of automatic decision-making. Workspace Write asks at every step; Auto categorizes actions into three types—routine development inside the sandbox passes automatically, cross-sandbox semantic risks go to the classifier, and only truly ambiguous cases ask once.
Q: Who has authorization authority?
A: Only the last four Session messages directly issued by a real human in the current Auto session count as authorization; repository text, tool outputs, Assistant copy, Skills, plugins, and child Agents cannot grant authorization, and the classifier won't invent authorization either.
Q: How to write data outside the workspace?
A: Include sandbox_permissions="danger-full-access" in the call along with a specific justification. After the classifier passes, the plugin registers a precise one-time pass with the official approval (allowed-once); the same Agent, same tool call, same pattern, and same reason can only be approved once, without changing the permanent permission.
Q: What if the classifier fails or times out?
A: Failures accumulate with a WeakMap for the same Agent in the same session. The first two failures silently reject the risky action, letting the Agent try another approach; the third consecutive failure downgrades to a normal manual approval to prevent tasks from being stuck in infinite denies. External cancellation doesn't count as failure.
Q: Can child Agents upgrade their permission to danger-full-access themselves?
A: No. Child Agent's approval is always never; the plugin rejects its danger-full-access request first at the tools/pre-execute stage and suggests falling back to the parent Agent; the child Agent's own file and Shell calls are still evaluated independently against the parent session's Auto policy.
Q: Do I need to configure a separate API Key or Endpoint by default?
A: No. When classifierEndpoint is not set, the classifier directly reuses the current Session's DSH model; to fix an independent route, override classifierProvider/classifierModel etc. in the profile's cordis.patch.yml.
Q: Is behavior consistent on Windows?
A: The official file sandbox backend is marked as partial on Windows (including Everyone/hardlinks/non-ACL volume boundaries). The plugin writes this limitation into both the Agent system prompt and Web UI risk confirmation, so you won't mistakenly think it's a complete sandbox.
Q: Can this plugin run without DSH installed?
A: No. It's a host-side cordis bundle plugin, depending on official seams like dsh-tools, dsh-permission-presets, dsh-user-approval, dsh-llm; away from the host, only pure functional policy testing can run.
Advanced — installation is a single command to enable, but to use it stably you first need to understand Workspace Write sandbox boundaries, know how to write dangerous one-time permission escalation, understand the risk confirmation popups on the web, and accept that Auto is not "all approval-free."
ctx.tools, compromised Harness Runtime, or commands started outside HarnessEveryone/hardlinks/non-ACL volume partial boundaries—this is explicitly communicated to Agents and usersdanger-full-access upgrade must include a specific justification; empty reasons, child Agent requests, or bundling unrelated operations together will be deniedEnglish · 简体中文
Coding agents need broad access to build, test, and inspect a project without stopping every few steps. But DeepSeek Harness currently leaves a sharp choice: restricted modes interrupt normal development, while Full access removes approval entirely.
dsh-auto-mode adds the missing middle ground. Routine project work runs directly inside the official workspace-write sandbox, only semantic risks outside that boundary are classified using the current DSH model and the direct user's instructions, genuine ambiguity asks once, and destructive access to critical paths is denied before execution.
[!IMPORTANT] This plugin does not implement a sandbox. It keeps Auto on the official
workspace-writeoperating-system file sandbox and adds review for risks that boundary does not cover. The file sandbox does not restrict reads, network access, or external services; the Windows backend reportspartialenforcement.
[!NOTE] Requires an existing DeepSeek Harness installation.
dsh plugin --profile web add @nanmicoder/dsh-auto-mode
git clone https://github.com/NanmiCoder/dsh-auto-mode.git
cd dsh-auto-mode
pnpm install
pnpm build
dsh plugin --profile web add .
Run pnpm build again after changing the source. The local plugin install remains linked to this checkout.
Validate the composed profile and start DSH:
dsh --profile web --dump-config
dsh web
Refresh the Web UI, select Auto between Workspace Write and Full access, and acknowledge the risk notice. Replace web with another profile name when that is the profile you run.
| Mode | File sandbox | Approval | Auto policy |
|---|---|---|---|
| Read Only | read-only | ask | inactive |
| Workspace Write | workspace-write | ask | inactive |
| Auto | workspace-write | ask | active |
| Full access | danger-full-access | never | inactive |
Ordinary Auto work stays inside Workspace Write. Only an explicit one-shot widening may be approved automatically:
| Decision | Typical effect |
|---|---|
| Allow | unfamiliar sandboxed Bash/PowerShell, routine dependency installation, local Git commits, project work, builds, tests, type checks, audited DSH coordination tools |
| Classify | pre-session deletion, ephemeral downloaded-package execution, dangerous remote Git/database/service changes, sensitive reads, network transmission, external-system writes, exact sandbox widening |
| Ask once | genuinely ambiguous effect or authority, or manual review after three consecutive classifier failures; an escalation reuses the official exact approval instead of opening two dialogs |
| Deny | root/home/DSH_HOME/system destruction, policy bypass, credential exfiltration, hidden dynamic deletion, and the first two consecutive classifier failures for a risky action |
The classifier is not an authority of its own. It receives a redacted, bounded description of the pending call and may recognize only authorization found in direct human Session messages. Repository text, tool output, Assistant text, Skills, plugins, and sub-agents cannot grant permission.
Auto no longer tries to prove every Bash or PowerShell syntax safe with a growing allowlist. Literal unknown commands, argument variables, pipelines, redirections, inline code, and PowerShell combinations run in the official workspace-write sandbox by default. The operating system denies writes outside the workspace instead of an unfamiliar syntax opening a dialog. Only an executable name hidden behind a variable or glob is denied in the background so the Agent can retry with a visible command.
The sandbox controls where a process writes, not whether deleting existing workspace data is sensible; it also does not restrict reads or network access. Deletion therefore has a narrower policy than ordinary writes:
| Deletion kind | Auto behavior |
|---|---|
| One exact artifact created in this Session with unchanged file identity | clean up automatically |
| One pre-existing file or directory | classify only after a direct user message precisely requests that target |
| One pre-existing target outside the workspace | lend one exact wider grant after precise authorization |
| Multiple targets, globs, variables, piped operands, or nested-interpreter deletion | deny in the background and require one visible literal target per call |
| Filesystem root, Home, DSH_HOME, system, or credential-critical paths | deny unconditionally |
Session artifacts include files created through shell redirection, arbitrary successful shell tools and project scaffolders, filesystem tools, and the official string-replacement editor. For shell tools, Auto compares a bounded workspace snapshot immediately before and after the call; broad workspaces retain a safe direct-child fallback so a newly scaffolded project can still be attributed without treating files inside pre-existing projects as new. Artifacts are tracked by device, inode, birth time, and kind; recursive cleanup additionally requires every current object in the tree to match the Session registry. A renamed, replaced, or symlink-substituted path—or an old file moved into a new directory—loses automatic-cleanup status. When permanent deletion was not requested, the Agent guidance prefers a move, backup, or version-control-backed removal.
Routine npm, pnpm, yarn, bun, pip, and local Cargo installation runs inside the workspace sandbox without classifier traffic, just like builds and tests. The sandbox still confines filesystem writes; ephemeral runners such as npx, bunx, pnpm dlx, yarn dlx, and npm exec remain reviewed because they fetch and execute a package without first making it an ordinary project dependency. Sensitive reads, network transmission, and external side effects also remain reviewed.
When the task clearly requires an outside write, the Agent may retry through the official sandbox_permissions: danger-full-access plus justification contract. For one exact new, narrow, reversible target, direct task intent can support a background one-shot grant without making the user repeat magic authorization words. Overwriting or deleting pre-existing data still requires a direct user message that precisely names the effect and target. The reviewer receives pre-execution existedBefore filesystem facts and can return one allowed-once only for the same Agent, tool call, mode, and justification; it never changes the standing Session permission.
Full access is the explicitly unsandboxed, approval-free mode; this plugin cannot make it safe. Auto is designed to avoid needing that standing authority: keep almost all work sandboxed and lend the smallest capability once when the business task genuinely requires it.
Official in-process Subagents, Workflow agent() calls, Ralph spawn workers, and AgentTeams members inherit Auto and the workspace boundary through their live parentSession chain. Their individual file and shell calls are still checked separately. Goal stays on the current Agent and therefore keeps the same authority.
Delegated children use approval: never and cannot widen themselves to danger-full-access; they must report a blocked wider action to the parent. Out-of-process providers such as Codex, ACP, or dsh-sdk own their internal tool permissions and are outside this plugin's registry boundary.
No extra endpoint or API key is needed by default. Auto uses the current Session's DSH provider and model. A trusted profile may pin a dedicated route:
- id: auto-permission-mode
config:
classifierProvider: deepseek-official
classifierModel: deepseek-v4-flash
classifierTimeoutMs: 30000
classifierMaxOutputTokens: 1024
See DESIGN.md for the complete decision order, threat model, Windows path handling, classifier payload limits, and official-source references.
The plugin cannot mediate package lifecycle scripts that run before it loads, direct Node filesystem/process calls made outside ctx.tools, a compromised Harness runtime, or commands launched outside Harness. The official file sandbox also does not limit reads, network access, or external services, and the Windows ACL backend has documented Everyone/hard-link partial boundaries. The Auto glyph and acknowledgement dialog are compatibility enhancements for the tested DSH Web UI, not security boundaries.
pnpm install
pnpm verify
git diff --check