Skip to main content

dsh-sandbox-escalation-fix

13Stars1Forks0Issues0Watchers

Dynamically hide invalid sandbox upgrade parameters based on session permissions to fix the repeated upgrade failure loop for OAI models under All Access.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
TypeScript
License
MIT
Branch
main
deepseek-harnessdeepseek-harness-plugindeepseek-harness-pluginsdsh-plugindsh-pluginssandbox-escalation

Install

cmdweb profile
$ dsh plugin --profile web add github:JUSTMONIKA2022/dsh-sandbox-escalation-fix

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin JUSTMONIKA2022/dsh-sandbox-escalation-fix for me: review the repository at https://github.com/HakureiMonika/dsh-sandbox-escalation-fix first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Positioning

This is a DSH-compatible plugin that dynamically adjusts model-visible tool parameters and descriptions based on the current Session's sandbox permissions and approval policies, resolving the issue where OAI series models repeatedly trigger sandbox_permissions / justification escalation validation failures and get stuck in retry loops under All Access.

Core Capabilities

  • Dynamic Invalid Escalation Field Hiding: Based on the current Session's Sandbox Mode and Approval Policy, remove sandbox_permissions and justification parameters from the tool Schema that the model should not see
  • Precise Same-Mode Parameter Normalization: When the model sends a redundant escalation request that exactly matches the current mode, silently delete these parameters and allow the call to proceed as normal; other requests (narrower/wider) remain unchanged
  • Synchronized Cleanup of Escalation Hints in Descriptions and Results: Filter out "escalation available" hints that are no longer executable from Shell tool descriptions, file tool results, and job_output
  • Monitor Agent/Preset/Tool Lifecycle, Auto Join and Exit Wrapping: No need to rebuild Agent after restriction removal to restore wrapping
  • Validate DSH Package Version Consistency at Startup: Avoid runtime behavior inconsistencies from mixed installations
  • Collaborate with Other Wrapper Plugins Implementing dsh.tool-wrapper.v1 Protocol: Chain collaboration by priority

Technical Implementation

  • Language: TypeScript
  • Key Dependencies: @deepseek-ai/cordis, @deepseek-ai/dsh-agent, @deepseek-ai/dsh-sandbox, @deepseek-ai/dsh-sandbox-policy, @deepseek-ai/dsh-tools
  • Architecture Pattern: Cordis plugin, registered as sandbox-escalation-fix node via cordis.patch.yml at startup; Supervisor listens to agent/created, agent/disposed, agent-preset/selected, tools/change events, maintains wrapper bindings for bash / pwsh / write / edit per Agent, tries collaboration protocol Symbol.for('dsh.tool-wrapper.v1') first, otherwise falls back to own WrapperBinding registered to agent.ctx.tools exact scope
  • Entry File: src/index.ts (build output lib/index.mjs)

Use Cases

When DSH users use OAI series third-party models (typically like GPT) to execute bash, pwsh, write, edit tools in All Access (danger-full-access + approval=never) or permission boundary Sessions, the model repeatedly sends same-mode/empty justification escalation requests causing tool failures and retry loops. When Code Mode and Native Tool Call show inconsistent behavior, or after Preset dynamically calls agent.ctx.tools.restrict() requiring Agent rebuild to restore wrapping, this plugin uses Schema projection to make these impossible-to-succeed parameters invisible to the model at the request stage, eliminating the cycle from the root.

Prerequisites & Compatibility

DependencyMinimum VersionDescription
@deepseek-ai/cordis4.0.1Plugin runtime
@deepseek-ai/dsh-agent / dsh-llm / dsh-sandbox / dsh-sandbox-policy / dsh-scope / dsh-session / dsh-tools / dsh-user-approval0.1.0-rc.5, 0.1.0-rc.6, 0.1.0-rc.7, 0.1.0-rc.8, 0.1.1-rc.1Must maintain single version within same Profile, enforced at startup
@deepseek-ai/schemastery3.18.1Schema declaration
Node.js^22.19.0 || >=24.0.0engines declaration
PlatformCross-platformNo os/cpu restrictions declared

Installation

