
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.
概覽
一個本機 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 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Agent Firewall Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
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
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, andallowmeans 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 generickey = "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, likepaypal.com.secure-login.tk. It is not edit distance and not homoglyphs, sopaypa1.comgets 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 aslisted: nullwith a note and adds nothing to the score. Onlylisted: truemoves the verdict, so an inconclusive lookup ends up with the same verdict as a clean one — readblocklist.listedrather 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版本歷史
1- v1.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分