EliteOtaku
Guarded-Full-Access
Guarded Full Access for DSH: Full Access with destructive command guard / DSH 插件:带破坏性命令护栏的 Full Access
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 15, 2026
- Updated
- Aug 15, 2026
Introduction
Guarded Full Access / 受守护的全权限
DSH (DeepSeek Harness) plugin that adds a destructive command guard on top of danger-full-access.
DSH (DeepSeek Harness) 插件:在 danger-full-access 基础上加一层“破坏性命令护栏”。
- More open than
workspace-write: filesystem / shell still keep Full Access. 比workspace-write更开放:文件系统 / shell 仍保持 Full Access。 - Safer than
danger-full-access: batch delete, format, disk wipe, forced git operations, mass permission changes are blocked or require approval by default. 比danger-full-access更安全:批量删除、格式化、抹盘、强制 Git 操作、批量权限变更等默认拦截或要求批准。
⚠️ This is a “guardrail / last reminder”, not an OS-level security boundary. Command-line text matching can be bypassed by variables, encoding, or indirect execution. Use a real sandbox or a dedicated permission account when you need strong isolation. ⚠️ 这是“减震器 / 最后一道提醒”,不是 OS 级安全边界。命令行文本匹配可能被变量、编码、间接执行绕过;真正需要强隔离时请使用系统沙箱或专用权限账号。
Features / 特性
- Full Access remains available for normal operations / 普通操作仍保持 Full Access。
- Destructive commands are intercepted before execution via the official
tools/pre-executeseam / 通过官方tools/pre-execute扩展点在执行前拦截破坏性命令。 - Built-in audit log / 内置审计日志。
- Slash commands for runtime control / 提供运行时控制命令。
Modes / 模式
| Mode / 模式 | Behavior / 行为 |
|---|---|
block | Reject dangerous commands directly / 命中危险命令直接拒绝 |
ask | Return “requires user approval” and guide the user to confirm or allowlist (default) / 命中危险命令返回“需要用户批准”,引导用户确认或加入允许列表(默认) |
off | Disable the guard / 关闭守卫,完全放行 |
Installation / 安装(本地插件)
- Put this repo at
D:\AI\Guarded-Full-Access(or your preferred path). / 把本仓库放到D:\AI\Guarded-Full-Access(或你喜欢的路径)。 - Register it in the DSH Web profile / 在 DSH Web profile 注册:
- Add to
C:\Users\Administrator\.dsh\profiles\web\package.jsondependencies:"dsh-guarded-full-access": "file:D:/AI/Guarded-Full-Access" - Add to
C:\Users\Administrator\.dsh\profiles\web\cordis.patch.yml:- insert: - id: dsh-guarded-full-access name: dsh-guarded-full-access config: mode: ask
- Add to
- Restart DSH Web / 重启 DSH Web。
You can also install via dshx install if the plugin is published to npm / GitHub. / 也可通过 dshx install 安装(如果插件已发布到 npm / GitHub)。
Permission Preset / 权限预设
To make Guarded Full Access appear in the DSH permission-mode selector, add this to cordis.patch.yml:
- id: permission
config:
presets:
guarded-full-access:
sandbox: danger-full-access
approval: never
name: Guarded Full Access
description: Full access with destructive command guard (blocks/asks on rm -rf, format, force git, etc.)
Agent Preset / Agent 预设
The repo includes agent-presets/guarded-full-access/. Copy it to C:\Users\Administrator\.dsh\.agent-presets\guarded-full-access\ and choose Guarded Full Access in the DSH Agent preset settings.
仓库内已附带 agent-presets/guarded-full-access/,复制到 C:\Users\Administrator\.dsh\.agent-presets\guarded-full-access\ 后,即可在 DSH 设置的 Agent 预设中选择 Guarded Full Access。
Configuration / 配置
# cordis.patch.yml plugin config
mode: ask # block | ask | off
logFile: null # default ~/.dsh/logs/guarded-full-access.log
allowPatterns: [] # user allowlist (regex; matching commands are allowed)
Dangerous Command Coverage / 危险命令覆盖范围(v0.1)
- Bash / sh:
rm -rf,rm -fr,rmdir /s /q,rd /s /q,del /s /q,format,mkfs*,diskpart,clean all,shred,dd if=/dev/zero,truncate -s 0,git reset --hard,git push --force/-f,git branch -D,git clean -fdx,chmod -R 777,chown -R - PowerShell / cmd:
Remove-Item -Recurse -Force,Remove-Itemto drive root / environment,Clear-Content,Clear-Item,Format-Volume,Clear-Disk,Initialize-Disk,diskpart,format /q,takeown /F,icacls ... /reset /T
Commands / 命令
| Command / 命令 | Description / 说明 |
|---|---|
/guard-status | Show current mode, stats, and audit log path / 查看当前模式、统计、审计日志路径 |
/guard-allow <regex> | Add a regex to the allowlist / 把正则加入允许列表 |
/guard-mode <block|ask|off> | Switch mode at runtime / 运行时切换模式 |
Audit / 审计
Every block / ask / allow is appended to ~/.dsh/logs/guarded-full-access.log (JSON Lines) for traceability.
所有拦截 / 询问 / 放行都会追加写入 ~/.dsh/logs/guarded-full-access.log(JSON Lines),便于事后追溯。
Development / 开发
npm test # run node:test / 运行 node:test
npm run check # node --check syntax / node --check 语法检查
License / 许可证
MIT