Agent Firewall Mcp

io.github.mlawsonking由 GitHub 账号 mlawsonking 发布v1.3.0更新于 Oct 24, 2026

Input/output safety for AI agents: known-pattern injection and obfuscation scan, URL/IP, secrets.

概览

AI 生成的概览

一个本地 MCP 服务器,在内容进入模型前为 AI 代理筛查不可信文本、URL、IP、密钥和密码。

可以做什么
扫描文本或抓取的 URL,匹配已知提示注入与越狱模式及混淆手法,返回 allow、review 或 block 及触发的规则 ID,并给出脱敏副本:密钥值被替换、标签保留,PEM 块整体移除。检查 URL 或域名的安全性,依据结构启发式、RDAP 域名年龄和重定向后的最终 URL,返回 safe、suspicious 或 malicious。检查 IP 地址的 Tor 出口节点、ASN 与组织、反向 DNS、类数据中心组织名以及一次 Spamhaus ZEN 查询。用 k-匿名方式对照 HIBP 已泄露密码库检查密码,明文不离开本机。
适用场景
适合在助手读取网页、工具输出、文件或用户输入等外部内容时,在内容到达模型前做一次确定性的、非 LLM 的预检。也适合快速检查 URL、IP 和密码卫生。它是模式匹配器,应视为一层防护而非保证。
运行要求
作为本地 stdio 进程运行,通常通过 npx 启动。URL、IP 和密码检查以及每日规则源更新需要网络访问;可用 --offline、AGENT_GUARDS_NO_FEED=1 或配置项关闭更新。未声明需要账户或 API 密钥。
安装前请注意
干净的结果并不证明内容安全:新表述、未列出的厂商和同形字仿冒可能漏过。只复查重定向的最终 URL,Spamhaus 查询无结论时判定与干净结果相同。密码检查会向 HIBP 发送 k-匿名前缀。服务器会联系远程规则源和 API 端点,并在未禁用时自动应用已签名的规则更新。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Agent Firewall Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

agent-firewall-mcp

An MCP server that treats every external input as untrusted. It matches text against known prompt-injection patterns, checks URLs and IPs, screens for leaked secrets and PII, and checks passwords against known breaches. Deterministic, no LLM, free.

The basic rule for agent security (OWASP's LLM01) is to treat anything the agent reads from the outside as potentially hostile: web pages, tool output, files, user input. These are the checks for doing that at the point where the content comes in, before it reaches the model.

Install

json
{ "mcpServers": { "agent-firewall": { "command": "npx", "args": ["-y", "agent-firewall-mcp"] } } }

Tools

  • scan_content: match text or a fetched URL against 11 known prompt-injection and jailbreak patterns, plus 5 obfuscation checks (zero-width characters, bidi tricks, the Unicode tag block, CSS-hidden text, HTML-comment instructions). Returns allow, review, or block, and the rule IDs that fired. It is a pattern matcher, not a classifier: a novel phrasing or a paraphrase will not be caught, and allow means nothing matched rather than that the content is safe.
  • scan_secrets: match text against 22 secret patterns — AWS access key ids, GitHub tokens, OpenAI, Anthropic, Google API keys, Slack, Stripe live secret keys, Twilio, npm tokens, JWTs, PEM private-key blocks, Azure storage keys, SAS tokens and AD client secrets, GCP service-account key ids and OAuth refresh tokens, database and ODBC connection-string passwords, SendGrid, GitLab, Hugging Face, and a generic key = "value" assignment — and 3 PII patterns: email, US SSN, Luhn-checked card numbers. A credential from a vendor not on that list is not found unless it happens to be written as one of those assignments, and that rule is narrow: api-key = "abc12345" matches, {"api_key": "abc12345"} does not, and an unquoted value does not. A clean result is not proof the text is clean. Returns the findings (masked) and a redacted copy: the secret value is replaced and the label stays, api_key = "[REDACTED:Generic Secret Assignment]". The line is not dropped and the document is not scrubbed. A PEM block is removed in full.
  • check_url: URL and domain safety, using structural heuristics (punycode host, 14 known shorteners, 23 abuse-prone TLDs, raw-IP host, credentials in the URL, brand lookalikes), domain age from RDAP, and the final URL after redirects. "Brand lookalike" is a substring test — one of 14 brand names in the hostname that is not the registrable domain, like paypal.com.secure-login.tk. It is not edit distance and not homoglyphs, so paypa1.com gets past it. Only the final URL is re-checked, not every hop, and its flags only count when the redirect lands on a different host. Domain age is looked up for the host you passed in, not the host you land on. Returns safe, suspicious, or malicious.
  • check_ip: IP reputation, covering Tor exit nodes (Tor Project bulk exit list), ASN and org (via Team Cymru), reverse DNS, whether the org name looks like a datacenter, and one DNSBL lookup: Spamhaus ZEN, IPv4 only. Spamhaus refuses queries from many cloud resolvers, so the lookup can be inconclusive; that comes back as listed: null with a note and adds nothing to the score. Only listed: true moves the verdict, so an inconclusive lookup ends up with the same verdict as a clean one — read blocklist.listed rather than the verdict alone.
  • check_password: check a password against HIBP's Pwned Passwords using k-anonymity, so the plaintext never leaves the server.

Rule updates

About once a day this server asks the rules feed whether there is a newer ruleset, and applies it if there is. The request carries two things: which surface asked, which here is facade, and the rules version already installed. No machine id, no user id, no file names, nothing you scanned.

Bundles are signed with Ed25519 and verified against a public key compiled into this package, so it does not matter which mirror served one. A bundle that fails its signature, its schema, or its ReDoS check is discarded and the rules you already had stay in place. --offline turns updates off, as does AGENT_GUARDS_NO_FEED=1 or {"feed": false} in ~/.agent-guards/config.json. The bundle format and how to verify one yourself: https://github.com/mlawsonking/MCP/blob/main/rules/README.md

Data comes from HIBP, RDAP, the Tor Project, Team Cymru, DNS, and curated rulesets. It calls https://agent-firewall-seven.vercel.app (set AGENT_FIREWALL_API to override). One of six agent guards in this repo. MIT.

来源:agent-firewall-mcp/README.md,提交 91f3fa7

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.3.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分