
Ai Code Scanner
io.github.4hmetuyar由 GitHub 帳號 4hmetuyar 發布v0.3.2更新於 Oct 24, 2026
Scans code for insecure LLM/AI integration: exposed keys, unsafe output, prompt injection
概覽
掃描程式碼片段、檔案或目錄,找出不安全的 LLM/AI 整合模式,例如金鑰外洩、輸出處理不當與提示注入。
- 可以做什麼
- 提供 scan_text、scan_file、scan_directory 與 list_patterns 等 MCP 工具,依 5 類共 10 種啟發式模式檢查程式碼:用戶端暴露、輸出處理、權限過大、資料隱私與提示注入。每筆發現都附有嚴重等級與處理建議。也支援自訂 JSON 規則包,以及供 CI/CD 使用的 SARIF 2.1.0 輸出。
- 適用情境
- 適合在審查或稽核會呼叫 LLM API 的程式碼庫時使用,可找出只掃描憑證的工具漏掉的風險,例如模型輸出被傳給 eval 或 shell、代理工具權限過大,或 PII 被直接寫入提示。也可透過其 CLI 用於 CI 流程。
- 執行需求
- 透過 stdio 在本機執行,通常以 npx 從 npm 套件 @guardbee/mcp-ai-code-scanner 啟動,因此需要 Node.js 以及下載套件的網路存取。未宣告需要帳號、API 金鑰或環境變數。可透過 guardbee.yml 進行選用設定。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Ai Code Scanner,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@guardbee/mcp-ai-code-scanner
🇬🇧 English | 🇹🇷 Türkçe | 🇨🇳 中文 | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇧🇷 Português | 🇪🇸 Español | 🇩🇪 Deutsch
[npm version] [npm downloads] [License: MIT]
An MCP (Model Context Protocol) server that scans your codebase for security patterns commonly found in LLM/AI integrations.
While secret-scanner looks for leaked secrets/API keys, this package looks for patterns: how much a model's output is trusted, how privileged the tools it can call are, what data is sent to a third-party LLM — risks that a static credential scan can't catch.
Telemetry is off by default. With
GUARDBEE_TELEMETRY=1it sends the server, tool, success, duration and short parameter values such as a file path; longer strings and fields likecontent,tokenorpasswordare replaced with a placeholder. See@guardbee/mcp-telemetry.
Features
- 10 patterns, 5 categories — client-exposure, output-handling, excessive-agency, data-privacy, prompt-injection
- Every finding includes why it's risky and what to do about it (
recommendation) — not just "found it" - SARIF 2.1.0 output — CI/CD integration (GitHub Code Scanning, etc.)
- Config file support via
guardbee.yml - Custom rule packs — extend detection with org-specific patterns (KVKK/GDPR field names, internal tool names) via JSON files, no fork required
- 36 unit tests — a positive and a negative (false-positive) scenario for every built-in pattern, plus custom-rule loading/validation
Quick Start
Claude Desktop / MCP Client
CLI (CI/CD)
MCP Tools
Detected Patterns
These are heuristic findings — a static text-pattern scan, not a full AST analysis. Designed for a low false-positive rate, but every finding should still be reviewed manually.
Configuration (guardbee.yml)
Custom rules
Built-in patterns cover common AI/LLM integration mistakes, but field names and
internal conventions (e.g. which prop names carry KVKK-regulated data) are
project-specific. Drop one or more JSON files into .guardbee/rules/
(configurable via rules-dir) and they're merged with the built-ins at scan
time — for both the CLI and the MCP server (list_patterns marks them (custom)).
A file holds a single rule object or an array of them:
category is one of client-exposure | output-handling | excessive-agency | data-privacy | prompt-injection | cost-control; severity is one of
critical | high | medium | low. pattern is a JS regex source string
(flags defaults to "g"). A rule id that collides with a built-in or
another custom rule is rejected — the scanner keeps running but reports the
problem on stderr and skips that entry.
Development
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/ai-code-scanner/README.md,提交 040e072
工具
0版本歷史
1- v0.3.2最新Sep 29, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分