---
title: "DSH 沙箱扩权反复报错怎么办"
seo_title: "DSH 沙箱扩权报错：安装 dsh-sandbox-escalation-fix"
description: "解决 DeepSeek Harness（DSH）反复出现 sandbox escalation、invalid justification 与 danger-full-access 报错，安装固定提交并安全回退。"
canonical: https://52dsh.com/tutorials/justmonika2022-dsh-sandbox-escalation-fix-install-config/
authors: ["52DSH 编辑部"]
audience: []
outcomes: []
prerequisites: ["Node.js 与 pnpm","独立 web Profile","可丢弃测试工作区"]
difficulty: intermediate
estimated_action_time: null
next_steps: null
published_at: 2026-09-03
updated_at: 2026-09-03
verified_on: 2026-09-03
maintenance_status: community
verification_level: source_reviewed
risk_level: medium
dsh_version: 0.1.1-rc.2
plugin_id: justmonika2022-dsh-sandbox-escalation-fix
tutorial_kind: plugin_configuration
related_plugin_url: https://52dsh.com/plugins/justmonika2022-dsh-sandbox-escalation-fix/
---

# DSH 沙箱扩权反复报错怎么办

解决 DeepSeek Harness（DSH）反复出现 sandbox escalation、invalid justification 与 danger-full-access 报错，安装固定提交并安全回退。

dsh-sandbox-escalation-fix 0.1.2-alpha5 按 Session 的 Sandbox Mode 与 Approval Policy 修正 bash、pwsh、write、edit 的扩权参数和误导提示。

如果你的目标是修复 DeepSeek Harness 反复请求 sandbox escalation 或 invalid justification，本教程会说明如何在 DeepSeek Harness（DSH）中准备、安装、配置、验证和回退 dsh-sandbox-escalation-fix。本文锁定作者仓库提交 `c5673dc02a51`；已复核固定提交的原始资料，未进行运行实测。

> 对应插件：[查看 dsh-sandbox-escalation-fix 的功能、权限与兼容性说明](/plugins/justmonika2022-dsh-sandbox-escalation-fix/)。先确认它适合你的工作流，再执行安装。

## 先确认是否适合你

- **分类**：安全治理
- **风险等级**：medium
- **核验证据**：source_reviewed
- **兼容性边界**：0.1.2-alpha5 要求 Node.js ^22.19 或 >=24，并在运行时检查整套 DSH 包版本；固定版本允许 DSH 0.1.1-rc.2 与 0.1.2-alpha.5，但没有声明 0.1.2-rc.1，未知或混装版本会失败关闭。
- **主要权限关注**：在 Agent 作用域包装四个核心 Shell/文件工具的 Schema、参数和结果提示；它不授予新权限，也不替代宿主审批，但与其他 Wrapper 或结果重写插件可能冲突。

如果你准备在重要工作区使用，先阅读插件详情页的权限和数据流说明；“源码已审阅”或“资料已整理”都不等于安全认证。

## 安装前准备

1. 安装 Node.js 22.19、Node.js 24 或项目当前声明支持的更高版本，并确认 `pnpm` 可用。
2. 使用独立的 `web` Profile 和可丢弃测试工作区，不直接连接生产目录。
3. 备份当前 Profile 配置，并记录安装前的 `--dump-config` 输出。
4. 核对固定来源中的外部服务、账号、运行时和平台限制。
5. 作者资料未显示明确的插件专属环境变量；如果运行时要求凭据，不要根据同类插件猜测变量名。

## 安装 dsh-sandbox-escalation-fix

52DSH 使用目录中记录的精确安装目标，避免直接跟随可能变化的默认分支：

```bash
npx --yes @deepseek-ai/dsh@0.1.1-rc.2 plugin --profile web add github:HakureiMonika/dsh-sandbox-escalation-fix#c5673dc02a51cf78e56fe919752a8c0eb4193627
```

GitHub 源码插件如果被 pnpm 拦截构建脚本，先检查终端提示的具体包和脚本。只在 `web` Profile 中放行确实需要的构建项，不要全局放行未知依赖。

作者文档还出现了以下命令。它们用于核对功能或开发流程，不应替换上面的锁定安装命令，也不要一次全部执行：

