dsh-workspace-capability: Tightening Skill and MCP Visibility Scope per Workspace

Introduction

In DeepSeek Harness (DSH), Skills and user-level MCPs are often installed globally or bundled into presets. When multiple projects share a DSH environment, the set of capabilities visible to the model within a single session typically does not automatically narrow down when switching “current open workspaces.” While Standard / PTC / Minimal / Create and other presets need to remain usable, you may also need to expose only a subset of Skills in a specific repository or only open specified MCP server namespaces. Relying solely on preset switching is often not granular enough and may not cover sessions that existed before the plugin was installed.

dsh-workspace-capability, released by maintainer versot (categorized in the community directory as admin-security), addresses the above issue: each workspace declares capability visibility via a YAML file and manages it via a panel. The filtering logic applies to all presets and existing sessions.

What is this

In a nutshell: dsh-workspace-capability is a per-workspace capability visibility plugin for DSH, constraining both the Skill directory scanning results and the tool namespaces of the entire MCP server.

  • Maintainer: versot
  • License: MIT (package.json / README)
  • Runtime requirement: DSH >= 0.2.2-rc.3 (engines.dsh); lower versions will refuse installation
  • Code and documentation: GitHub Repository

A common practice in the DSH ecosystem is “everything is a plugin”; plugin indices are indexed by community sites (e.g., SkillHub entry) and have no official affiliation with DeepSeek or Hyperscience. It is still recommended to review the source code and license before installation—the plugin runs under the DSH process permissions, and the marketplace marks it as a user-review-required elevated capability (read/write workspace files, same-origin Web API).

Core Features

Workspace-Level Policy File

Visibility is defined by .dsh/capability-scope.yml under each workspace root (see “Workspace Root Determination” below). If the file does not exist, the behavior is consistent with the unrestricted Standard preset: all Skills are available.

Configuration fields (excerpted from README):

projectSkills: true    # <workspace>/.dsh/skills and <workspace>/.agents/skills
userSkills: false      # ~/.dsh/skills and ~/.agents/skills
bundled: true          # Built-in Skills in DSH
allow: []              # Non-empty means allowlist; only these <skill-name>
deny: []               # Hide these <skill-name>
include: []            # Retain these <skill-name> even when groups are closed
mcpServers: [<server-name>]  # Whole server allowlist; omit means all MCP

Priority: deny → include → allow (if non-empty) → group switches. For example, to disable user-level Skills but keep one: userSkills: false and include: [<skill-name>].

mcpServers controls at the full server level: <server-name> represents all mcp__<server-name>__* tools under that namespace and cannot be configured at a single tool granularity. Omitting the field means allowing all current and future MCPs; [] means exposing no MCP tools. Changing Skills or MCPs independently keeps the other side unaffected by this file.

No need to restart DSH after modifying the YAML: the provider polls the file approximately every 1.5 seconds; saving via the panel immediately invalidates the cache. MCP-side changes take effect on the next model request and do not interrupt the currently executing turn.

Cross-Preset and Session Generations

The plugin wraps the shared skills service (list / snapshot / get) via filter.js, ensuring the policy applies to any preset and sessions created before the plugin was installed. The README notes that sessions bind to a preset upon creation and do not re-evaluate, so the filtering layer is the only mechanism that can reach old sessions.

Narrowing Sub-Agent Capabilities

The plugin adds the subagent_with_skills tool. When a parent Agent uses it to create a sub-Agent, the optional skills parameter acts as an allowlist. The sub-Agent’s final directory is:

Skills visible to the parent Agent under the current workspace strategy ∩ Explicit skills allowlist

Validation is based on the parent Agent’s currently visible directory; unknown names or names hidden by the workspace strategy are rejected directly and not silently ignored.

  • Omit skills: Inherit all Skills visible to the parent Agent
  • skills: []: Zero Skills for the sub-Agent
  • Non-empty array: Only expose the intersection mentioned above
  • Optional mcpServers has similar semantics (omit = inherit, [] = none, [name...] = list); policy is written to .dsh/agent-scopes.json

