Securely fetch and search web content by scanning and blocking prompt injection threats using PromptGuard before returning results.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install safe-web或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install safe-web⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/safe-web/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
Secure web fetch and search with PromptGuard scanning.
✅ Working
Protects against prompt injection attacks hidden in web content before returning it to the AI. Wraps web fetching and searching with security scanning.
Requires PromptGuard and Python dependencies:
# Install PromptGuard first
cd /home/linuxbrew/.openclaw/workspace/skills/prompt-guard
pip3 install --break-system-packages -e .
# Install web dependencies (if not present)
pip3 install --break-system-packages requests beautifulsoup4
Fetch a URL and scan the content:
# Basic fetch
safe-web fetch https://example.com/article
# Save to file
safe-web fetch https://example.com --output article.txt
# JSON output for automation
safe-web fetch https://example.com --json
# Strict mode (block on MEDIUM)
safe-web fetch https://example.com --strict
Search the web and scan results:
# Basic search
safe-web search "AI safety research"
# More results
safe-web search "stock market news" --count 10
# JSON output
safe-web search "machine learning" --json
| Code | Meaning | |------|---------| | 0 | Success - content/results are clean | | 1 | Error (network, parsing, etc.) | | 2 | Threat detected - content blocked |
BRAVE_API_KEY - API key for Brave Search (optional, enables search command)- Get one at: https://brave.com/search/api/
Create a system-wide symlink so safe-web works from any directory:
sudo ln -s /home/linuxbrew/.openclaw/workspace/skills/safe-web/scripts/safe-web.py /usr/local/bin/safe-web
After creating the symlink, you can use safe-web directly without specifying the full path.
Fail-closed: If PromptGuard cannot be loaded or scanning fails, the tool reports an error rather than returning unverified content.
Content sanitization: HTML is parsed and scripts/styles are removed before scanning to reduce false positives.
No execution: This tool only fetches and scans. It never executes JavaScript or runs commands found in web content.
Fetching: https://site.com/article
Fetched 1523 characters
Scanning with PromptGuard...
Article content here...
Fetching: https://suspicious-site.com
Fetched 2048 characters
Scanning with PromptGuard...
============================================================
🛡️ SAFE-WEB SECURITY ALERT
============================================================
Source: https://suspicious-site.com
Severity: CRITICAL
Action: BLOCK_NOTIFY
Patterns Matched: 8
Detected Patterns:
- instruction_override_en
- role_manipulation_en
- system_impersonation_en
============================================================
Content from https://suspicious-site.com has been blocked.
Searching: AI research
Found 5 results, scanning...
Showing 3 clean results:
1. Latest AI Research Papers
URL: https://arxiv.org/list/ai/recent
Recent submissions in artificial intelligence...
2. AI Safety Institute
URL: https://www.safe.ai/
Research and development for safe AI systems...
Use safe-web when:
Use standard web_fetch/web_search tools only for:
| Feature | Native web_fetch | safe-web fetch | |---------|-------------------|------------------| | Fetches HTML | ✅ | ✅ | | Extracts text | ✅ | ✅ | | Injection scanning | ❌ | ✅ | | JSON output | ✅ | ✅ | | Save to file | ❌ | ✅ | | Exit codes | 0/1 | 0/1/2 (security) |
安装 Safe-Web 后,可以对 AI 说这些话来触发它
Help me get started with Safe-Web
Explains what Safe-Web does, walks through the setup, and runs a quick demo based on your current project
Use Safe-Web to securely fetch and search web content by scanning and blocking prom...
Invokes Safe-Web with the right parameters and returns the result directly in the conversation
What can I do with Safe-Web in my finance & investment workflow?
Lists the top use cases for Safe-Web, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/safe-web/ 目录(个人级,所有项目可用),或 .claude/skills/safe-web/(项目级)。重启 AI 客户端后,用 /safe-web 主动调用,或让 AI 根据上下文自动发现并使用。
Safe-Web 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Safe-Web 可免费安装使用。请查阅仓库了解许可证信息。
Securely fetch and search web content by scanning and blocking prompt injection threats using PromptGuard before returning results.
Safe-Web 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my finance & investment tasks using Safe-Web
Identifies repetitive steps in your workflow and sets up Safe-Web to handle them automatically