跳到正文
DEV Community· seung il,choi·· 41 分鐘前AI 評分53

CleanWeb v3.0.1 防範 RAG 與 MCP 智能體遭遇白字 PDF 提示詞注入,提供零安裝遠端 SSE

Defending RAG & MCP Agents from White-Text PDF Prompt Injections (Zero-Install Remote SSE)

AI 導讀

CleanWeb v3.0.1 追蹤 PDF 各文字顯示運算子的圖形狀態,在組合 Markdown 前移除不可見字元,以防範白字、隱藏及頁外文字等提示詞注入。它另設間接提示詞注入與隱蔽通道檢查,會封鎖 1x1 追蹤像素及可能外傳參數的 Markdown 圖片網址。用戶可透過遠端 SSE MCP、Python 套件或 curl 使用,並有 3 次免費 curl 呼叫。

正文

seung il,choi

The Silent Attack Vector in Every PDF RAG Pipeline

When an AI agent reads an external PDF—a candidate's resume, a research preprint, or a vendor report—standard text extraction libraries (pypdf, pdfminer, pymupdf) extract all text objects in the content stream, whether a human can see them or not.

That makes four classic PDF obfuscation techniques trivial to exploit against autonomous agents:

  1. White-on-white text: Setting fill color to white (1 1 1 rg, 1 g, or 0 0 0 0 k) on a white page.
  2. Invisible rendering mode (3 Tr): A valid PDF operator that tells viewers to neither fill nor stroke the glyphs—yet extractors still emit the string.
  3. Micro-fonts (< 2pt): Tiny invisible text blocks tucked into page margins.
  4. Off-page text: Coordinates placed outside the visible CropBox.

How CleanWeb v3.0.1 Neutralizes Hidden PDF Injections

Instead of relying on regexes after text extraction, CleanWeb tracks the PDF graphics state per text-showing operator (Tj, TJ, ', ") and drops invisible glyphs before assembling Markdown—then runs a secondary indirect prompt-injection & covert-channel pass that blocks 1x1 tracking pixels and parameter-leaking Markdown image URLs (![alt][EXFILTRATION_IMAGE_BLOCKED]).

Try It in 10 Seconds (No Signup Required)

Option 1: Remote SSE MCP (Cursor / Windsurf / Claude)

{
  "mcpServers": {
    "x402-cleanweb": {
      "url": "https://x402-cleanweb-agent-7qxtp3324q-du.a.run.app/sse"
    }
  }
}

Option 2: Python Thin Client / LlamaIndex / LangChain

pip install x402-cleanweb-agent
# or framework integrations:
pip install langchain-x402-cleanweb
pip install llama-index-readers-x402-cleanweb

Option 3: Instant curl Test (3 Free Calls Included)

curl -X POST "https://x402-cleanweb-agent-7qxtp3324q-du.a.run.app/api/v1/clean-web" \
  -H "Content-Type: application/json" \
  -H "X-Agent-Nonce: devto-trial-001" \
  -d '{"url": "https://news.ycombinator.com"}'

Pure M2M x402 Micro-Pricing

No credit card, no API key dashboard, no $49/mo subscription:

來源:DEV Community · dev.to