safe-web
Skill1 starsChanged 2 months agoMITView on GitHub
Secure web fetch and search with PromptGuard scanning. 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: Fetch a URL and scan the content: Search the web and scan results: Create a system-wide symlink so safe-web works from any directory: After creating the symlink, you can use safe-web directly without specifying the full path. Fail-closed: If PromptGuard cannot be loaded or…
- Reads credentials
In this repository31 other files it gives its agents.
- ai-meeting-notesSkill
- Architecture ImproverSkill
- Chat to PRDSkill
- Code ContextSkill
- Compressed ModeSkill
- Content MarketingSkill
- CybersecuritySkill
- Debug DiagnoseSkill
- DevOpsSkill
- Git GuardrailsSkill
- GitSkill
- Graphic Design ProSkill
- Grill MeSkill
- Grill With DocsSkill
- Issue TriageSkill
- meeting-notesSkill
- nextjsSkill
- NginxSkill
- Plan to IssuesSkill
- playwrightSkill
- ProgrammingSkill
- Quick PrototypeSkill
- ReactSkill
- Refero StylesSkill
- safe_fetchSkill
- safe_searchSkill
- SEO (Site Audit + Content Writer + Competitor Analysis)Skill
- sqlSkill
- TDD HelperSkill
- TerraformSkill
- typescriptSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
Search the web and scan results:
- Very specific: line 78
Create a system-wide symlink so safe-web works from any directory:
- Very specific: line 84
After creating the symlink, you can use safe-web directly without specifying the full path.
- Distinctive: line 102
Fail-closed: If PromptGuard cannot be loaded or scanning fails, the tool reports an error rather than returning unverified content.
- Very specific: line 165
Use standard web_fetch/web_search tools only for:
- Distinctive: line 168
When you explicitly want to bypass scanning
- Distinctive: line 191
Search requires Brave API key (free tier available)
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
safe-web
Secure web fetch and search with PromptGuard scanning.
Status
✅ Working
Purpose
Protects against prompt injection attacks hidden in web content before returning it to the AI. Wraps web fetching and searching with security scanning.
Installation
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 beautifulsoup4Usage
Fetch Command
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 --strictSearch Command
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" --jsonExit Codes
| Code | Meaning |
| 0 | Success - content/results are clean |
| 1 | Error (network, parsing, etc.) |
| 2 | Threat detected - content blocked |
Configuration
Environment Variables
BRAVE_API_KEY- API key for Brave Search (optional, enables search command)- Get one at: https://brave.com/search/api/
Symlink (Recommended)
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-webAfter creating the symlink, you can use safe-web directly without specifying the full path.
How It Works
Fetch Flow
- Downloads URL content with requests
- Extracts text using BeautifulSoup (removes scripts, styles)
- Scans extracted text with PromptGuard
- Returns clean content or blocks with SHIELD report
Search Flow
- Queries Brave Search API (requires API key)
- Scans each result title and description
- Filters out suspicious results
- Returns only clean results
Security Model
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.
Example Output
Clean Fetch
Fetching: https://site.com/article
Fetched 1523 characters
Scanning with PromptGuard...
Article content here...Blocked Content
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.Search Results
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...When to Use
Use safe-web when:
- Fetching content from untrusted URLs
- Scraping web pages for analysis
- Searching and processing web results
- Any web content will enter the AI context window
Use standard web_fetch/web_search tools only for:
- Trusted, known-safe domains
- Internal documentation sites
- When you explicitly want to bypass scanning
Comparison with Native Tools
| 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) |
Dependencies
- Python 3.8+
- PromptGuard 3.1.0+ (installed in workspace)
- requests
- beautifulsoup4
- Brave Search API key (for search command)
Limitations
- Search requires Brave API key (free tier available)
- Fetch does not execute JavaScript (static HTML only)
- Large pages may be truncated during text extraction
- Network timeouts default to 30 seconds
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

