toby-bridges/api-relay-audit
toby-bridges/api-relay-audit从 DeepSeek Harness 对 AI API 中转站和 LLM 代理运行本地安全审计,生成 Markdown 报告,覆盖提示词注入、模型替换信号、工具调用改写、错误泄漏、流完整性和按 profile 启用的 Web3 风险。
只读的 agent 机群凭据卫生审计:检查凭据文件权限、git remote 内嵌凭据(输出脱敏)与 provider token 字面量计数;零依赖、确定性。
Read-only agent-fleet hygiene audit plugin for DSH. Zero-dependency, deterministic, fully masked output. Checks three things:
~/.gitconfig, ~/.netrc, ~/.npmrc, ~/.env, ~/.ssh/) should be 600/700; group/other-readable entries are flagged tooOpen~/.gitconfig and .git/config under the given roots for https://user:pass@host, https://oauth2:TOKEN@host, or token-like usernames; values are masked as *** in the output — byte-for-byte guarantee that the raw secret never appearsOn a multi-agent machine, credentials scatter across ~/.gitconfig, agent configs, .git/config files and various .env. A git url.*.insteadof or pushurl with an embedded token (e.g. https://oauth2:<token>@gitlab.example.com/...) means git remote -v prints the secret into every log, chat, and CI build. A one-shot read-only audit with masked output is the first line of a security baseline.
# local validation
dsh plugin --profile web add /path/to/dsh-fleet-audit
# after publishing
dsh plugin --profile web add dsh-fleet-audit
# or
dsh plugin --profile web add github:LeslieWylie/dsh-fleet-audit
Restart dsh web after installing, then just ask: "audit credential hygiene on this machine" → the agent calls fleet_audit.
| Param | Type | Description |
|---|---|---|
roots | string[] | directories to recursively scan for .git/config (optional; default: only ~/.gitconfig) |
files | string[] | extra absolute credential-file paths for permission checks |
scanSecrets | boolean | scan configs for token-prefix literals (default true) |
maxGitConfigs | number | cap on scanned git configs (default 200, max 2000) |
maxDepth | number | recursion depth for .git discovery (default 5, max 20) |
{
"ok": true,
"summary": { "files": 5, "tooOpen": 1, "gitLeaks": 2, "secretFiles": 1, "issues": 4, "scannedGitConfigs": 12 },
"checks": {
"credentialFiles": [
{ "path": "/Users/alice/.gitconfig", "exists": true, "mode": "644", "tooOpen": true }
],
"gitRemoteLeaks": [
{ "file": "/Users/alice/code/proj/.git/config", "host": "gitlab.example.com", "maskedUrl": "https://***:***@gitlab.example.com/group/proj.git" }
],
"secrets": [
{ "file": "/Users/alice/.gitconfig", "providers": [ { "provider": "github", "count": 1 } ] }
]
}
}
npm install
npm run check # typecheck + vitest + build
roots / files to cover arbitrary pathschmod 600 and rotate the credential yourselfdsh plugin --profile <p> remove dsh-fleet-audit # or drop the row from dsh.profile.bundles
The plugin is read-only and stateless; uninstalling it never touches user data.
This project is an independent community plugin with no affiliation to DeepSeek or its official DSH repo; "official" status is only granted through official channels. The dsh-plugin topic will be added for discoverability at release time.
MIT © LeslieWylie