drdrdr666/dsh-guard ↗★ 0

dsh-guard

工具调用前的拦截守卫:模拟键鼠、改系统配置、不可逆删除、凭据明文外发,命中即弹确认由你决定

패키지
dsh-guard
호환성
미검증
버전
0.1.0
라이선스
MIT
최근 업데이트
2026. 11. 23.

같은 패키지 이름의 다른 저장소

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:drdrdr666/dsh-guard

dsh-guard

Intercepts tool calls before they run and asks you to confirm four kinds of operations that already caused real damage.

Why

Ordinary plugins register a tool and wait. This one hooks the pre-execution gate: a match pauses the call and hands the decision to you.

The rules come from a real incident: an assistant tried to click a button on the user's behalf by sending raw mouse events at screen coordinates. One click landed on the taskbar and opened the Start menu; another landed in a different window and switched an unrelated app to fullscreen. The user's workspace was disturbed twice before anything could be said.

The common property: the damage happens before anyone can interrupt. So the guard must stand before execution, not report afterwards.

What it intercepts

CategoryPatternsWhy
Simulated inputSendKeys, mouse_event, SetCursorPos, keybd_event, SendInputReal input goes to whatever window is focused
System configurationwriting drivers\etc\hosts, reg add, netsh interface, schtasks /ru SYSTEM, bcdeditNeeds admin, affects the whole machine, awkward to undo
Irreversible deleteRemove-Item -Recurse -Force on a system path, del /s /q C:\, rm -rf /, format X:Gone is gone
Plaintext credentialsghp_…, github_pat_…, sk-… in a command lineLeaks into shell history, logs and process lists

Ask, not deny

A hard denial removes the user's ability to proceed — and some workflows genuinely need simulated input for programs without an API. A match therefore returns ask: the UI explains what matched and why, and the user decides.

No false positives

The test suite pins a set of ordinary commands that must always pass:

node tests/run.mjs
git status --short
Get-ChildItem -Force
npm run build
echo hello
curl -s https://api.github.com/user
pwsh -c "Get-Process | Select-Object -First 3"

Scope

  • Shell tools (pwsh / bash / sh / shell / cmd): inspects command / cmd / script / code
  • File tools (write / edit / read): inspects the target path only
  • Everything else is untouched

Limitations

  • Pattern matching, not semantic analysis — obfuscated commands (split strings, base64) get through.
  • Covers four known categories; new incidents need new rules.
  • Whether the call actually runs depends on the approval layer: under the never policy an ask is auto-rejected.
  • Not a sandbox and not a replacement for the permission system — only a pause before execution.

Install

pnpm add git+https://github.com/drdrdr666/dsh-guard.git

Then add dsh-guard to the profile bundle list.

License

MIT