dsh-fs-allowlist: Write to allowlisted directories without approval

Preface

When using write / edit in DeepSeek Harness (DSH) to modify files outside the workspace, the usual path is: sandbox denies → model retries with escalation → a human approval prompt. If you frequently write notes into an Obsidian vault, or let bash write files to a fixed directory, having to click approve at every step interrupts your flow.

dsh-fs-allowlist addresses this need: after adding specified directories to the whitelist, writes/edits to those paths pass directly; bash escalations that hit the whitelist can also be automatically answered with allowed-once. Behavior for all other paths remains the same as without the plugin installed. Below we explain what it does, how to install it, and how to configure it.

What is this

dsh-fs-allowlist is a community-maintained DSH plugin (maintainer wzn16, repo wzn16/dsh-fs-allowlist). In one sentence: on top of DSH’s default sandbox, it opens approval-free writes for configured directory roots, and provides a settings page to manage the whitelist.

The plugin’s current version is 0.3.0 (see package.json in the repo), license MIT. Directory page: skillhub.cn/plugins/wzn16/dsh-fs-allowlist. SkillHub and other community directories have no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem itself follows an “everything is a plugin” philosophy, and this plugin is one permission-extension path within it.

Core features

The capabilities in the documentation fall into three layers; you can use the table below to understand the coverage:

Layer Mechanism Coverage
write/edit tools wraps the ctx.fs.checkedTarget fence; whitelisted paths pass early read/write to whitelist roots without approval
bash commands tools/pre-execute indexes command text; approval/request auto-answers allowed-once when the command or escalation reason hits the whitelist bash writes related to whitelisted paths without approval (matches command text first; if not matched, still requires manual approval)
Settings GUI settings.plugins.tab block + server-side HTTP admin route visually add/remove directories, toggle bash auto-approval

Configuration is hot-reloaded: changes in the GUI take effect immediately; manually editing the config file takes effect within about 3 seconds, no need to restart the DSH process (installing/uninstalling the plugin itself still requires the “Restart Desktop” step described below).

write/edit layer

Every write/edit goes through ctx.fs.checkedTarget() mounted by dsh-fs-sandbox: outside the workspace it defaults to FS_SANDBOX_DENIED, then escalation and approval. This plugin wraps a layer around that fence:

  • After normalization, if the target falls inside a whitelist root → early pass (semantics consistent with the fence);
  • Otherwise (not matched, read-only mode, resolution failure) → handed to the original fence as-is.

Atomic writes, version guards, read-before-write, diff events etc. are still handled by the underlying dsh-fs-local; the plugin does not change them. Whitelist matching uses the same semantics as the fence, using realpath (deepest existing ancestor), to avoid escaping the list via symlinks.

bash layer

bash runs inside the Seatbelt process sandbox; the configuration file cannot be extended by the plugin. The plugin uses two listeners working together: tools/pre-execute records command text by callId; the approval/request responder expands ~ on path-like tokens in both the command text and the escalation reason, then recursively compares against whitelist roots (a parent directory entry covers all child paths beneath it). Most command texts include the target path, so it does not need to rely on the model writing the full path in the reason. If not matched, a manual approval prompt still appears (fail-safe); you can turn off bash auto-approval in the settings page.

Installation and activation

If you already have the plugin source directory locally, install it to the web profile:

dsh plugin --profile web add /path/to/dsh-fs-allowlist

Install from GitHub (usage after release, as given in the README):

dsh plugin --profile web add "github:wzn16/dsh-fs-allowlist#main"

The plugin is installed to $DSH_HOME/profiles/web. After installation you must restart DSH Desktop for it to take effect (refreshing the browser is not enough). The profile links to the source directory, so after modifying source code you only need to restart, no reinstall.

Rollback example:

dsh plugin --profile web remove dsh-fs-allowlist

You can also clear fs-allowlist.json and restart; behavior is the same as unconfigured.

Configuration

Default config file path: $DSH_HOME/fs-allowlist.json (macOS default example: ~/Library/Application Support/dsh-desktop/harness/fs-allowlist.json; the resolver also supports $DSH_HOME, Windows %APPDATA%, Linux XDG, and the open-source layout ~/.dsh).

Manual edit example (it is more recommended to use the Settings → Plugins → Directory Allowlist page; no need to hand-edit JSON):

{
  "extraWritableRoots": [
    "/Users/you/ObsidianVault"
  ],
  "bashAutoApprove": true
}
  • File missing, invalid JSON, or an empty list → treated as an empty whitelist; the plugin is fully transparent (equivalent to not installed), facilitating one-step rollback.
  • If bashAutoApprove is not written, it defaults to true.

Behavior comparison

Scenario Behavior
write/edit inside the workspace no approval (native, unchanged)
write/edit inside whitelist roots no approval
write/edit elsewhere deny → escalation → approval (unchanged)
write to a whitelist root in read-only mode still denied (the stricter switch takes priority)
bash touches a whitelist root (command or reason matches) auto-approve, no prompt
other bash escalation (not matched) normal approval

Typical usage

  1. Install the plugin and restart DSH Desktop.
  2. Open Settings → Plugins → Directory Allowlist, add your Obsidian vault or other fixed write roots (equivalent to extraWritableRoots).
  3. If needed, turn off bash auto-approval in the settings page; the write/edit whitelist logic is not affected by this switch (see the README behavior matrix).
  4. In a conversation, let the agent write to whitelisted paths via write/edit or bash; when hitting the list, the full chain of “sandbox denies → retry → manual approval” should no longer appear.

The repo README uses an Obsidian vault as the extraWritableRoots example path; replace it with your actual local directory.

Use cases and notes

Who it is for: those who frequently let the DSH agent write outside the workspace but to controllable directories (e.g. personal note vaults, fixed export directories), and want to reduce repetitive approval clicks.

Things you must know:

  1. A whitelist entry means the agent can write into that tree without asking; the list should be deliberately narrow.
  2. Bash auto-approval relies on path heuristics in the command text and reason; if neither contains a whitelisted path, a prompt will still appear (by design).
  3. checkedTarget is an internal seam of the distribution package; if DSH refactors in a major version, the plugin may degrade to “warn + transparent” (equivalent to not installed), and you will need to adapt per the release notes.
  4. The plugin runs with the same permissions as the DSH process; review the source code and MIT license yourself before installing.

Conclusion

dsh-fs-allowlist opens approval-free channels for write/edit and bash to a few trusted directories without changing the default sandbox policy for outside-workspace paths, and reduces maintenance cost via the settings page and hot reload. For details and English documentation, refer to the repo README.

  • Directory page: https://www.skillhub.cn/plugins/wzn16/dsh-fs-allowlist
  • GitHub: https://github.com/wzn16/dsh-fs-allowlist
羽毛球分组比赛记分
小程序二维码

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

Xiaoye