Agent Graph Auditor

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

Finds transitive excessive agency across LangGraph/CrewAI/AutoGen orchestration graphs

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

概览

AI 生成的概览

静态分析类 MCP 服务器,扫描 Python 多智能体编排代码,找出可经由委派触达的过度代理权限,包括跨智能体的传递路径。

可以做什么
  • 扫描 Python 代码片段、单个 .py 文件或整个目录,检查 LangGraph、CrewAI 与 AutoGen/ag2 编排中的过度代理权限路径
  • 区分直接发现(智能体自身持有危险工具)与传递发现(通过委派或群组成员关系触达危险工具),并给出完整路径
  • 列出审计器检查的危险能力规则,按类别分组
  • 说明 LangGraph 的结构化边与 CrewAI/AutoGen 的启发式推断,并提示单文件分析的范围限制
适用场景
适合在审查基于 LangGraph、CrewAI 或 AutoGen 的多智能体 Python 项目时使用,判断看似无害的智能体是否能通过其他智能体触达 shell、代码执行、写文件、网络或凭据类工具。也适合在部署前对智能体源码做例行检查。
运行要求
以本地 stdio 进程运行,通常通过 npx 启动 npm 包 @guardbee/mcp-agent-graph-auditor,因此需要 Node.js 以及下载该包的网络访问。未声明任何认证、环境变量或请求头。读取本机上的 Python 源文件。
安装前请注意
结果是启发式的,并非事实结论:能力识别基于工具名称,CrewAI/AutoGen 的提取也是近似的,需人工复核。每个文件独立分析,跨文件的委派关系会被漏掉。遥测默认关闭;设置 GUARDBEE_TELEMETRY=1 后会把服务器、工具、成功与否、耗时以及文件路径等短参数值发送给第三方,较长字符串及 content、token、password 等字段会被替换为占位符。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@guardbee/mcp-agent-graph-auditor

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

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

An MCP (Model Context Protocol) server that builds a reachability graph across a multi-agent orchestration and finds transitive excessive agency — an agent that was never directly given a dangerous tool, but can still reach one through another agent it's allowed to delegate to.

mcp-server-auditor catches an MCP server whose own tool grants shell/eval/SQL access directly. ai-code-scanner catches a single agent's tool list containing execute_command. Both of those are one hop: agent → tool. Multi-agent frameworks add a second kind of edge — delegation, group chat, function-execution routing — and a "safe-looking" agent with only a web_search tool can become dangerous the moment it's allowed to hand work off to a coworker that holds a shell tool. That two-hop path is invisible to a scanner that only looks at one agent's own tool list at a time.

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 ──► agent-graph-auditor ──► Your multi-agent Python source              │              ├─ LangGraph   (add_node/add_edge — structural, read directly from the graph API)              ├─ CrewAI      (Agent/tools/allow_delegation + Crew membership — heuristic)              └─ AutoGen/ag2 (GroupChat membership, code_execution_config, register_function — heuristic)

