
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 分