Introduction

When using AI tool calling in DSH, if permissions are only granted broadly at the session level, operations such as directory access, command execution, file read/write, and sub-agent startup are all authorized under the same tier. dsh-permgate provides a fine-grained permission control plugin for DeepSeek Harness (DSH), enabling categorized review of tool calls.

What This Is

dsh-permgate is a DSH permission control plugin, hosted at https://github.com/MrWeiCodes/dsh-permgate, licensed under MIT.

It breaks down permission review to the tool-call level: categories such as directory access, command execution, file read/edit, sub-agent startup, and repeated operations can be configured separately, and it offers approval dialogs, allow/deny lists, quick-tool defaults, custom rules, an underlying sandbox escalation flow, bilingual support (Chinese/English), and persistent configuration.

Core Features

  • Categorized review of tool calls: directory access, command execution, file read/edit, sub-agent startup, repeated operations.
  • Global / project dual-level configuration: global rules serve as the baseline, with project-specific overrides available as needed.
  • Exceptions (allow/deny lists): establish exceptions for paths and commands that are frequently allowed or explicitly denied to reduce repetitive prompts.
  • Quick-tool defaults: set default behaviors for quick tools that cannot be classified by file or command.
  • Custom rules: configure review rules based on finer-grained conditions.
  • Approval dialogs: review diffs or commands and arguments before granting permission.
  • Custom rejection notes: provide reasons or follow-up suggestions when denying.
  • Underlying sandbox escalation flow: when the underlying sandbox still blocks, an additional escalation approval is triggered.
  • Bilingual support: interface text follows the language switch.
  • Persistence: configuration is saved in the plugin directory and retained after updates.

Installation and Activation

First, run the installation command. The example uses the web profile:

dsh plugin --profile web add -w github:MrWeiCodes/dsh-permgate

After installation, select “Custom Review” in the permission selector below the input box.

If you want it enabled by default for new conversations, set “Custom Review” as the default permission for new conversations in settings.

Typical Usage

  1. Select session permission: choose “Custom Review” in the permission selector below the input box, and subsequent tool calls will go through the categorized review process.

  2. Handle approval dialogs: review diff details when editing/writing files; review commands and arguments when executing commands. If a certain type of operation is frequently allowed, you can add rule candidates with one click.

  3. Fill in rejection notes: provide custom rejection notes when denying, clearly stating the reason or alternative suggestions.

  4. Maintain permission configuration: go to “Settings → Permission Gateway” to manage default behaviors, allow/deny lists, quick tools, custom rules, and the underlying sandbox.

Configuration and Compatibility

  • Configuration is stored in $DSH_HOME/dsh-permgate/config.json. It is retained after updates and not automatically deleted upon uninstall.
  • API endpoints are under /permgate/*, including the SSE endpoint /permgate/events.
  • The settings page, quick toolbar, and dialogs use dedicated slot IDs such as permgate and permgate-approval.
  • The permission preset table in patches uses full-table overwrite semantics. Do not coexist with other patches modifying the permission configuration.
  • If other pre-execute review plugins are installed simultaneously, duplicate dialogs may appear; it is recommended to keep only one.
  • No global registry, npm global package, or system-level writes.

Applicable Scenarios and Notes

It is suitable for scenarios where manual approval of AI tool calls is needed in DSH sessions, especially when involving directory access, command execution, file read/write, sub-agent startup, or repeated operations.

Before use, note:

  • The plugin runs with the current dsh process permissions; review the source code and MIT license before installation.
  • Allow/deny lists, quick-tool defaults, and custom rules directly affect subsequent approval results; it is recommended to start with small-scope rules.
  • If no longer in use, the configuration file will not be automatically deleted; you can manually handle $DSH_HOME/dsh-permgate/.
  • Community directory page: no specific URL provided; if needed, refer to the actual standalone community directory and do not treat it as an official app store.

Conclusion

The value of dsh-permgate lies in refining DSH’s tool-call review from session-level authorization to the category, path, command, and argument level, suitable for scenarios requiring clearer boundaries for AI operations.

GitHub: https://github.com/MrWeiCodes/dsh-permgate

Directory page: no specific URL provided.