dsh plugin --profile web add --allow-build=dsh-sandbox-escalation-fix github:JUSTMONIKA2022/dsh-sandbox-escalation-fix

Configuration Options

ConfigTypeDescriptionDefault
logLevel'silent' | 'info' | 'debug'Controls plugin's own log output; 'silent' means complete silence, 'info' outputs startup hints and dynamic coordination warnings, 'debug' outputs more detailed coordination process'info'

FAQ

Q: Do I need to modify any configuration after installation?

A: No, this plugin is zero-configuration. Install to the current DSH Profile and restart DSH. The plugin will automatically adjust model-visible tool parameters based on each Session's current Sandbox Mode and Approval Policy.

Q: Does it modify DSH's security validation logic?

A: No. Strict narrow-to-wide checks, approval flows, and one-time authorization semantics remain unchanged. The plugin only does model-visible parameter projection and minimal compatibility handling. It will not automatically approve any escalation requests, nor fill placeholder content for missing or empty justification.

Q: What's the command to uninstall the plugin?

A: Execute dsh plugin --profile <profile> remove dsh-sandbox-escalation-fix in the same Profile used for installation. After uninstallation and DSH restart, original tool behavior is restored, and all wrapper layers are automatically released with the plugin lifecycle.

Q: Do 0.1.1-rc.1 users still need this plugin?

A: Official 0.1.1-rc.1 made partial runtime improvements on the approval=never path, but still uses the same static escalation Schema and validation at execution time. If you still see invalid justification, same-mode danger-full-access errors, or model stuck in retry loops, you can install this plugin to further converge at the Schema level.

Q: When multiple Agents have different permissions, will they affect each other?

A: No. The plugin wraps independently by Agent Exact Scope. Different Sessions, even within the same process, each calculate parameters according to their own permission state without mutual pollution. After permission changes, the next model request's tool Schema will be recalculated immediately based on the new state.

Q: What to do if version error appears at startup?

A: Packages @deepseek-ai/dsh-* within the Profile must maintain consistent versions and must fall within the whitelist: 0.1.0-rc.5, 0.1.0-rc.6, 0.1.0-rc.7, 0.1.0-rc.8, or 0.1.1-rc.1. Mixed or unknown versions will cause the plugin to refuse startup, and the error message will list the actual detected version combination.

Q: What if another plugin also wraps bash/pwsh/write/edit?

A: It depends on whether the other party implements the Symbol.for('dsh.tool-wrapper.v1') collaboration protocol. Those that do can chain collaborate by stable sorting of priority + owner; same-name tool registrations that don't implement it will be explicitly rejected by this plugin to avoid silently changing wrapper order or creating erroneous semantics. In this case, you need to uninstall one of the plugins.

Q: What if escalation fields still appear?

A: Confirm you're viewing the Schema of a Session created after installation (old Sessions use pre-installation tool definitions), and verify via dsh --profile <profile> --dump-config that both the sandbox-escalation-fix layer and Bundle entry exist. If another plugin loaded later replaces the same-name tool, handle it according to the previous question.

Difficulty Level

Beginner — Zero configuration, zero runtime intervention. Install to Profile and restart DSH to take effect. On failure, clear error information is only provided in startup logs or coordination warnings.

Known Issues & Limitations

  • Only wraps four built-in tools: bash, pwsh, write, edit; other tools are not covered
  • Target tools must satisfy Schema constraints: declare both sandbox_permissions and justification fields together, or omit both; declaring only one will be rejected at registration
  • Target tools replaced at runtime with incompatible definitions (missing fields, broken output contract) will only cause the corresponding tool for the corresponding Agent to enter dormancy with a warning logged, without terminating the Host process; after compatible definitions are restored, it will automatically rejoin
  • Only supports DSH deployments between 0.1.0-rc.5 and 0.1.1-rc.1 with consistent versions; other versions will refuse to start
  • When approval policy is any, all escalation targets are hidden, and the model cannot reach the approval flow (this is existing security semantics, not introduced by this plugin)
  • No unresolved issues marked as TODO/FIXME found in source code

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/JUSTMONIKA2022/dsh-sandbox-escalation-fix)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory