A2a Auditor

io.github.GuardBee由 GitHub 账号 GuardBee 发布v0.3.1更新于 Nov 3, 2026

Scans Agent2Agent (A2A) protocol code for webhook SSRF, missing auth, and credential exposure

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

本地 MCP 服务器,扫描 Agent2Agent(A2A)代理源码中的 Webhook SSRF、缺少认证和凭据泄露问题。

可以做什么
  • 扫描代码片段、单个文件或递归扫描整个目录中的 A2A 协议反模式
  • 按类别列出检测到的全部模式及其严重级别
  • 在 TypeScript 和 Python 的 A2A 代码中报告 Webhook SSRF、缺少认证和凭据泄露
  • 通过 SARIF 输出和 guardbee.yml 配置文件支持 CI 场景
适用场景
适合在开发或审查 A2A 代理时,上线前对参考 SDK 中归纳出的三类反模式做一次快速静态检查。它是启发式扫描器,并非针对运行中代理的协议一致性测试。
运行要求
作为本地进程运行,通常用 npx 启动 npm 包 @guardbee/mcp-a2a-auditor,因此需要 Node.js 以及下载该包的网络访问。未声明需要账号、API 密钥或请求头。
安装前请注意
扫描器会读取你指定的源码文件。遥测默认关闭;设置 GUARDBEE_TELEMETRY=1 后会把服务器、工具、成功与否、耗时以及文件路径等短参数值发送给提供方,较长字符串及 content、token、password 等字段会替换为占位符。检测为启发式,可能漏掉改名或间接构造的代码。

安装

在 SourceWeft 中

  1. 打开 控制台中的 A2a Auditor,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@guardbee/mcp-a2a-auditor

[Listed on AgentHub]

🇬🇧 English | 🇹🇷 Türkçe | 🇨🇳 中文 | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇧🇷 Português | 🇪🇸 Español | 🇩🇪 Deutsch

[npm version] [npm downloads] [License: MIT]

An MCP (Model Context Protocol) server that scans an agent's own Agent2Agent (A2A) protocol implementation for anti-patterns — not invented from the spec text, but read directly out of the reference SDKs (@a2a-js/sdk, a2a-sdk) and their own official sample code.

A2A doesn't have an MCP-style "Security Considerations" section yet to quote. So instead of guessing, this package's patterns come from three things found in the reference SDK source itself: the official push-notification sender fetches a client-supplied webhook URL with no host check at all, the official sample agent ships with an empty security scheme and a literal noAuthentication request handler, and the Python SDK's AgentCard(...) constructor treats its two security kwargs as fully optional — silently meaning "no auth" if you don't pass them.

Telemetry is off by default. With GUARDBEE_TELEMETRY=1 it sends the server, tool, success, duration and short parameter values such as a file path; longer strings and fields like content, token or password are replaced with a placeholder. See @guardbee/mcp-telemetry.

Claude ──► a2a-auditor ──► Your A2A agent's source              │              ├─ webhook-ssrf            (push-notification webhook URL fetched with no allowlist)              ├─ missing-authentication  (Agent Card / request handler requires no auth at all)              └─ credential-exposure     (literal credential inside publicly-served Agent Card metadata)

Why these three specifically

Webhook SSRF because the reference DefaultPushNotificationSender does exactly const url = pushConfig.url; ... fetch(url, ...) — pushConfig.url is set by whichever client subscribed to task updates, and the SDK fetches it with zero host validation. A caller can point a server running this code at an internal service, a cloud metadata endpoint, or anything else reachable from the server's network.

Missing authentication because the SDK's own sample agent (src/samples/agents/movie-agent) ships with securitySchemes: {}, securityRequirements: [], and userBuilder: UserBuilder.noAuthentication — a copy-paste-friendly shape that looks like a placeholder but is, functionally, "accept every request from anyone." The Python SDK has the same failure mode via absence rather than an explicit empty value: AgentCard(...) never requires security_schemes/security_requirements, so a real agent built by following the reference examples can end up with no authentication and no error telling you so.

Credential exposure because an Agent Card is served publicly — anyone who can reach /.well-known/agent-card.json (or the equivalent discovery response) can read it, no authentication required to fetch the card itself. A literal API key sitting in that JSON is effectively public.


