DeepSHPlugins
dsh-risk-guard 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-risk-guard

安全與運維TypeScriptMIT

零打擾審計與保險絲攔截:靜默記錄每次工具呼叫並做純規則風險評分(含累積加分、風險等級分佈、歸檔保留期清理),只攔不可逆災難(受保護路徑刪除、磁碟擦除、force push 到受保護分支/引用、憑據外發),/risk-guard 輸出脫敏操作賬單並支援 --since 時間過濾。

0 Starsshuxue6662-a11y 更新時間 2026-08-17
訪問 GitHub 倉庫
dsh-risk-guard 專案預覽

專案介紹

中文

零打擾審計與保險絲攔截:靜默記錄每次工具呼叫並做純規則風險評分(含累積加分、風險等級分佈、歸檔保留期清理),只攔不可逆災難(受保護路徑刪除、磁碟擦除、force push 到受保護分支/引用、憑據外發),/risk-guard 輸出脫敏操作賬單並支援 --since 時間過濾。

English

Zero-interruption audit and fuse blocking for DeepSeek Harness: silently records every tool call with deterministic risk scoring, cumulative-risk bonuses, risk-level breakdowns and retention-based cleanup; blocks irreversible catastrophes (protected-path deletion, disk wipe, force-push to protected branches/refs, credential exfiltration), and renders a redacted /risk-guard operation bill with --since filtering.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
shuxue6662-a11y
倉庫
shuxue6662-a11y/dsh-risk-guard
GitHub Stars
0
Forks
0
開發語言
TypeScript
許可證
MIT
最近推送
2026-08-17
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

39/ 100
維護活躍
83
文件與實用資訊
100
生態關注度
0
安裝便捷訊號
100
專案宣告訊號
100

README 含完整安裝與使用說明;標準命令一鍵安裝。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add dsh-risk-guard

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-risk-guard

Zero-interruption audit + fuse blocking for DeepSeek Harness (dsh).

npm License CI dsh

Features

  • Silent audit — records every tool call (tool name, redacted arguments,

success/failure, risk tags, explainable score) into local JSONL files. No dialogs, no permission changes, no sandbox changes.

  • Deterministic risk scoring — zero LLM calls, zero extra cost. Covers

destructive deletes, credential reads, network egress, writes outside the workspace, dependency installs and heavy builds; rapid repeats and consecutive high-risk calls accumulate bonus score.

  • Insurance fuse — blocks only irreversible catastrophes before they

execute: protected-path deletion, disk wipe/format, force-push to protected branches, and network commands referencing credential files.

  • Operation bill — /risk-guard answers "what did my agent actually do?",

with scores, tags, reasons and redacted details for the current session, one turn, or all history.

All data stays on your machine under <DSH_HOME>/risk-guard/. No network calls, no telemetry.

Install

Requires an existing DeepSeek Harness installation.

Option 1 — dsh plugin manager (recommended)

dsh plugin --profile web add dsh-risk-guard

Restart the Web UI, then use /risk-guard in any session.

Option 2 — npm

npm install dsh-risk-guard

or with pnpm:

pnpm add dsh-risk-guard

Then register the plugin in your profile's cordis.patch.yml:

- insert:
    - id: risk-guard
      name: 'dsh-risk-guard'

Option 3 — from source

git clone https://github.com/shuxue6662-a11y/dsh-risk-guard.git
cd dsh-risk-guard
pnpm install
pnpm build
dsh plugin --profile web add .

Usage

/risk-guard              operation bill for the current session
/risk-guard --turn       only the last turn
/risk-guard --all        summary + bills for every recorded session
/risk-guard --since=2026-08-01
                         only records from this date (with any other flag)
/risk-guard --json       machine-readable output

The bill includes the time range, call/turn counts, high-risk and fuse-block counts, max/total scores, tag distribution, a risky-calls table and every fuse denial.

Configuration

All options are optional; defaults are shown below.

OptionDefaultMeaning
fuseEnabledtruemaster switch for fuse blocking
maxFileSizeMb50gzip-archive the monthly JSONL above this size
retentionDays30delete gzip archives older than this many days
cumulativeRiskWindowMs600000rolling window for the repeat-tag risk bonus
highRiskThreshold60score floor for the consecutive-high-risk bonus
workspaceRootunsetdetect writes outside the workspace
homeDirOS homehome used by path rules and ~ expansion
dshHome~/.dsh or $DSH_HOMEaudit store at <dshHome>/risk-guard
protectedBranches['main', 'master']force-push to these branches is blocked
protectedRemotes[]force-push to these remotes is blocked
credentialFileNamescommon list.env, credentials, id_rsa, …

Example:

- insert:
    - id: risk-guard
      name: 'dsh-risk-guard'
      config:
        fuseEnabled: true
        workspaceRoot: 'C:/projects/my-app'
        protectedBranches: ['main', 'master']

Fuse rules (v1)

  • rm -rf / del / Remove-Item deleting the filesystem root, the home

directory itself, $HOME/*, DSH_HOME, or a credential file;

  • disk wipe/format commands (dd of=/dev/sdX, mkfs*, wipefs, diskpart,

shred /dev/…, format C:);

  • git push --force / -f targeting main/master or a configured protected

remote (feature branches are not blocked);

  • network commands (curl, wget, nc, scp, ssh, …) referencing a

credential file.

Everything else runs untouched. Set fuseEnabled: false to disable the fuse while keeping the audit recorder active.

Privacy & storage

  • Records are appended to <DSH_HOME>/risk-guard/<yyyy-mm>.jsonl through a

serialized write queue; oversized month files are gzip-archived.

  • Secret-shaped values (GitHub tokens, sk- keys, private-key blocks,

Bearer tokens, .env lines, password assignments) are redacted before storage; only a digest of the redacted value is kept.

  • The plugin makes no network calls and ships no telemetry.

Compatibility

EnvironmentStatus
dsh 0.1.0-rc.6 (npm next)tested
web profiletested
headless profileworks (command is conditionally registered)

Troubleshooting

  • All tool calls crash after install — host and profile versions of

@deepseek-ai/* differ. Reinstall the plugin in the profile and run pnpm dedupe.

  • The bill is empty — start a new turn and run a few tool calls; records

are written asynchronously.

  • I want zero blocking — set fuseEnabled: false.

Contributing

See CONTRIBUTING.md and SECURITY.md.

License

MIT

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案