In DSH agent development, when a session is in danger-full-access mode, the model often sends an empty justification or reiterates the current mode. This can cause validation errors. This plugin fixes two related bugs in pwsh, bash, fs, and dsh-sandbox.

Core Functionality

This plugin resolves the above issues through a two-layer defense mechanism:

  1. Schema description updates: Optimizes field descriptions to reduce the model’s tendency to send empty values or redundant requests.
  2. Runtime normalization: Adds logic at tool execution or policy parsing entry points. If the requested mode is not strictly wider than the current mode, invalid escalation parameters are automatically cleaned up.

The plugin automatically detects and modifies the DSH_HOME and desktop installation directories to ensure the patch takes effect.

Installation

Install the plugin using the official command:

dsh plugin --profile web add dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix@latest

After installation, the plugin automatically applies the patch on first load.

Uninstallation and Restoration

To uninstall this plugin, first restore the original files, then remove the plugin:

Step 1: Enter the plugin directory and run the restore script:

cd $env:DSH_HOME\profiles\web\node_modules\dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix
node scripts/patch.js restore

This command uses the backup files to restore dsh-sandbox, dsh-tool-pwsh, dsh-tool-bash, and dsh-tool-fs to their original state. Backups are stored in $env:DSH_HOME\backups\dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix\ and are unaffected by plugin removal.

Step 2: Remove the plugin:

dsh plugin --profile web remove dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix

Applicable Scenarios and Notes

  • Applicable scenarios: All scenarios that use non-default models and where the session may enter danger-full-access mode.
  • Notes: The plugin runs with the permissions of the current DSH process and modifies tool implementation files. It is recommended to review the source code and license (MIT) before installation.

This plugin is compatible with the latest dsh-std plugin meta-protocol and will not conflict with other plugins.