- `dsh --profile <profile>`
- `dsh plugin --profile web add <tgz-absolute-path>`
- `dsh plugin --profile <profile> add github:<owner>/dsh-sandbox-escalation-fix#<new-commit-sha>`
- `dsh plugin --profile <profile> add github:<owner>/dsh-sandbox-escalation-fix#<commit-sha>`

## 插件专属配置

### 配置目标

- `profiles/web`：只在出现错误的测试 Profile 中加入固定提交。

### 固定提交安装

证据：[固定来源](https://github.com/HakureiMonika/dsh-sandbox-escalation-fix/blob/c5673dc02a51cf78e56fe919752a8c0eb4193627/README.md)。将路径、账号和凭据占位符替换为测试值。

```bash
dsh plugin --profile web add github:HakureiMonika/dsh-sandbox-escalation-fix#c5673dc02a51cf78e56fe919752a8c0eb4193627
```

### 安装后设置

1. 重启测试 DSH Web，并导出组合配置确认插件只加载一次。
2. 不要同时启用其他会包装 bash、pwsh、write 或 edit 的未知插件。


## 配置验证与成功结果

1. **在相同沙箱与审批设置下重现原来的最小失败任务。**

   期望结果：不再生成当前策略下无效的扩权参数，允许或拒绝仍由 DSH 原审批策略决定。

2. **切换到应拒绝写入的测试路径并再次请求写入。**

   期望结果：操作继续被宿主策略拒绝，插件没有扩大权限。

## 第一次使用

- 在可丢弃测试目录中复现一条原本会反复请求 danger-full-access 的命令，核对审计日志。

## 数据、权限与凭据

**数据流：**Session 的 Sandbox/Approval 状态与工具 Schema → 插件按 Agent 作用域投影可用参数并剔除冗余升级请求 → 原 DSH 工具和审批路径执行 → 只在精确匹配时清理误导提示。

**权限关注：**在 Agent 作用域包装四个核心 Shell/文件工具的 Schema、参数和结果提示；它不授予新权限，也不替代宿主审批，但与其他 Wrapper 或结果重写插件可能冲突。

**数据存储：**插件读取 Session 沙箱、审批和工具定义并在内存中投影，不负责保存业务数据；DSH 原有日志仍会记录工具与审批结果。

真实 Token、API Key、Cookie 和账号 ID 不应写进 Git 仓库、网页截图或公开 Issue。测试结束后撤销临时凭据。

## 卸载、回退与清理

1. 从同一个 web Profile 移除 dsh-sandbox-escalation-fix 并重启。
2. 再次导出配置，确认 Wrapper 已消失且四个原生工具恢复。

## 常见问题

### 安装成功但页面或命令没有出现

先运行 `--dump-config` 确认 Bundle 已进入 `web` Profile，再重启 DSH Web 并硬刷新浏览器。不要通过反复扩大权限来解决加载问题。

### 插件运行后没有得到预期结果

把问题缩小到本页的最小验证任务，检查作者文档要求的变量、外部服务和平台限制。保存终端错误原文，并核对当前安装目标是否仍对应本页固定提交。

作者提供了独立故障文档，可从下方“固定来源证据”进入；本页没有把整份 README 复制过来。

## 固定来源证据

以下资料是本文配置结论的依据：

- [README.zh.md](https://github.com/HakureiMonika/dsh-sandbox-escalation-fix/blob/c5673dc02a51/README.zh.md)
- [README.md](https://github.com/HakureiMonika/dsh-sandbox-escalation-fix/blob/c5673dc02a51/README.md)

继续查看：[返回 dsh-sandbox-escalation-fix 插件详情页](/plugins/justmonika2022-dsh-sandbox-escalation-fix/)，重新核对兼容性、权限、同类插件和来源状态。

## 原始来源

- https://github.com/HakureiMonika/dsh-sandbox-escalation-fix
- https://github.com/HakureiMonika/dsh-sandbox-escalation-fix/blob/c5673dc02a51/README.zh.md
- https://github.com/HakureiMonika/dsh-sandbox-escalation-fix/blob/c5673dc02a51/README.md
