dsh-tui-secret-guard
安全与治理 活跃维护

dsh-tui-secret-guard

icyaaaww/dsh-tui-secret-guard

可在dsh-TUI将数据提交至模型前自动拦截识别到的高置信度敏感密钥,完全兼容dsh生态v0.15版清单规范,无需额外调整即可融入现有dsh使用流程。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
7 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:icyaaaww/dsh-tui-secret-guard
git clone https://github.com/icyaaaww/dsh-tui-secret-guard.git
git clone git@github.com:icyaaaww/dsh-tui-secret-guard.git
README.md main

dsh-TUI Secret Guard

A small dsh-TUI ecosystem plugin that prevents high-confidence credentials from being sent to a model. It scans locally, never stores prompt content, and reports only credential categories.

Why it helps

Pasting a .env fragment, deployment command, or debugging log into an agent is an easy way to disclose a live key. Secret Guard blocks known provider tokens, private-key headers, and credential-like assignments before delivery. The normal path uses tui.dsh/v1alpha1#DecisionEvents, so rejected text is not written to the session. Its compatibility fallback rejects the latest user message at agent/pre-step, before the model request.

Install

dsh plugin --profile dsh-tui add ./dsh-tui-secret-guard

Decision interception is default-deny in Community v0.15. Grant the declared permission in ~/.dsh-tui/extension-grants.json:

{
  "grants": {
    "community.dsh-tui.secret-guard": [
      {
        "name": "session.input.intercept",
        "scope": "tui/input"
      }
    ]
  }
}

The grant is live-reloaded by dsh-TUI. The plugin requests no storage, message-observation, network, filesystem, or command permission.

Configuration

enabled: true
genericAssignments: true
minGenericLength: 24
showStatus: true
  • genericAssignments detects values assigned to names such as API_KEY, CLIENT_SECRET, ACCESS_TOKEN, and PASSWORD.
  • minGenericLength controls only generic assignments. Provider-specific formats retain their own strict lengths.
  • showStatus displays secret guard: armed and a process-local blocked count. It does not persist counters or content.

Placeholders including ${ENV_NAME}, YOUR_API_KEY, redacted, and masked values are ignored. A blocked prompt must be edited and submitted again; automatic redaction is intentionally avoided because silently changing code or credentials can produce misleading model output.

Protocol compliance

dsh-plugin.json targets manifest 0.15, declares the optional DecisionEvents contract, requests the exact tui/input scope, and documents its fallback. Validate it against dsh-ecosystem-spec:

npm run validate:manifest -- --manifest /absolute/path/to/dsh-plugin.json --grant session.input.intercept

Before publishing, add the final repository and artifact digest to dsh-plugin.json so a Verified claim can bind the released tarball.

Development

npm install
npm test
npm run pack:check