The README explicitly states: this is capability visibility restriction, not a security sandbox; callers that can modify or delete .dsh/agent-scopes.json can bypass the restriction; forking may also retain Skill content already loaded in the conversation.

Panel

Clicking “⋯” on a session row → Workspace Capability Scope… opens the check-box panel: Skill groups/items and individual MCP server checkboxes, backed by reading and writing the same YAML. When saving, a temporary file in the same directory is used followed by a rename to replace (the replace semantics have only been verified on macOS). After saving, the mounted provider is refreshed and the panel is closed; configured but currently disconnected MCPs are still displayed as offline to prevent accidental saves from losing configuration.

The API and panel report skillFilterInstalled and mcpFilterInstalled; filterInstalled remains a compatible alias for the Skill filter.

Installation and Activation

Install under a specified profile (commands from README, do not concatenate the repository name yourself):

dsh plugin --profile <profile> add github:versot/dsh-workspace-capability

Confirm that the profile’s dsh.profile.bundles includes this package (the plugin manager usually writes it), then restart DSH.

Install from a local package:

dsh plugin --profile <profile> add ./dsh-workspace-capability-<version>.tgz

Node side requires >= 22.12.0. The only runtime dependency is yaml@^2.9.0.

Typical Usage

1. Default to not exposing user-level Skills in new repositories, using only project and built-in Skills

Create .dsh/capability-scope.yml in the workspace:

projectSkills: true
userSkills: false
bundled: true
allow: []
deny: []
include: []

2. Allowlist mode, only open Skills with clear names

projectSkills: false
userSkills: false
bundled: false
allow: ["my-deploy-skill", "my-review-skill"]
deny: []
include: []

3. Disable the user-level group but keep one exception Skill

userSkills: false
include: ["shared-style-guide"]

4. Only allow specific MCP servers

mcpServers: ["filesystem", "github"]

5. Sub-Agent with only partial Skills

When the parent Agent calls subagent_with_skills, pass skills: ["code-search"] (must be a name still visible to the parent Agent under the workspace strategy).

Workspace Root Determination: Search upwards for the nearest directory containing .git, .dsh/capability-scope.yml, .dsh/skills, or .agents/skills. Nested workspaces inherit the outer policy if they do not have a custom marker.

Use Cases and Considerations

Who is it for

  • Multiple repositories sharing one DSH, needing to restrict Skill sources (project / user / built-in) or MCP exposure per project
  • Needing to impose visibility on historical sessions without changing presets
  • Needing to narrow Skills/MCP further via Sub-Agents (still visibility control, not isolation)

Permissions and Failure Behavior (Summary from README)

Capability Purpose
Read files Scan Skill directories, read only SKILL.md frontmatter
Write files capability-scope.yml, agent-scopes.json
Network Only DSH webServer same-origin prefix /dsh-workspace-capability, no outbound telemetry
Session data Read-only parsing of session → workspace path, credentials are not persisted

When workspace discovery fails, it fails open. When the policy file exists but is corrupted or unreadable, it fails closed (zero Skills). If sub-policy writing fails, the old file is retained and the sub-Agent is not started. .dsh/agent-scopes.json should move with the workspace; if deleted, the plugin cannot distinguish between “never restricted” and “record lost,” and the related Agent will return to the normal workspace directory after restart.

Upgrade and UI Caveat

The filtering implementation wraps internal services rather than stable extension points; a DSH upgrade may cause filtering to fail. In such cases, the panel will display skillFilterInstalled: false or mcpFilterInstalled: false instead of silently pretending filtering is still active. The panel menu relies on the 0.2.x slots sidebar.workspaces.session.menu.item and shell.overlay; on older builds filtering may still work, but there will be no menu entry.

Conclusion

dsh-workspace-capability consolidates “which Skills and which MCP servers are allowed for the current workspace” into a single .dsh/capability-scope.yml. It uses a service-layer filter to apply this logic across all presets and existing sessions, and puts the same set of policies into daily operations via the panel and Sub-Agent parameters. If you are maintaining a multi-project DSH environment and want to enforce admin-security-like constraints at the repository boundary, start with the installation command and field descriptions from the official README, then fill in the YAML according to your projects.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye