DSH Plugins Marketplace

DSH Plugins

Plugins

/

Security & Audit

/

dsh-risk-gate

d

dsh-risk-gate

Manifest valid

Semantic risk grading and progressive authorization: classifies tool calls into safe/risky/redline, asks before irreversible actions, auto-allows only approved-and-succeeded signatures.

hasBundlePatch

dsh-risk-gate

Semantic risk grading + progressive authorization for DeepSeek Harness. 按操作语义自动分级,不要求用户写规则——把 Hermes Agent 的可逆性决策链移植成 dsh 插件。

What it does

Hooks tools/pre-execute and classifies every tool call by operation semantics:

LevelMeaningAction
safereversible / read-only (read, search, web, benign bash)pass through (next())
riskyirreversible but low-risk (write, edit, install, git commit)ask via approval seam
redlineone of four red lines: remote-state change / outbound message / delete / paid quotaask with explicit redline type; fail-closed deny when no answerer

Classification is local and deterministic — no network, no LLM call. Unknown tools default to risky (fail-closed).

Progressive authorization (渐进授权)

Same operation signature approved-and-succeeded N times → auto-allowed afterward; a single failure/rejection zeroes the signature back to ask.

  • Signature = tool name + normalized arguments (large text payloads truncated)
  • Redline ops never auto-allow by default (alwaysAskRedline: true)
  • State is per-process (in-memory); HMR dispose clears it

Install

# from GitHub (requires dsh CLI; git-based install)
dsh plugin --profile web add "github:leetom314/dsh-risk-gate#main"

# or clone and verify locally first
git clone https://github.com/leetom314/dsh-risk-gate.git
cd dsh-risk-gate && ./setup.sh && npm test && ./verify.sh

Config

- id: dsh-risk-gate
  name: dsh-risk-gate
  config:
    autoAllowThreshold: 3      # 0 = disable progressive auth, always ask
    alwaysAskRedline: true     # redline ops never auto-allow
    verbose: false
    overrides:                 # optional per-tool override
      some_tool: deny          # 'safe' | 'deny'

Test

npm test        # node --test (classifier + host-level progressive auth)

E2E (real model + headless profile, isolated DSH_HOME):

./setup.sh
DEEPSEEK_API_KEY=... ./verify.sh
# expect: read-only pass / rm single-file blocked / rm -rf redline blocked /
#         quoted echo string not blocked / git push + scp + ssh remote blocked

verify.sh 动态生成临时 overlay($HERE/index.js 路径),不需要仓库内 overlay 文件——overlay*.yml 已 gitignore(含本机绝对路径,不随版本库分发)。

How the semantics map (red lines)

Shell-command inspection (bash/pwsh only, conservative regex):

  • DELETE — rm -rf, shred, mkfs, dd ... of=/dev/...
  • REMOTE — git push (incl. git -C dir push variants), git reset --hard, rsync user@host:, ssh user@host, curl/wget -X POST/PUT/DELETE, data uploads
  • PAY — cloud provisioning (aws ec2 run-instances, gcloud compute, ...)
  • MESSAGE — outbound message tools (send_message, im_send, ...)

Tool-name mapping: read/glob/grep/web_*/skill/job_* safe · write/edit/str_replace_editor/todo_write/create_goal risky.

Limitations

  • Shell inspection is regex-based (no full shell parsing): designed to be conservative (false positives over misses), but a determined prompt can still smuggle commands through obfuscation. It is a safety gate, not a sandbox — pair with dsh-permission-rules / sandbox executors for defense in depth.
  • Learning state is in-memory only (no persistence across restarts yet).
  • Approval UI is channel-provided; headless with no answerer fails closed (deny).

Compatibility

DSH 0.2.1-rc.3: failedDSH 0.2.1-alpha.4: failedDSH 0.1.7-rc.1: failed

Versions

Latest versionPublishedSize
0.1.0——

Comments

Loading…

Similar plugins

dsh-auto-reviewer

by AntaresCorn

Codex-style auto-review permission mode: adds an auto-review preset that auto-approves safe sandbox escalations, asks on risky or ambiguous ones, and rejects critical unconfirmed operations.

Security & AuditTools & CapabilitiesDevelopment & InfrastructureTerminal & ClientsManifest valid

★ 0

BSD-3-Clause

TypeScript

Sep 16, 2026

dsh plugin --profile web add @dsh-external/dsh-auto-reviewer

Auto-approval permission guard: a middle tier between workspace-write and danger-full-access — auto-allows safe operations inside trust directories, always asks a human for destructive ones, with 11 p

Security & AuditDevelopment & InfrastructureTerminal & ClientsManifest valid

★ 1

MIT

JavaScript

dsh plugin --profile web add dsh-perm-guard

by MrWeiCodes

Fine-grained permission gateway: per-category tool-call review (outside-workspace directories, commands, file read/write, subagents, repeated actions) with global & per-project allow/deny exceptions,

Security & AuditManifest valid

★ 17

↓ 443/wk

MIT

JavaScript

Oct 18, 2026

dsh plugin --profile web add @mrweicodes/dsh-permgate

by tancheng33

Runtime security gate on the tool pipeline: denies calls naming hosts outside an egress allowlist, redacts credentials from results at the canonical value rather than only the rendered content, and ap

Security & AuditDevelopment & InfrastructureManifest valid

★ 1

↓ 95/wk

MIT

TypeScript

Sep 22, 2026

dsh plugin --profile web add dsh-egress-guard

by kiiiiile

AI-reviewed auto-approval for DeepSeek Harness: safe tool asks granted automatically, risky ones escalated with the review attached

Manifest valid

★ 0

MIT

TypeScript

Sep 14, 2026

dsh plugin --profile web add dsh-approval-ai-review

by zhang8019

Turns DSH permissions into 9 selectable presets (3 sandbox modes x 4 approval tiers), with rule plus LLM risk classification across four risk levels, password-gated approval for high-risk operations,

Security & AuditDevelopment & InfrastructureManifest valid

★ 0

MIT

JavaScript

Sep 11, 2026

dsh plugin --profile web add dsh-permission-matrix