dsh-approval-explainer: Explaining Command Meaning and Risks Using Model Inference Alongside the DSH Approval Popup

Preface

In DeepSeek Harness (dsh), when the model wants to perform an operation outside the workspace, the host pops up an approval dialog that usually shows only a single line of the command about to run. You have to infer on your own what it does, which paths it will touch, and what “Approve once” or “Deny” each mean; when you can’t understand it, you often end up choosing between blindly trusting and blindly denying.

The community plugin dsh-approval-explainer (maintainer ArisuYuuko, category admin-security) appends an explanation generated by model reasoning inside the same dialog: what the code is doing, what the model intends to achieve, the risk level and its reasoning, and an explanation of what each button means — making it easier to make decisions with evidence. The DSH ecosystem advocates “everything is a plugin”; the plugin directory site SkillHub is a community site with no official affiliation with DeepSeek / High-Flyer.

What is this

dsh-approval-explainer is an AI annotator for the DSH approval dialog: only when the model requests an operation outside its permissions and triggers a real approval, it uses the LLM in the session to generate an explanation in the background and renders it into the approval details area on the browser side. It does not rewrite approval policies; it only observes the approval/request waterfall and supplements readable information.

Core Features

Annotation content on the dialog

Without the plugin installed, the approval prompt may look like this:

即将执行
& '<temp>\diagnose-windows-sandbox-acl.ps1' -Path 'D:\some-project' -AllowRewrite

After installation, the same dialog will additionally show a structured explanation, such as risk level, what the code does, the model’s intent, the reasoning behind the risk assessment, recommendations, and the actual consequences of each option (whether files will really be written, how the model will be notified after a denial, etc.). The README emphasizes: the annotation explains that “Approve once” is not merely “the command will run”, but also includes decision-relevant information such as whether files will actually be written to disk and whether other writes under the same authorization are also covered.

Key point Description
Real approvals only Does not annotate regular tool calls; the README gives a measurement example with 2 approval/request events and 259 tools/pre-execute events — annotating everything would equal having no signal
Non-blocking Generated in the background; the dialog appears immediately; generation failure or timeout does not affect what you can approve
Failures are visible When generation fails, the reason is shown in the panel rather than silently hanging
Parameters come from the session approval/request does not carry tool arguments; the plugin looks up tool/call by callId in the session log; if not found, it says so truthfully instead of fabricating
Prompt-injection protection The system prompt treats code, paths, and commands as data rather than instructions
No policy changes Only observes the approval waterfall; does not decide who can be authorized

Approval history

Every real escalation is recorded and can be accessed via a local web port:

http://127.0.0.1:<dsh-web-port>/dsh-approval/history

Since v0.9.0, the browser half adds an Approval history button in the Session header actions row (same level as Conversation / Trajectory, slot conversation.session.header.actions); clicking it opens the page above in a new tab.

Installation and Activation

The profile used by the desktop client is generally desktop. Installation command (from the repository README):

dsh plugin --profile desktop add github:ArisuYuuko/dsh-approval-explainer

Using a profile for the first time initializes that profile. After installation you must fully exit and reopen DSH; merely refreshing the page is not enough, because the host half only loads at process startup.

Verify whether the config layer is active:

dsh --profile desktop --dump-config

You should see a fragment like this:

# == dsh-approval-explainer
- id: dsh-approval-explainer
  name: dsh-approval-explainer
  inject:
    - llm
    - approval

The plugin is pure JavaScript with no build step, so the README notes that no additional pnpm authorization for allowBuilds is normally needed.

Uninstall (including the config layer):

dsh plugin --profile desktop remove dsh-approval-explainer

package.json declares the engine requirement as dsh version >=0.2.0-rc.1 <0.3.0-0, license MIT; the npm package version in the current material is 0.9.4.

Typical Usage

  1. Install the plugin for the desktop profile using the command above and restart DSH.
  2. In a conversation, have the model perform an operation that requires permissions outside the workspace (e.g., writing to a path outside the workspace, requesting danger-full-access, etc.) to trigger the DSH standard approval dialog.
  3. Below the command line, read the annotation generated by the plugin (risk, intent, button meanings), then choose Approve once or Deny.
  4. To review past escalations, click Approval history in the Session header, or visit http://127.0.0.1:<dsh-web-port>/dsh-approval/history.

Annotations are generated asynchronously in the background, so the dialog appears first; if the LLM has not returned yet, you can wait a moment for the panel to update, or troubleshoot using the failure prompt (this does not affect whether you have approval permissions).

Implementation Highlights (for Troubleshooting)

The plugin is a DSH bundle: the npm package carries cordis.patch.yml, contributing a config layer to the profile; dsh plugin add installs the package and appends it to dsh.profile.bundles.

  • lib/index.js (Node host): listens to approval/request, calls the LLM in the background to generate annotations, caches them, and provides 8 HTTP routes.
  • lib/client.js (web browser): registers the conversation.approval.detail slot, rendering command and annotation cards; it must override the official UI’s priority: 0 with a lower priority (e.g., -1).

The README lists two hard constraints: the host must not inject the client script itself again (this would cause web startup failure and DSH self-healing to wipe the config); the host’s apply() must not throw, otherwise “DSH won’t start after installation” may occur.

Use Cases and Caveats

Suitable for: developers who frequently approve shell, file, and permission escalations in DSH, and who want to see verifiable risk and intent explanations during the human-in-the-loop step rather than a single command line.

Caveats:

  • The plugin runs with the current dsh process privileges and sends session-related context to the LLM to generate annotations; before installing, you should read the source code and the MIT license to confirm it meets your security policy.
  • Annotations are auxiliary information and cannot replace your review of commands and paths; policies are still determined by DSH itself.
  • Statistics such as stars on the community directory page are subject to what the site displays; the GitHub repository’s star count in the current material is 0.

Conclusion

dsh-approval-explainer expands the approval dialog from “one command line + two buttons” into an explanation with risk, intent, and option meanings, and deliberately does not block or tamper with the approval outcome. If you frequently encounter operations outside permissions in desktop DSH, you can install it into the desktop profile per the README and try it after fully restarting.

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

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

Xiaoye