Observed since 20 Oct, 21:52 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
AI Agent 环境安全审计 CLI:供应链投毒 / 密钥暴露 / 端口暴露 / MCP server 一键体检
权限边界 · 数据去向 · 密钥卫生——AI Agent 环境的一键体检
agent-audit 是开源的本地 AI Agent 环境安全审计 CLI:7 项只读检查覆盖供应链投毒、明文密钥、端口暴露、git 泄漏、依赖漏洞与 MCP server 攻击面。判定标准对照 OWASP / NSA CSI / MCP 官方安全指南,全程只读、零运行时依赖、Windows 优先。
🛒 GitHub Marketplace · English · 📖 MCP 审计白皮书 · 🏆 OpenSSF 证据清单 · MIT
agent-audit is a zero-dependency, read-only CLI that audits your local AI agent environment in one shot: supply-chain poisoning (market-installed skills), plaintext secrets & credential file permissions, port exposure, git-tracked secrets, known dependency vulnerabilities, and MCP server security (OWASP-aligned). Windows-first (icacls / netstat / tasklist are first-class citizens); works on Linux/macOS too. Also available as a GitHub Action.
0.0.0.0:18789,国家应急中心通报 85% 实例暴露公网;ComfyUI 1000+ 暴露实例被组僵尸网络挖矿。| # | 检查 | 判定标准 | 典型发现 |
|---|---|---|---|
| 1 | 端口暴露检查 | 服务只允许监听 127.0.0.1,严禁 0.0.0.0 通配 | OpenClaw 网关 / ComfyUI 绑定所有网卡 |
| 2 | Skill 来源分类审计 | 市场导入 skill(@ 前缀)= 最高供应链风险 | 800+ 恶意 skill 事件中的同款来源 |
| 3 | 外发端点白名单 | 全部端点应为官方 API 或本地回环 | trycloudflare 隧道、未知域名、IP 直连 |
| 4 | 凭据权限与明文 | config.yaml 存 key 正常;记忆文档里的真实值 + .env 权限过宽才是问题 | Vidar 变种专偷 agent 配置目录 |
| 5 | Git 泄漏检查 | .env / config.yaml 被追踪 = critical;.gitignore 必须有密钥规则 | auto-sync 把一切未忽略文件提交出去 |
| 6 | 依赖漏洞审计 | uv audit / pip-audit 扫描已知漏洞 | 2026-03 LiteLLM / Axios 投毒 |
| 7 | MCP Server 审计 | 来源可信 · 无远程 · 带鉴权 · 闲置禁用(对照 OWASP / NSA CSI) | 公网 URL、未知名 npm 包、无鉴权端点 |
# 1. 安装(PyPI · 运行时零依赖)
pip install agent-env-audit
# 2. 一键体检(默认审计 Hermes 环境 + 当前工作区)
agent-audit
# 3. 读报告:Markdown + JSON 双输出在 ./agent-audit-reports/
# 或从源码 / 免安装
pip install git+https://github.com/mo9652962-ai/agent-audit.git
git clone https://github.com/mo9652962-ai/agent-audit.git && cd agent-audit && PYTHONPATH=src python -m agent_audit
# 只跑部分检查 + 指定判定阈值
agent-audit --checks ports,credentials --severity-threshold high
# 报告只出 JSON(CI 机读)
agent-audit --format json -o ./reports
| 参数 | 默认 | 说明 |
|---|---|---|
--checks | 全部 7 项 | 逗号分隔:ports,skills,endpoints,credentials,git,deps,mcp |
--format | md,json | 报告格式 |
--severity-threshold | high | 达到该严重度退出码为 1(CI 门禁) |
-c/--config | — | TOML 配置(paths / ports / endpoints 段) |
-o/--output-dir | agent-audit-reports | 报告输出目录 |
已上架 GitHub Marketplace——PR 时自动跑 git 泄漏检查 + 依赖漏洞扫描,发现 ≥ 阈值级问题即失败:
- uses: mo9652962-ai/agent-audit-action@v1.0.2
with:
severity-threshold: high
详见 action/README.md。本仓库自己的 CI 每次 push 都在用它审计自己(dogfood)。
# audit.toml —— 全部可省略
[paths]
skills_dirs = ["C:/Users/me/.agents/skills"]
config_dirs = ["C:/Users/me/AppData/Local/hermes"]
[ports]
watch = { 18789 = "OpenClaw 网关", 8188 = "ComfyUI" }
system_noise = [135, 445, 5040]
[endpoints]
whitelist = ["corp.internal"]
MCP 审计判定清单(检查 7)与以下权威指南对齐(2026-09 核对):
已工具化覆盖:来源可信、无远程 MCP、鉴权字段、闲置禁用。NSA 清单中尚未工具化的项(tool poisoning / shadowing、token passthrough)见 Roadmap。
| 期 | 主题 | 数据钩子 |
|---|---|---|
| 1 | 本机端口暴露 | 8 个高危报警,只有 2 个是真的 |
| 2 | MCP 供应链审计 | 每一个 MCP 都是一扇门 |
| 3 | skill 供应链投毒 | 800+ 恶意 skill 同时上线 |
| 4 | 凭据卫生 | 113 处密钥命中,先别慌 |
skill-vetter 集成:skill 安装前审查--fix 模式:一键收紧权限 / 改监听(带确认)发现漏洞请勿开公开 issue——走 GitHub Security Advisories 私密报告,7 天内响应。设计边界与已知限制见 SECURITY.md。
PR 欢迎,规范见 CONTRIBUTING.md(Actions SHA 固定 / 覆盖率棘轮 / 测试政策 / 密钥卫生)。
MIT
📌 更多:作者仓库矩阵(墨题刷题机 / 第二大脑 / 安全三部曲 / 孵化线)
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.2 | 4 Oct 2026 | 5 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:52 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:ef998130c63ad7e3caf3027fe3b8601def1c8202efa19ce95ad2e99d38a04da4