mirage
strukto-ai
The World's First Unified Virtual Filesystem For AI Agents
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:a903067276-rgb/dsh-perm-guard
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Auto-approval permission guard for DeepSeek Harness (dsh) web — the "middle tier" between workspace-write (asks too often) and danger-full-access (too open). Common operations like cross-directory edits, git commit/merge and builds run without approval prompts; destructive operations (deletes, disk ops, privilege escalation, curl|sh) always ask for human confirmation.


allowed-once for safe operations (13ms, no popup) or forwards to the human prompt for risky ones.tools/pre-execute) — dangerous categories are intercepted before the sandbox even rejects them.~/.dsh/perm-guard.json, survives restarts. Zero host dependencies.dsh plugin --profile web add "github:a903067276-rgb/dsh-perm-guard#main"
Then restart dsh web. Update: dsh plugin --profile web update dsh-perm-guard, restart.
Requires
pnpmin PATH (dsh pluginis a pnpm forwarder).
| Category | Standard | Aggressive |
|---|---|---|
| File edit (write/edit/cp/mv/mkdir) | auto (in trust dirs) | auto |
| Git local (commit/merge/rebase/checkout) | auto | auto |
| Build / test / install | auto | auto |
| Read-only queries (ls/cat/grep/git status) | auto | auto |
| Delete (rm, reset --hard, clean -fd) | ask | ask |
| Protected paths (.ssh/.aws/secrets/.env/system dirs) | ask | ask |
| Privilege (sudo, services, global installs) | ask | ask |
| Network download-execute (curl|sh) | ask | ask |
| Git push | ask | auto |
| Publish / deploy | ask | auto |
| Disk / partition / device | ask | ask |
Switching modes resets the category switches to that mode's defaults (adjustable afterwards).
rm, rm -rf / or ~ (circuit breaker, even with $(...) variants), git reset --hard, git clean -fd, Remove-Itemdd writing devices, mkfs/fdisk/wipefs/diskutil erase, writes to /dev/sudo/su, service management (launchctl/systemctl), recursive chmod/chown on / or ~curl|sh, wget|shgit push --force / -f (rewrites history)bash, pwsh (PowerShell), and the write/edit file tools. MCP tools and other read-only tools have no approval mechanism and are unaffected.a && rm -rf x): pure-word chains are split and evaluated per subcommand, taking the strictest result; chains containing variables/redirection/wildcards are treated conservatively as one unit.| Claude Code | Codex | dsh-perm-guard | |
|---|---|---|---|
| Read-only command set | built-in, not configurable | sandbox | built-in + configurable |
rm -rf / ~ breaker |
always prompts | sandbox blocks | always prompts (all modes) |
| Protected paths | yes | .git/.agents/.codex |
.ssh/.aws/secrets/system dirs/.git |
| Network isolation | tool-level | OS-level (default off) | not available (DSH has no OS network fence; only curl\|sh pattern detection) |
| Approval categories | 3 tool classes | 5 granular switches | 11 explicit switches + 2 modes |
| Auditing | prompts only | logs | in-plugin audit + host approval/asked/decided events |
~/.dsh/perm-guard.json (created on first change):
{
"enabled": true,
"mode": "standard",
"categories": { "fileEdit": "auto", "...": "..." },
"trustedDirs": []
}
trustedDirs: extra absolute paths auto-approved in Standard mode (default: workspace + its sibling directories).curl|sh) in command text, not block other network traffic."Remove-Item", or scripts embedding rule sources) are conservatively intercepted — expected, rare in practice.approval/asked + approval/decided event pair.# hot-plug testing (no restart)
# 1. define a dynamic Cordis plugin with the same decision logic
# 2. cordis_run → verify → cordis_stop
# static bundle (this repo layout)
# symlink to ~/.dsh/profiles/web/node_modules/dsh-perm-guard
# add "dsh-perm-guard" to ~/.dsh/profiles/web/package.json dsh.profile.bundles
# restart dsh web
Verification matrix: docs/verify-checklist.md
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: permission、permission-management。