toby-bridges/api-relay-audit
toby-bridges/api-relay-audit从 DeepSeek Harness 对 AI API 中转站和 LLM 代理运行本地安全审计,生成 Markdown 报告,覆盖提示词注入、模型替换信号、工具调用改写、错误泄漏、流完整性和按 profile 启用的 Web3 风险。
注册一个 agent 工具 plugin_guard,在安装前对 DSH 插件包做静态扫描,给出判定与原因:缺少或损坏的 dsh.bundle.patch、未声明 dsh.permissions、安装脚本、危险 API 与代码混淆、依赖风险,以及未索引、无法核验的源码。只读:不导入、不安装、不求值、不运行被扫描的代码。
A DSH plugin bundle that gives the agent one tool: plugin_guard.
Ask it to check a package before it joins your profile, and it answers with the same verdict, reasons and next command the CLI prints:
> scan ../dsh-plugin-gate before I install it
FAIL 0/100 · 1 high · 1 medium · 2 low
HIGH security/dangerous-api Evaluates code at runtime (lib/rules.js:136)
Next: read the flagged lines before installing; drop --ignore-scripts if the
package needs an install step you did not review
The scan is static and read-only. It never imports, installs, evaluates or runs the code it looks at, and it never writes to the package.
dsh plugin --profile desktop add dsh-plugin-guard-tool
Or from a checkout, without going through npm:
dsh plugin --profile desktop add link:$PWD/plugins/dsh-guard-tool
After the profile restarts the agent has plugin_guard; nothing appears in the
desktop UI, because this bundle ships no client code.
Requires DSH >=0.2.0-rc.1 <0.3.0-0, declared both in peerDependencies and in
dsh.engines.dsh. @deepseek-ai/dsh-tools comes from the host; the bundle only
imports it.
| argument | type | meaning |
|---|---|---|
target | string, required | a plugin directory (./my-plugin) or an npm package name (dsh-plugin-gate) |
json | boolean | return the full machine-readable report instead of the summary |
dsh-plugin-guard index and dsh-plugin-guard scan
remain the CLI's job.index.js host half: defineTool + ctx.tools.register
spec.js the tool definition, free of any DSH import (unit tested)
cordis.patch.yml the bundle patch that mounts the host half
locale/{en,zh}.json title and description shown by the host
icon.svg the icon shown by the host
spec.js is kept separate on purpose: the tool's behaviour is testable with
node --test test/smoke.mjs and no DSH installation.
MIT.