Features

  • 3 categories: webhook-ssrf, missing-authentication, credential-exposure
  • Both TypeScript and Python A2A code — the SDKs use different idioms for the same failure (empty object vs. absent kwargs), so this checks both, not just one language
  • Two of the six checks track data flow across a few lines instead of matching a single call site: the webhook check follows a url variable back to a pushConfig.url-shaped assignment before flagging the fetch() that uses it, and the credential check extracts the full Agent Card object span (brace-matched) before searching inside it for a literal secret — so it doesn't just flag any apiKey: anywhere in the file
  • SARIF 2.1.0 output — CI/CD integration (GitHub Code Scanning, etc.)
  • Config file support via guardbee.yml
  • 18 unit tests — a positive and a negative (false-positive) scenario for every pattern, including a regression test for a real bug found during development (\bAgentCard doesn't match inside movieAgentCard — no word boundary between a lowercase and uppercase letter — fixed to match the class name as a suffix instead). End-to-end verified against fixtures with all patterns deliberately planted in both TypeScript and Python (caught all of them), and against the entire guardbee-mcp monorepo (461 files — zero findings in any real code; the only matches were this package's own test fixtures, pattern-definition source, and manifest description text)

Quick Start

Claude Desktop / MCP Client

json
{  "mcpServers": {    "guardbee-a2a-auditor": {      "command": "npx",      "args": ["-y", "@guardbee/mcp-a2a-auditor"]    }  }}

CLI (CI/CD)

bash
npx @guardbee/mcp-a2a-auditor scan ./src --fail-on=high --format=sarif > results.sarif

MCP Tools

ToolDescription
scan_textScans a code snippet
scan_fileScans a single file
scan_directoryRecursively scans a directory
list_patternsLists all supported patterns by category

Detected Patterns

CategoryPatternSeverity
webhook-ssrfwebhook_url_direct_fetch_no_allowlistcritical
webhook-ssrfwebhook_url_indirect_fetch_no_allowlistcritical
missing-authenticationno_authentication_user_buildercritical
missing-authenticationempty_agent_card_securityhigh
missing-authenticationpython_agent_card_no_authhigh
credential-exposureagent_card_credential_in_metadatahigh

Configuration (guardbee.yml)

yaml
a2a-auditor:  fail-on: high       # any | critical | high | medium | none  max-files: 5000  exclude:    - ".test.ts"

Limitations (by design)

  • Heuristic, not a full A2A conformance test. This finds specific anti-patterns taken from the reference SDK's own source, not a live protocol conformance check against a running agent. A2A is a young, fast-moving spec — new failure modes will show up over time that aren't covered here yet.
  • The data-flow checks (indirect webhook fetch, Agent Card credential span) use a bounded text window and bracket-matching, not a real parser — a url variable assigned through a more indirect chain (e.g. passed through a helper function) won't be traced correctly, and neither will an Agent Card object spread across multiple Object.assign()-style merges instead of one literal.
  • Naming-convention dependent. The checks look for identifiers shaped like pushConfig.url, *AgentCard, UserBuilder.noAuthentication — code that renames these away from the SDK's own conventions won't be recognized, the same limitation every pattern-based scanner in this family has.

Development

bash
npm run buildnpm test             # 18 unit tests

License

MIT — GuardBee

Feedback

Questions, ideas, or a false positive? Start a thread in GitHub Discussions or open an issue. If GuardBee is useful to you, a ⭐ on the repository helps others find it.

来源:packages/a2a-auditor/README.md,提交 bc5997d

工具

4

scan_text

Scan Agent2Agent (A2A) protocol implementation code for anti-patterns found in the reference SDKs and sample agents: an Agent Card fetching a client-supplied push-notification webhook URL with no host allowlist (SSRF), a request handler wired up with no authentication at all, and a literal credential embedded directly in Agent Card metadata (which is served publicly).

输入参数labelcontent必填

scan_file

Scan a single file for A2A (Agent2Agent) protocol anti-patterns

输入参数path必填

scan_directory

Recursively scan a directory of A2A agent source for protocol anti-patterns

输入参数path必填excludeincludemaxFiles

list_patterns

List every A2A (Agent2Agent) protocol pattern this auditor detects, grouped by category

无需输入参数。

版本历史

3
  1. v0.3.1最新Oct 30, 2026
  2. v0.2.2Oct 22, 2026
  3. v0.1.2Oct 13, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分