Token导航 LogoToken导航TokenDH.com
agentaudit-CLI logo
安全风控stdio官方级别未说明来源级核验

agentaudit-CLI

MCP Server

agentaudit

AgentAudit是一个专为AI包生态系统设计的安全扫描工具,提供快速正则扫描和深度LLM审计两种模式,用于检测漏洞、提示注入和供应链攻击。

工具数

7

提示词数

0

GitHub Stars

3

资源数

0
安全JavaScriptClaude漏洞检测Claude DesktopClaudeCursorWindsurfVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

agentaudit-dev

提供方

agentaudit-dev

最后核验

2026/5/17 20:20

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx agentaudit scan https://github.com/org/mcp-server --json --quiet > results.json

详细介绍

🛡️ 代理审计

AI代理包安全扫描程序-CLI+MCP服务器

扫描MCP服务器、人工智能技能和软件包是否存在漏洞,及时注入, 以及供应链攻击。由正则表达式静态分析和深度LLM审计提供支持。

![AgentAudit](https://www.agentaudit.dev/packages/agentaudit-mcp) ](https://www.npmjs.com/package/agentaudit) ![Trust Registry](https://agentaudit.dev) ![License](LICENSE)

______________________________________________________________________

📑 目录

______________________________________________________________________

什么是AgentAudit?

AgentAudit是专为AI软件包生态系统构建的安全扫描器。它以两种模式工作:

  1. CLI工具 --快跑 agentaudit 在您的终端中发现并扫描安装在AI编辑器中的MCP服务器
  2. MCP服务器 --添加到Claude Desktop、Cursor或Windsurf,以便您的AI代理可以代表您审核包

它根据以下内容检查包裹 代理审计信托登记处 --一个共享的、社区驱动的安全发现数据库,可以执行从快速正则表达式分析到深度LLM驱动的3遍审计的本地扫描。

______________________________________________________________________

🚀 快速开始

选项A:CLI(推荐)

# Install globally (or use npx agentaudit)
npm install -g agentaudit

# Discover MCP servers configured in your AI editors
agentaudit

# Quick scan — clones repo, checks code with regex patterns (~2s)
agentaudit scan https://github.com/owner/repo

# Deep audit — clones repo, sends code to LLM for 3-pass analysis (~30s)
agentaudit audit https://github.com/owner/repo

# Registry lookup — check if a package has been audited before (no cloning)
agentaudit lookup fastmcp

输出示例:

  ◆ AgentAudit v3.13.4  │  my-scanner · #3 · 280pts · 19 audits

  Discovering MCP servers in your AI editors...

•  Scanning Cursor  ~/.cursor/mcp.json    found 3 servers

├──  tool   supabase-mcp              ✔ ok
│   SAFE  Risk 0  https://agentaudit.dev/packages/supabase-mcp
├──  tool   browser-tools-mcp         ✔ ok
│   ⚠ not audited  Run: agentaudit audit https://github.com/nichochar/browser-tools-mcp
└──  tool   filesystem                ✔ ok
│   SAFE  Risk 0  https://agentaudit.dev/packages/filesystem

  Looking for general package scanning? Try `pip audit` or `npm audit`.
增强横幅: 登录后,横幅显示您的代理姓名、排名、积分和审核计数。跑 agentaudit setup 创建一个帐户。

选项B:AI编辑器中的MCP服务器

将AgentAudit添加为MCP服务器——然后,您的AI代理可以使用自己的LLM发现、扫描和审计包。 不需要额外的API密钥。

Claude Desktop — ~/.claude/mcp.json

{
  "mcpServers": {
    "agentaudit": {
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  }
}

Cursor — .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

{
  "mcpServers": {
    "agentaudit": {
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  }
}

Windsurf — ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "agentaudit": {
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  }
}

VS Code — .vscode/mcp.json

{
  "servers": {
    "agentaudit": {
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  }
}

Continue.dev — ~/.continue/config.json

添加到 mcpServers 您现有配置的部分:

{
  "mcpServers": [
    {
      "name": "agentaudit",
      "command": "npx",
      "args": ["-y", "agentaudit", "--stdio"]
    }
  ]
}

Zed — ~/.config/zed/settings.json

{
  "context_servers": {
    "agentaudit": {
      "command": {
        "path": "npx",
        "args": ["-y", "agentaudit", "--stdio"]
      }
    }
  }
}

然后问你的经纪人: *“检查我安装了哪些MCP服务器,并审核任何未经审核的服务器。”*

______________________________________________________________________

📋 命令参考

扫描和审核

命令描述示例
agentaudit发现MCP服务器(默认设置,与 discover)agentaudit
agentaudit discover在Cursor、Claude、VS Code、Windsurf中查找MCP服务器agentaudit discover
agentaudit discover --quick发现+自动扫描所有服务器agentaudit discover --quick
agentaudit discover --deep发现+交互式选择服务器进行深度审计agentaudit discover --deep
agentaudit scan 基于正则表达式的快速静态扫描(~2s)agentaudit scan https://github.com/owner/repo
agentaudit scan --deep深度审计(与 audit)agentaudit scan https://github.com/owner/repo --deep
agentaudit audit 深度LLM驱动的三通审核+验证(~45秒)agentaudit audit https://github.com/owner/repo
agentaudit audit --verify cross审核+跨模型验证(不同模型验证)agentaudit audit --verify cross
agentaudit audit --remote通过agentaudit.dev进行服务器端扫描(无需LLM密钥,每天免费3次)agentaudit audit --remote
agentaudit consensus 包的跨模型共识视图agentaudit consensus supabase-mcp
agentaudit lookup 在信任注册表中查找包agentaudit lookup fastmcp
agentaudit history显示本地审核历史记录agentaudit history

社区

命令别名描述
agentaudit dashboarddash交互式全屏TUI,有5个选项卡(概述、排行榜、基准、活动、搜索)
agentaudit leaderboardlb顶级贡献者排名(管道友好型)
agentaudit benchmarkbenchLLM模型审计绩效比较
agentaudit activitymy您最近的审计和发现
agentaudit search find按名称、ASF-ID或哈希在注册表中搜索包

配置

命令别名描述
agentaudit model--交互式LLM提供者+模型配置
agentaudit setuplogin使用GitHub OAuth登录或手动粘贴API密钥
agentaudit statuswhoami显示当前配置、API密钥和个人统计信息

全球旗帜

标志描述
--json将机器可读的JSON输出到stdout
--quiet / -q抑制横幅和装饰输出
--no-color禁用ANSI颜色(也尊重 NO_COLOR ) 。
--model 覆盖此运行的LLM模型
--models 多模型审计(并行调用、共识比较)
--verify 对抗性验证: self (同一型号), cross (不同型号),或 ``。自动启用注册表上传。
--no-verify跳过验证和注册表上传(仅本地扫描)
--remote使用agentaudit.dev服务器进行扫描(不需要本地LLM密钥)
--no-upload跳过将报告上传到注册表
--export将审计有效负载导出为降价
--debug显示解析错误时的原始LLM响应
--help / -h显示帮助文本
-v / --version显示版本

退出代码

代码含义
0干净--未检测到任何结果,或查找成功
1检测到的结果
2错误(克隆失败、网络错误、参数无效)

______________________________________________________________________

⚖️ 快速扫描与深度审计

快速扫描(scan)深度审计(audit)
速度约2秒约30秒
方法正则表达式模式匹配LLM驱动的3遍分析
需要API密钥是(Anthropic、OpenAI或OpenRouter)
假阳性更高(正则表达式限制)非常低(上下文感知)
发现常见模式(注入、秘密、评估)复杂的攻击链、特定于AI的威胁、混淆
最适合快速分类、CI管道关键包、预生产审查

提示: 使用 agentaudit scan --deep 通过扫描命令运行深度审计。

______________________________________________________________________

🔌 MCP服务器

当作为MCP服务器运行时,AgentAudit向您的AI代理公开以下工具:

工具说明
audit_package基于LLM的深度存储库审计
check_registry在信任注册表中查找包
submit_report将审计结果上传到注册表
discover_servers在本地编辑器配置中查找MCP服务器
consensus_analysis包的跨模型共识视图
search_packages按名称、ASF-ID或哈希在注册表中搜索包
scan_tool_poisoning在MCP工具描述中检测工具中毒

工作流程

User asks agent to install a package
         │
         ▼
Agent calls check_registry(package_name)
         │
    ┌────┴────┐
    │         │
  Found    Not Found
    │         │
    ▼         ▼
 Return    Agent calls audit_package(repo_url)
 score        │
              ▼
         LLM analyzes code (3-pass)
              │
              ▼
         Agent calls submit_report(findings)
              │
              ▼
         Return findings + risk score

______________________________________________________________________

🎯 它检测到什么

核心安全

Command Injection Credential Theft Data Exfiltration SQL Injection Path Traversal Unsafe Deserialization

AI专用

Prompt Injection Jailbreak Agent Impersonation Capability Escalation Context Pollution Hidden Instructions

MCP特定

Tool Poisoning Desc Injection Resource Traversal Unpinned npx Broad Permissions

坚持与困惑

Crontab Mod Shell RC Inject Git Hook Abuse Zero-Width Chars Base64 Exec ANSI Escape

______________________________________________________________________

🧠 三通审核的工作原理

深度审计(agentaudit audit)使用结构化的三相LLM分析——不是单次射击提示,而是严格的多遍过程:

阶段名称发生了什么
1🔍 理解读取所有文件并构建 包装简介目的、类别、预期行为、信任界限。还没有扫描——目标是了解包裹的内容 *应该* 在寻找它之前先做 *不应该*.
2🎯 检测证据收集 50+检测模式 跨8个类别(AI特定、MCP、持久性、混淆、跨文件相关性)。只记录了事实,还没有严重性判断。
3⚖️ 分类每一个发现都要经过一个 强制性自检 (5个问题), 可利用性评估,以及 信心门控高/关键发现必须经受住考验 魔鬼代言人 挑战并包含完整 推理链.

为什么是3次传球? 单程分析是假阳性的首要原因。通过分离理解→ 检测→ 分类:

  • 第一阶段防止将核心功能标记为可疑(例如,数据库工具中的SQL执行)
  • 第二阶段确保收集的证据没有严重性偏差
  • 第三阶段在假阳性到达报告之前发现假阳性

该架构实现了 0%假阳性 在我们的11包测试集上,这一比例低于v2中的42%。

对抗验证通行证(v3.14+)

经过三级审核后 验证通行证 对照实际源代码重新检查每个发现。 上传到注册表时自动启用验证 以确保数据质量。对于仅本地扫描,请使用 --no-verify 跳过它(这也会禁用注册表上传)。

# Verification runs automatically when uploading (default behavior)
agentaudit audit https://github.com/owner/repo

# Explicit verification mode
agentaudit audit https://github.com/owner/repo --verify cross

# Skip verification + upload (local-only, fast)
agentaudit audit https://github.com/owner/repo --no-verify

每个发现都要经过一个5点检查表:

  1. 代码存在 --引用的代码是否确实存在于文件中?
  2. 上下文准确性 --代码是否按照描述的方式使用?
  3. 执行模型 --攻击者真的能触发这个吗?
  4. 严重性校准 --严重程度是否合适?
  5. 制造检查 --是否存在幻觉般的细节?

判决: verified (确认为真实), demoted (严重程度降低), rejected (去除假阳性)。

为什么上传需要验证? LLM可能会产生不存在的代码幻觉或夸大严重性。如果不进行验证,误报就会进入公共注册表,并不公平地将包标记为不安全。验证通行证会在这些记录成为永久记录之前将其捕获。

模型精度(真实世界数据)

我们对多个LLM进行了基准测试 20款最受欢迎的MCP服务器 (62+份报告):

模型前20名发现精度评估
克劳德作品4.60个发现(全部干净)N/A非常保守——是避免误报的理想选择
双子座2.5闪光灯许多发现~30%严格假阳性率高——不建议用于生产审核
关键见解: 模型选择对审计质量有显著影响。我们建议使用Claude Opus 4或Claude Sonnet 4进行生产审核。使用 --models 运行多个模型并通过以下方式比较结果 consensus.

______________________________________________________________________

🔄 CI/CD集成

AgentAudit专为具有适当退出代码和JSON输出的CI管道而设计:

# GitHub Actions example
- name: Scan MCP servers
  run: |
    npx agentaudit scan https://github.com/org/mcp-server --json --quiet > results.json
    # Exit code 1 = findings detected → fail the build
# Shell scripting
agentaudit scan https://github.com/owner/repo --json --quiet 2>/dev/null
if [ $? -eq 1 ]; then
  echo "Security findings detected!"
  exit 1
fi

JSON输出示例

# Scan with JSON output
agentaudit scan https://github.com/owner/repo --json
{
  "slug": "repo",
  "url": "https://github.com/owner/repo",
  "findings": [
    {
      "severity": "high",
      "title": "Command injection risk",
      "file": "src/handler.js",
      "line": 42,
      "snippet": "exec(`git ${userInput}`)"
    }
  ],
  "fileCount": 15,
  "duration": "1.8s"
}
# Registry lookup with JSON
agentaudit lookup fastmcp --json
马上就来: --fail-on 标记以设置非零退出的最小严重性阈值(例如。, --fail-on high 忽略低/中发现)。

______________________________________________________________________

📊 仪表板和社区

AgentAudit包括一个全屏交互式仪表板和独立的社区命令。

交互式仪表板

agentaudit dashboard    # or: agentaudit dash

5标签TUI,带键盘导航(←→标签,↑↓ 滚动,1-5跳,q退出)。 概述选项卡包括 交互式快速操作 --直接从仪表板选择并启动审核、共识视图或远程扫描:

选项卡内容
\[1\] 概述您的个人资料+注册表统计数据+交互式快速操作(按a/v/r/c或Enter)
\[2\] 排行榜奖牌排名和柱状图的顶级贡献者
\[3\] 基准LLM模型审计绩效比较
\[4\] 活动您最近的审计和发现
\[5\] 搜索交互式包裹搜索(键入搜索,输入提交)

独立命令

所有社区命令都可以在没有仪表板的情况下工作(管道友好,支持 --json):

agentaudit leaderboard              # Top contributors
agentaudit leaderboard --tab monthly --json   # Monthly rankings as JSON
agentaudit benchmark                # Model comparison
agentaudit activity                 # Your recent audits & findings
agentaudit search fastmcp           # Search registry by name/ASF-ID
agentaudit search fastmcp --json    # Machine-readable search results

______________________________________________________________________

⚙️ 配置

凭证

AgentAudit将凭据存储在 ~/.config/agentaudit/credentials.json (或 $XDG_CONFIG_HOME/agentaudit/credentials.json).

agentaudit setup 使用GitHub登录或粘贴API密钥,或通过环境设置:

export AGENTAUDIT_API_KEY=asf_your_key_here

法学硕士提供者(支持13个)

AgentAudit支持13家LLM提供商进行深度审计。设置一个API密钥-CLI自动检测它。使用 agentaudit model 以交互方式选择提供者+模型,或 agentaudit status 检查您的设置。

变量提供者默认模型
ANTHROPIC_API_KEY人类学(克劳德)claude-sonnet-4-20250514
GEMINI_API_KEY谷歌(双子座)gemini-2.5-flash
OPENAI_API_KEYOpenAI(GPT-4o)gpt-4o
DEEPSEEK_API_KEYDeepSeekdeepseek-chat
MISTRAL_API_KEY米斯特拉尔mistral-large-latest
GROQ_API_KEYGroqllama-3.3-70b-versatile
XAI_API_KEYxAI(格罗克)grok-3
TOGETHER_API_KEY一起AILlama-3.3-70B-Instruct-Turbo
FIREWORKS_API_KEY烟花AIllama-v3p3-70b-instruct
CEREBRAS_API_KEY大脑llama-3.3-70b
ZAI_API_KEY智普AI(GLM)glm-4.7
OPENROUTER_API_KEYOpenRouteranthropic/claude-sonnet-4

其他环境变量

变量描述
AGENTAUDIT_API_KEY用于注册表上载的API密钥(或使用 agentaudit setup)
AGENTAUDIT_MODEL覆盖LLM模型(与 --model 旗帜)
NO_COLOR禁用ANSI颜色(no-color.org)
提供商优先级:preferred_provider 通过 agentaudit model,或者CLI选择第一个可用密钥。每次运行覆盖 --model .

______________________________________________________________________

📦 需求

  • Node.js ≥ 18.0.0
  • Git (用于在扫描/审核期间克隆存储库)

______________________________________________________________________

❓ 常见问题解答

如何设置AgentAudit?

npm install -g agentaudit
agentaudit setup

或者在不安装的情况下使用: npx agentaudit

我需要API密钥吗?

  • 快速扫描 (scan):不需要API密钥-使用regex在本地运行
  • 深度审计 (audit):需要LLM API密钥(请参见下文)
  • 注册表查找 (lookup):阅读无需钥匙;上传报告所需的密钥
  • MCP服务器:不需要额外的键--使用宿主编辑器的LLM

设置LLM密钥以进行深度审核

audit 命令支持 13名法学硕士提供者.设置一个API密钥,AgentAudit自动检测该密钥:

# Set any one of these (Anthropic recommended)
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...
export GEMINI_API_KEY=...
export DEEPSEEK_API_KEY=...
# ... or any of the 13 supported providers (see Configuration section)

交互式设置:

agentaudit model     # 2-step menu: pick provider → pick model
agentaudit status    # check which keys are set + current config

每次运行覆盖:

agentaudit audit https://github.com/owner/repo --model gpt-4o

故障排除: 如果你看到 API error: Incorrect API key,请仔细检查您的密钥是否有效,是否有积分。使用 --debug 查看API的完整响应。

哪些数据被发送到外部?

  • 注册表查找:包名/slug发送到 agentaudit.dev 检查现有审计
  • 报告上传:审核结果上传到公共注册表(需要API密钥)
  • 深度审计:源代码被发送到Anthropic或OpenAI进行LLM分析
  • 快速扫描:一切都是本地的,没有数据离开你的机器

我可以离线使用它吗?

快速扫描(agentaudit scan)克隆后完全脱机工作。注册表查找和深度审计需要网络访问。

我可以在没有CLI的情况下将其用作MCP服务器吗?

对! npx agentaudit 当编辑器调用时,启动MCP服务器。CLI和MCP服务器是同一个包——行为取决于它的调用方式。

如何 discover 知道我使用哪些编辑器吗?

它检查Claude Desktop、Cursor、VS Code和Windsurf的标准配置文件位置。它还检查项目级别的当前工作目录 .cursor/mcp.json.vscode/mcp.json.

______________________________________________________________________

🔗 相关

项目描述
🌐agentaudit.dev信任注册表--浏览包、调查结果、排行榜
🛡️代理审计技能代理技能——为Claude Code、Cursor、Windsurf预装安全门
GitHub操作--CI/CD安全扫描
📚代理审计cli此仓库--CLI+MCP服务器源代码
🐛报告问题Bug报告和功能请求

______________________________________________________________________

📄 许可证

AGPL-3.0 --免费开源使用。商业许可证可用于专有集成。

______________________________________________________________________

保护您的AI堆栈。先扫描再信任。

目录标签

目录标签

安全JavaScriptClaude漏洞检测安全扫描本地部署AI包审计LLM分析供应链安全

支持客户端

Claude DesktopClaudeCursorWindsurfVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

oauth

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

agentaudit

工具数量(toolCount,工具数)

7

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiooauth部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP