Preface

DeepSeek Harness’s core design philosophy is “everything is a plugin.” When local code-execution capabilities need to be introduced into an agent chain, calling remote APIs directly may introduce latency or privacy concerns. This article introduces dsh-subagent-cursor, a plugin that runs Cursor as a subagent and provides local one-shot task execution capabilities.

Plugin Overview

dsh-subagent-cursor is a Cursor-as-subagent provider plugin for DeepSeek Harness. It registers a provider, named cursor by default, to ctx.subagents. Each run is a local one-shot Cursor task under the parent session’s cwd: the subagent comes with a full set of agent tools (read/write files, run shell commands, fetch web documents, etc., boundaries determined by the permission set), independently completes a one-time task, and returns.

Core Features

This plugin provides the following core capabilities:
* Provider registration: Registers a provider to ctx.subagents (default name cursor).
* Local one-shot execution: Runs in the current directory of the parent session and cleans up the context after task completion.
* Summary-first results: Displays a summary and supporting evidence, allowing the parent agent to quickly obtain conclusions.
* Profile Bundle support: Belongs to the official family and supports unattended configuration.
* Dual driver modes: Uses driver: cli by default and reuses CLI login state without a Key; optionally uses driver: sdk, which requires a Key.
* Automatic permission management: autoPermissions is enabled by default and automatically generates or appends a Cursor CLI permission set.
* Command approval level configuration: Supports balanced (default), trusted (automatically allowed), and strict (hard whitelist).

Installation and Activation

Add the plugin using the official installation command:

dsh plugin add dsh-subagent-cursor

After installation, the plugin registers a ctx.subagents provider. To enable it, mount the package in the Profile Bundle configuration. The plugin ships with the correct tool line (tool-subagent-cursor), so no manual authoring is required.

Profile Bundle configuration example:

# profile package.json → dsh.profile.bundles
- package: dsh-subagent-cursor

Configuration and Notes

The plugin supports multiple configuration items to control execution behavior and permission policy.

Main configuration options:
* providerName: The provider name registered on ctx.subagents (default cursor).
* driver: The execution backend, cli (default, no Key required) or sdk (Key required).
* model: The Cursor model ID passed to the driver (default auto).
* env: Explicit environment variables, used as an overlay.
* cliPath: The CLI executable path (default cursor-agent).
* timeoutMs: Upper limit for a single run (default 600000 ms).
* disposeGraceMs: Grace period for shutdown waiting (default 3000 ms).
* autoPermissions: Pre-generate the permission set when mounted (default true).
* approvalLevel: Command approval level (default balanced).

Important limitations and notes:
1. Driver dependencies:
* driver: cli mode requires cursor-agent to be installed and logged in locally (run cursor-agent login); no API Key is required.
* driver: sdk mode requires the environment variable CURSOR_API_KEY to be set.
2. Tool line contract:
* When customizing a dsh-tool-subagent line, maxDepth must be set to provider-managed; it must not be set to a number (otherwise mounting fails).
* Do not set backgroundMode: continuable. Cursor runs are one-shot and do not support session continuation.
3. Permission management:
* autoPermissions defaults to true; a permission set is automatically generated or appended when mounted, and sensitive items are denied by default.
4. Approval levels:
* balanced: For items outside the whitelist, an authorization prompt is shown.
* trusted: Commands are allowed automatically without a prompt.
* strict: Hard whitelist only; no prompt and no automatic allowance.

Suitable Scenarios

This plugin is suitable for scenarios where local Cursor capabilities need to be embedded into a DSH agent chain and execution context and permissions need to be strictly controlled. Because it is local one-shot execution, the context is cleaned up after task completion, making it suitable for one-time code review, file generation, or simple script execution.

Conclusion

dsh-subagent-cursor provides a way to directly invoke local Cursor capabilities within DeepSeek Harness. Through Profile Bundle mounting and permission control, it creates a relatively safe and independent subagent execution environment.