dsh-multi-workspace: Mounting Multiple Writable Roots for DSH Agent with Per-Root Read, Write, Delete, and Move Capabilities

Introduction

DeepSeek Harness (DSH) ships with only one workspace by default. Writing files in another project gets blocked by the fence with a message like [sandbox: file access denied under workspace-write mode]. The kernel already has the underlying “multi-root” capability — what’s missing is a user-facing entry point and per-path granular permissions.

dsh-multi-workspace adds additional writable roots for the DSH Agent, with each root carrying independent “read / write / delete / move” capability bits. Every allow and deny decision is written to a JSONL audit log. The panel translates the boundary into a plain-English sentence — for example, “This root has write permission but no delete permission; .env was blocked by the sensitive denylist” — so you can judge whether the boundary is reasonable without digging through logs.

Plugin Positioning

  • Plugin Name: dsh-multi-workspace
  • Maintainer: David-Martinez-worldexecute
  • Category: admin-security
  • Description: DSH plugin: declarative writable-root fence for the agent — per-capability roots, audit log, in-chat panel
  • License: MIT
  • Dependencies: Node ≥ 20.0.0, DSH ≥ 0.2.2-rc.3

Core Features

Per-Root Read/Write/Delete/Move Capabilities

  • Each writable root carries four capability bits (read/write/delete/move) plus an ro read-only flag
  • Supports glob sub-rules include/exclude within a root for fine-grained path control
  • Sensitive denylist takes precedence over root matching — a hit is an immediate deny

Three-Layer Architecture

  1. Rules layer: This project owns the multi-workspace line in the profile (roots / shell / sensitive / audit)
  2. Authorization layer: DSH owns the profile’s additionalWritableRoots (tells the sandbox “these directories are writable”)
  3. Execution layer: DSH owns the file sandbox and ACL runner (this project does not modify a single line)

sync only does “write the roots computed by the rules layer into the authorization layer,” and the entire line must be restated (DSH’s patch is a whole-line replacement — writing just one key would drop mode/workspaceRoot).

Rules Format Example

roots:
  - path: D:\work\proj-a
    capabilities: [read, write, delete, move]
    mode: rw
  - path: D:\work\proj-a\secret
    capabilities: [read]          # Sub-directory read-only: longest prefix wins, not overridden by the parent root above
  - path: E:\scratch
    capabilities: [read, write]
    mode: rw
    expiresAt: 1767225600000      # Temporary grant, denied after expiry
shell:
  mode: deny                      # deny (default) / allowlist
  allowlist: []                   # Only exact command match, no prefix matching
sensitive:
  deny: ['.env', '*.pem', 'id_rsa', '.ssh/**', '.dsh/**']
audit:
  enabled: true
  file: .dsh/multi-workspace-audit.jsonl

Audit & Panel

  • Every allow/deny is logged to the JSONL audit file, with rotation at 5 MB
  • The panel sits to the left of the session input box — click to open; view rules, status, and recent audit entries

Installation & Activation

Install command (from README):

npx -y @deepseek-ai/dsh plugin --profile desktop add dsh-multi-workspace

Restart DSH to take effect — a “Roots N” pill appearing to the left of the session input box confirms successful installation.

See README §6 Installation for local development and rollback.

Typical Usage

Local Console (Zero Dependencies)

node bin/mw.mjs list
node bin/mw.mjs add "D:\work\proj-a" --caps read,write --mode rw
node bin/mw.mjs add "E:\scratch" --caps read --expires 1767225600000
node bin/mw.mjs remove "E:\scratch"
node bin/mw.mjs validate "D:\work\proj-a"      # Validate only, no write
node bin/mw.mjs probe "D:\work\proj-a"         # Actually write a temp file then delete
node bin/mw.mjs diff                            # How far apart rules layer vs authorization layer
node bin/mw.mjs status

Rules are preferentially written into the profile’s config line; if that fails, they fall back to the workspace file .dsh/multi-workspace-rules.json (the panel will explicitly state where it landed this time). diff reads the profile’s cordis.patch.yml; if additionalWritableRoots is not found, it honestly says “this section does not exist” rather than pretending “already in sync.”

Installed in DSH (Agent Uses the workspace_roots Tool)

Tool name workspace_roots — one entry point, multiple actions:

{ "action": "list" }
{ "action": "add", "path": "D:\\work\\proj-a", "capabilities": ["read","write"], "mode": "rw" }
{ "action": "add", "path": "E:\\scratch", "expiresAt": 1767225600000 }
{ "action": "remove", "path": "E:\\scratch" }
{ "action": "update", "path": "D:\\work\\proj-a", "capabilities": ["read"] }
{ "action": "validate", "path": "D:\\work\\proj-a" }
{ "action": "probe", "path": "D:\\work\\proj-a" }
{ "action": "status" }
{ "action": "sync", "dryRun": true }
{ "action": "audit", "limit": 20 }
{ "action": "evaluate", "toolName": "write", "argsJson": "{\"file_path\":\"D:\\\\work\\\\proj-a\\\\x.txt\"}" }
{ "action": "doctor" }
{ "action": "undo" }
{ "action": "export" }
{ "action": "import", "json": "{\"version\":2,\"roots\":[...]}" }
{ "action": "session-add", "path": "E:\\scratch", "sessionId": "<session id>", "ttlMinutes": 60 }
{ "action": "session-list", "sessionId": "<session id>" }
{ "action": "session-remove", "path": "E:\\scratch", "sessionId": "<session id>" }
  • add/remove/update/sync/probe are mutating actions and require approval by default; if no approval channel is available, they return APPROVAL_UNAVAILABLE and deny (fail closed — never default to allow)
  • Return values always include subprocessHonored: false with a plain-English note, so the model doesn’t assume pwsh also recognizes these directories
  • Read is not enforced by default (enforceRead: false)
  • evaluate judges without executing: given a tool name + args, it answers “would this be allowed?” — useful for debugging “why was this write denied?”
  • session-* actions manage session-scoped temporary roots

Applicable Scenarios & Cautions

  • Suited for scenarios requiring multiple writable directories for the DSH Agent with per-root read/write/delete/move capability control
  • Review the source code and license before installing
  • The plugin runs with the current DSH process privileges

Boundaries & Security

  • File tools (write / edit / patch / delete / move / ops_* / Office) recognize additional roots
  • pwsh / bash subprocesses do NOT recognize additional roots — only the workspace + private temp (DSH 0.2.2-rc.3 limitation)
  • Read access is fully open by default; this project only governs writes

Summary

dsh-multi-workspace adds extra writable roots to the DSH Agent, provides per-root read/write/delete/move capability control, JSONL audit logging, and a readable panel — turning “the Agent can write to your files, and you can see at a glance what it just touched and who authorized it” into a verifiable fact.

  • Directory page: https://www.skillhub.cn/plugins/David-Martinez-worldexecute/dsh-multi-workspace
  • GitHub: https://github.com/David-Martinez-worldexecute/dsh-multi-workspace
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye