The DeepSeek Harness (DSH) ecosystem emphasizes modularity and permission isolation. In multi-agent collaboration scenarios, reusing agents with specific capabilities while strictly controlling their permissions is a common requirement. The dsh-preset-agent-manager plugin elevates “preset agents” to first-class citizens in DSH. It provides a visual sidebar management panel and the preset_agent_dispatch tool, allowing the main agent to delegate tasks during a conversation. Each preset agent has an independent plugin whitelist and tool whitelist, and sub-sessions run in isolated environments to ensure the safety of the main session.

Core Features

  • Sidebar Management Panel: Located at the bottom of the DSH sidebar, it provides a full-screen management interface. It supports creating, editing, and deleting preset agents. Deletion requires double confirmation and displays the number of currently active sub-sessions.
  • Strict Whitelist Mechanism: Supports plugin and tool whitelists. The whitelist logic has two layers: an inheritance-layer mask (toolFilter.allow) and a self-layer guard (tools.guard), ensuring that sub-sessions can only invoke tools that have been explicitly checked.
  • Model Tools:
    • preset_agent_dispatch(agent_id, task): The main agent invokes this tool to delegate a task to a preset agent.
    • preset_agent_admin(action, …): Used for operations that manage preset agents.
  • Persistent Storage: Configuration data is saved in $DSH_HOME/data/dsh-preset-agent-manager/agents.json. Files are written atomically using a “temp file + rename” strategy, and corrupted files are automatically moved aside with a .corrupt suffix.

Installation and Enablement

Method 1: Standard Installation (requires pnpm)

This plugin declares dsh.bundle.patch, and after successful installation it will be automatically added to the profile’s dsh.profile.bundles configuration.

dsh plugin --profile web add file:$env:USERPROFILE\.dsh\plugins\dsh-preset-agent-manager

Note: dsh plugin is a thin pnpm forwarder. If it reports pnpm not found on PATH, please run corepack enable pnpm or install pnpm globally first. After modifying the profile configuration, restart the profile to apply the changes.

Method 2: Manual Installation (without pnpm)

If pnpm is not available, you need to manually place the plugin files into the profile’s resolution path and append the patch-layer configuration.

# 1. 放入 profile 的解析路径(Node 从 profile 目录向上查找 node_modules)
$dst = "$env:DSH_HOME\profiles\web\node_modules\dsh-preset-agent-manager"
New-Item -ItemType Directory -Force $dst | Out-Null
Copy-Item "$env:USERPROFILE\.dsh\plugins\dsh-preset-agent-manager\*" $dst -Recurse -Force

# 2. 激活:把下面 4 行追加到 profile 的 patch 层
#    (该 profile 声明了 patchReload: live,正常情况无需重启)
- insert:
    - id: preset-agent-manager
      name: 'dsh-preset-agent-manager'
      config:
        rev: '16'

Usage

  1. Open the Panel: Click ⚉ Preset Agents at the bottom of the DSH sidebar to open the management panel. The panel adapts to the viewport.
  2. Create a Preset Agent: Fill in the id, name, description (trigger domain), and persona. Check the allowed plugins (plugin whitelist) and tools (tool whitelist). Once saved, it can be used.
  3. Task Delegation: The main agent invokes the preset_agent_dispatch tool during the conversation.
{ "agent_id": "log-tracer", "task": "自包含的任务描述" }

The invocation returns fields such as status (success / partial / failed), output, tool_allow, warnings, error, startup_ms, duration_ms, and session_id.

Mechanisms and Limitations

  • Delegation Depth Limit: The plugin sets maxDepth: 1, meaning a preset agent cannot delegate to another agent again, which prevents infinite recursion. Whitelists and the scope guard provide additional security guarantees.
  • Whitelist Enforcement Logic:
    • Inheritance-Layer Mask: toolFilter.allow filters the tools inherited by the sub-session (global layer + parent layer), keeping only the tools in the whitelist.
    • Self-Layer Guard: Because the sub-session’s own scope may include special tools such as subagent, the host registers tools.guard immediately after the sub-session is published, intercepting tool calls that are not in the whitelist.
  • Concurrency Safety: preset_agent_dispatch declares isConcurrencySafe: () => true, so multiple delegations to the same preset agent run independently and do not interfere with each other.
  • Known Limitations: Without pnpm, the bare package name form of dsh plugin add cannot be used; preset agents are not agent presets and therefore cannot inherit tools exclusive to preset entries.

Data Format

The preset agent configuration is saved in $DSH_HOME/data/dsh-preset-agent-manager/agents.json. The structure is as follows:

{
  "version": 1,
  "agents": [
    {
      "id": "log-tracer",
      "name": "日志追踪器",
      "description": "排查日志、慢查询、错误堆栈",
      "persona": "你是一个专业的日志分析专家……",
      "pluginWhitelist": ["@deepseek-ai/dsh-tool-fs"],
      "toolWhitelist": ["read", "grep"],
      "createdAt": "2026-09-15T10:00:00.000Z",
      "updatedAt": "2026-09-15T10:00:00.000Z"
    }
  ]
}

Summary

dsh-preset-agent-manager addresses the permission control and reuse challenges in agent delegation within DSH through a visual sidebar and strict tool/plugin whitelists. Developers can implement task routing with a simple JSON call while maintaining isolation and security for the main agent environment.

  • Plugin Directory: https://www.skillhub.cn/plugins/qingli-sketch/dsh-preset-agent-manager
  • GitHub Repository: https://github.com/qingli-sketch/dsh-preset-agent-manager