CetOeil/dsh-process-guard ↗★ 0

dsh-process-guard

阻止终止浏览器或DSH宿主进程的Shell命令 适合需要增强沙箱安全性的用户,防止AI误操作或恶意终止关键系统进程。

套件
dsh-process-guard
相容性
待驗證
版本
0.2.1
授權
MIT
最近更新
2026年9月24日

安裝

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

Configuration

Defaults are the safe ones; the shipped cordis.patch.yml deliberately sets no config: block. Override keys by copying the row into your own profile cordis.patch.yml (see examples/override.cordis.patch.yml):

- id: process-guard
  name: dsh-process-guard
  config:
    mode: ask                 # 'deny' (default) routes through ctx.tools.guard()
    additionalTools: [remote_shell]
    additionalProtectedImages: [custombrowser]
    safeFilterAllows: false   # default: require a PID or owned process handle
    announce: true            # add the system-prompt section
    enabled: true
KeyDefaultMeaning
enabledtrueSet false to disable inspection entirely.
toolscommon shell tool namesReplacement list of tools whose command argument is inspected.
additionalTools[]Tool names added to the default list.
protectedImagescross-platform browsers + harness/terminal hostsReplacement list of images that must never be killed by name.
additionalProtectedImages[]Image names added to the built-in protected list.
modedenydeny blocks the call; ask sends it to the approval prompt instead.
safeFilterAllowsfalseOpt into the positive CommandLine -like/-match '*--headless*' or --user-data-dir exception. Negated or -or filters remain blocked.
announcetrueContribute the system-prompt section.

Use additionalTools and additionalProtectedImages for normal extension; tools and protectedImages intentionally replace their defaults. Unknown keys, mistyped booleans, invalid array entries, and empty safety lists are reported and fall back to safe values, so a typo cannot quietly weaken the guard.

mode: deny is enforced through ctx.tools.guard(), which is monotonic — no other guard can force-allow a call this one denied. mode: ask registers a tools/pre-execute listener instead and lets you decide, with the reason shown.