mcpField
G
GrindFree Agent Security

GrindFree Agent Security

本地服务
github.com/ronin93其他0今天更新

关于 GrindFree Agent Security

GrindFree Agent Security 是面向 Base 上付费 Agent 安全 API 的 MCP 服务及客户端代码示例集合。其基于规则检查提示词、文档、记忆、工具调用、命令、URL 和外发内容;调用方必须落实其建议决策。

主要功能

  1. 01提示注入筛查与文本清理
  2. 02URL 抓取策略检查
  3. 03工具调用前策略判定
  4. 04Shell 命令与 SQL 检查
  5. 05记忆及外发内容筛查
  6. 06文档隐藏指令扫描

适用场景

  1. 01在 Agent 处理前筛查提示词
  2. 02执行前检查命令和 SQL
  3. 03保存到 Agent 记忆前检查内容
  4. 04检查文档或输出中的隐藏指令和泄漏

MCP 相关

将 GrindFree 安全 API 操作作为 MCP 工具提供,包括筛查、策略检查、文档扫描和免费发现探测。调用通过 x402 v2 在 Base 上以 USDC 付费。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"ronin93-grindfree-agent-security": {
"command": "npx",
"args": [
"-y",
"@grindfree/agent-security-mcp"
],
"env": {
"X402_PRIVATE_KEY": "<X402_PRIVATE_KEY>"
}
}
}
}
启动命令npx -y @grindfree/agent-security-mcp
需要配置的环境变量
X402_PRIVATE_KEY密钥Caller's own Base USDC EVM private key (0x…). Used only by the local MCP host to settle x402 payments. Never a GrindFree key; never commit this value.

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@grindfree/agent-security-mcp0.2.0

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

README 原文English

来自项目 README

README 暂无中文译文,以下为英文原文;中文介绍见上方。

GrindFree Agent Security

MCP server + client snippets for GrindFree’s pay-per-call agent security APIs on Base:

ServiceEndpointPriceWhat it does
PromptShieldPOST https://promptshield.grindfree.net/v1/screen · /v1/clean$0.002Prompt-injection screen + HTML→LLM clean text
CrawlSafePOST https://crawlsafe.grindfree.net/v1/check$0.002robots.txt / X-Robots-Tag crawl gate (SSRF-guarded; not malware scanning)
ToolGuardPOST https://toolguard.grindfree.net/v1/evaluate$0.002Pre-tool-call allow | review | deny policy gate
CommandGuardPOST https://commandguard.grindfree.net/v1/command · /v1/sql$0.001Shell command + SQL check before execution: allow | warn | block
MemoryGuardPOST https://memoryguard.grindfree.net/v1/screen$0.002Screen content before it is written to agent memory (planted instructions, persistence, secrets/PII)
WireShieldPOST https://wireshield.grindfree.net/v1/scan$0.002Outbound leak check on agent output (zero-click image exfil, URL smuggling, canaries, prompt leakage)
DocShieldPOST https://docshield.grindfree.net/v1/scan$0.004Hidden instructions in PDF / DOCX / XLSX / PPTX / HTML / Markdown before the agent reads them

Price: per call in USDC (table above) on Base (eip155:8453) via x402 v2.
Wallet: the caller’s Base USDC wallet pays. This repo never ships GrindFree keys.

Contact: [email protected] · @grindfreelabs


Install / run the MCP server (stdio)

git clone https://github.com/ronin93/grindfree-agent-security.git
cd grindfree-agent-security/mcp-server
npm install

Set the caller’s funded Base USDC key in the MCP host env (never commit it):

export X402_PRIVATE_KEY=0xYOUR_BASE_USDC_PRIVATE_KEY
# PRIVATE_KEY is also accepted
node src/index.js

Claude Desktop / Cursor-style config:

{
  "mcpServers": {
    "grindfree-agent-security": {
      "command": "node",
      "args": ["/absolute/path/to/grindfree-agent-security/mcp-server/src/index.js"],
      "env": {
        "X402_PRIVATE_KEY": "0xYOUR_KEY"
      }
    }
  }
}
MCP tools
  • promptshield_screen / promptshield_clean
  • crawlsafe_check
  • toolguard_evaluate — your agent must enforce allow/review/deny before executing the tool; this API cannot stop a bypass
  • commandguard_command / commandguard_sql — check shell commands and SQL before running them
  • memoryguard_screen — check content before saving it to long-term memory
  • wireshield_scan — check agent output before rendering/sending it
  • docshield_scan — check a local file (path), base64 bytes, or HTML/Markdown for hidden instructions (max 3 MB)
  • grindfree_discovery — unpaid 402 / discovery probe (no spend)

HTTP snippets (no MCP)

  • examples/typescript-x402-fetch.ts — official @x402/fetch + @x402/evm
  • examples/python-x402.py — unpaid probes + paid hook
  • examples/langchain-tool.py — LangChain-style wrappers

Unpaid challenge (no wallet):

curl -sS -D - -o /tmp/ps402.json -X POST https://promptshield.grindfree.net/v1/screen \
  -H 'content-type: application/json' \
  -d '{"content":"hi","format":"text"}'
# Expect HTTP 402 + PAYMENT-REQUIRED

Honest limits

  • Heuristic / policy layers — not a full security program.
  • CrawlSafe is not malware, phishing, or legal/ToS advice.
  • All guards are deterministic rule packs (no LLM), so they are fast and cheap but can miss novel phrasing; decisions are advisory and your code must enforce block/deny.
  • DocShield parses structure and text; it does not OCR images or render pages, and legacy .doc/.xls/.ppt return 415 (not charged).
  • ToolGuard returns a decision; the caller/adapter must enforce it before tool execution. Missing policy → review. Not an exfiltration guarantee.
  • ToolGuard: always enforce allow|review|deny in your adapter before tool execution (the API cannot stop a bypass). GrindFree has confirmed funded settlement + HTTP 200 delivery on /v1/evaluate via a self-funded Base USDC test; still verify with your own wallet in production.

License

MIT — see LICENSE.

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。