
Injectshield
io.github.bch1212由 GitHub 账号 bch1212 发布v0.1.4更新于 Oct 25, 2026
Prompt-injection firewall for AI agents — scan untrusted text before LLM calls.
概览
本地 MCP 服务器,将 InjectShield 提示注入检测 API 暴露为工具,让助手在把不可信文本或网页交给另一个 LLM 之前先做扫描。
- 可以做什么
- 扫描字符串中的提示注入,返回判定结果、置信度、威胁类别、命中的模式 ID,以及可选的红action 掉注入片段的净化版本。抓取 URL 并扫描其正文,自动按网页内容处理。列出支持的威胁类别、上下文类型和敏感度级别。
- 适用场景
- 当助手需要读取不可信文本、抓取的网页或文件,并希望在把内容送入另一个 LLM 调用前检查提示注入时适用。它是辅助防线,不能替代其他防护措施。
- 运行要求
- 通过 npx 从 npm 包 @injectshield/mcp 以本地 stdio 进程运行,需要 Node.js。需要在 INJECTSHIELD_API_KEY 环境变量中提供 API 密钥,可从厂商网站获取(免费额度标注为每月 1 万次请求)。可用 INJECTSHIELD_API_BASE 覆盖 API 基础地址以用于自托管部署。需要能访问 InjectShield API 的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Injectshield,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@injectshield/mcp
MCP server for InjectShield — exposes the InjectShield prompt-injection-detection API as MCP tools so any MCP-compatible client (Claude Code, Cursor, Cline, etc.) can scan untrusted text before passing it into another LLM call.
Tools
scan— Scan a string for prompt-injection. Returns verdict, confidence, threat category, matched pattern IDs, and an optional sanitized version with injection spans redacted.scan_url— Fetch a URL and scan its body. Sets context toweb_contentautomatically.patterns— List supported threat categories, context kinds, and sensitivity levels.
Get an API key
Free tier: 10,000 requests/month, no credit card. Self-serve at https://injectshield.dev — your key is delivered by email.
Install in Claude Code
Install in Cursor
Add to ~/.cursor/mcp.json:
Install in Cline / generic MCP client
Same shape as Cursor. Stdio transport, command npx -y @injectshield/mcp, set INJECTSHIELD_API_KEY in the env block.
Usage
Once installed, your agent has three new tools. Pattern-match this:
Before reading a fetched web page or file, call
scanwith the body and bail ifsafeisfalse. The cleaned variant incleaned_textis the safest thing to feed forward.
Example (model-side reasoning):
Configuration
Defense in depth
InjectShield reduces but does not eliminate prompt-injection risk. Pair it with system-prompt hardening, tool sandboxing, and output filtering. See the main repo for the full pattern library and a more thorough discussion.
License
MIT.
来源:packages/injectshield-mcp/README.md,提交 ec8eb5b
工具
0版本历史
1- v0.1.4最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分