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 分