scan_text
Scan a text string or code snippet for insecure AI/LLM integration patterns (client-exposed keys, unsafe output handling, excessive agent tool permissions, PII sent to a model, prompt injection surface).
labelcontent必填
io.github.GuardBee由 GitHub 账号 GuardBee 发布v0.5.1更新于 Nov 3, 2026
Scans code for insecure LLM/AI integration: exposed keys, unsafe output, prompt injection
扫描代码片段、文件和目录,发现 LLM/AI 集成中的不安全模式,如密钥暴露、输出处理不当和提示注入。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
参照 仓库 中的启动说明。
🇬🇧 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.
recommendation) — not just "found it"guardbee.ymlThese 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.
guardbee.yml)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.
MIT — GuardBee
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,提交 bc5997d
Scan a text string or code snippet for insecure AI/LLM integration patterns (client-exposed keys, unsafe output handling, excessive agent tool permissions, PII sent to a model, prompt injection surface).
labelcontent必填Scan a single file for insecure AI/LLM integration patterns
path必填Recursively scan a directory for insecure AI/LLM integration patterns. Automatically skips node_modules, .git, dist, and binary files.
path必填excludeincludemaxFilesList all AI/LLM security patterns that the scanner can detect, grouped by category (including any custom rules loaded from .guardbee/rules)
无需输入参数。
已满足适用检查项的 90%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
Claude ──► ai-code-scanner ──► Your codebase │ ├─ Client-exposure (dangerouslyAllowBrowser: true) ├─ Output handling (eval(llmOutput), unvalidated JSON.parse) ├─ Excessive agency (an agent tool named execute_command) ├─ Data privacy (email/national ID interpolated directly into a prompt) └─ Prompt injection (raw request data mixed into a system prompt){ "mcpServers": { "guardbee-ai-code-scanner": { "command": "npx", "args": ["-y", "@guardbee/mcp-ai-code-scanner"] } }}npx @guardbee/mcp-ai-code-scanner scan ./src --fail-on=high --format=sarif > results.sarifai-code-scanner: fail-on: high # any | critical | high | medium | low | none max-files: 5000 rules-dir: .guardbee/rules # custom rule packs, see below exclude: - ".test.ts" - "fixtures/"{ "id": "kvkk_musteri_tc_no", "name": "musteriTcNo interpolated into a prompt", "category": "data-privacy", "pattern": "musteriTcNo", "flags": "gi", "severity": "high", "recommendation": "Mask the national ID before it enters the prompt."}npm run buildnpm test # 36 unit tests