How the graph is built

  1. Extract. Framework-specific regex extractors pull agent/tool nodes and relationship edges out of the source: has_tool (an agent's own toolset), delegates_to (CrewAI allow_delegation, LangGraph add_edge), group_member (AutoGen GroupChat co-membership — any member's output can be routed to any other by the manager), executes_via (AutoGen register_function's caller/executor split).
  2. Classify. Every tool node is checked against a name-based capability catalog (code execution, process execution, filesystem write, network, credentials access) — the same kind of heuristic ai-code-scanner's excessive-agency pattern uses, just applied to a graph of tools instead of one server's tool list.
  3. Reach. A breadth-first search runs from every agent node. A capability tool reached via a straight has_tool edge is a direct finding (still reported — useful even without a second agent in the picture). A capability tool reached only after crossing at least one delegates_to/group_member/executes_via edge is transitive — the finding this package exists for — and is always reported as critical, regardless of the tool's own base severity, because the agent holding it was never audited for it directly.

LangGraph is the most reliable target: add_node/add_edge calls are the orchestration graph in the source, no inference needed. CrewAI and AutoGen require inferring delegation from framework semantics (allow_delegation, GroupChat membership) rather than an explicit edge in the code, so treat those as heuristic — see Limitations below.


Features

  • 3 frameworks: LangGraph (structural), CrewAI (heuristic), AutoGen/ag2 (heuristic)
  • 7 capability rules across 5 categories (code-execution, process-execution, filesystem-write, network, credentials-access)
  • Distinguishes direct (single-agent) from transitive (delegation-crossing) excessive agency — the transitive case is what no single-agent scanner in this monorepo catches
  • Multi-hop aware — a 3+ agent delegation chain is found the same way a 2-agent one is
  • SARIF 2.1.0 output — CI/CD integration (GitHub Code Scanning, etc.)
  • Config file support via guardbee.yml
  • 31 unit tests, plus end-to-end verification against realistic fixtures for all three frameworks

Quick Start

Claude Desktop / MCP Client

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

CLI (CI/CD)

bash
npx @guardbee/mcp-agent-graph-auditor scan ./agents --fail-on=high --format=sarif > results.sarif

MCP Tools

ToolDescription
scan_textScans a Python snippet
scan_fileScans a single .py file
scan_directoryRecursively scans a directory of .py files
list_patternsLists the dangerous-capability catalog by category

Example

python
researcher = Agent(role="Researcher", tools=[web_search_tool], allow_delegation=True)ops = Agent(role="Ops Engineer", tools=[shell_tool], allow_delegation=False)writer = Agent(role="Writer", tools=[], allow_delegation=False)crew = Crew(agents=[researcher, ops, writer], tasks=[])

researcher never holds shell_tool — but allow_delegation=True plus co-membership in the same Crew as ops means it can hand work off to an agent that does. This scanner reports:

🔴 CRITICAL  Transitive excessive agency: reaches shell_tool   Path: Researcher → Ops Engineer → shell_tool
🔴 CRITICAL  Direct excessive agency: reaches shell_tool   Path: Ops Engineer → shell_tool

writer — no tools, no delegation — gets no finding at all.


Configuration (guardbee.yml)

yaml
agent-graph-auditor:  fail-on: high       # any | critical | high | medium | none  max-files: 2000  exclude:    - ".test.py"

Limitations (by design)

  • Single-file scope. Each file's graph is extracted independently — Python variable references don't resolve across files. A Crew(agents=[researcher, ops]) call will only connect to Agent(...) definitions found in the same file, even when scanning a whole directory.
  • CrewAI/AutoGen extraction is heuristic, not a real Python parser — constructor bodies are captured with a bounded text window rather than exact paren-matching (the same tradeoff ai-code-scanner's pattern-window matching makes), and it doesn't track reassignment, conditional agent construction, or dynamically built tool lists.
  • AutoGen's speaker_selection_method isn't modeled — GroupChat co-membership is always treated as a bidirectional reachability edge, which is the conservative (over-inclusive, not under-inclusive) assumption.
  • Capability classification is name-based. A tool named search_tool that secretly shells out internally won't be flagged; a tool named shell_tool_disabled will be. Review findings; don't take them as ground truth.
  • Only Python source is scanned in v1 — LangChain/LangGraph's JS/TS API isn't covered yet.

Development

bash
npm run buildnpm test             # 31 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/agent-graph-auditor/README.md,提交 bc5997d

工具

4

scan_text

Scan a Python snippet defining a multi-agent orchestration (LangGraph, CrewAI, or AutoGen/ag2) for excessive agency reachable through delegation or group membership — an agent with no dangerous tool of its own that can still reach one (shell/code-exec/file-write/network/credentials) through another agent it can hand off to.

输入参数labelcontent必填

scan_file

Scan a single Python file for excessive-agency paths across LangGraph/CrewAI/AutoGen orchestration constructs

输入参数path必填

scan_directory

Recursively scan a directory of Python files and report excessive-agency paths found in each. Each file's agent/tool graph is analyzed independently — variable references don't resolve across files, so a Crew/GroupChat whose members are defined in a different file than the assembling call won't be connected.

输入参数path必填excludeincludemaxFiles

list_patterns

List every dangerous-capability rule this auditor looks for at the end of a delegation path, grouped by category

无需输入参数。

版本历史

4
  1. v0.3.1最新Oct 30, 2026
  2. v0.2.2Oct 22, 2026
  3. v0.2.1Oct 22, 2026
  4. v0.1.3Oct 13, 2026

评分

已满足适用检查项的 90%

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

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

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

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