SafeClaw 🐾
Privacy-first personal automation assistant - no GenAI required.
SafeClaw is an open-source alternative to cloud-based AI assistants that runs entirely on your machine. It does 90% of what Clawdbot/OpenClaw does using traditional programming - rule-based parsing, webhooks, web crawling, and extractive summarization.
Features
🔒 Privacy First
- 100% self-hosted - Your data never leaves your machine
- No API keys required - Works completely offline
- No cloud dependencies - Everything runs locally
🤖 No GenAI Required
- Rule-based command parsing - Keyword matching, regex, fuzzy search
- Extractive summarization - Uses sumy (LSA, LexRank, TextRank)
- Pattern matching - dateparser for natural…
SafeClaw 🐾
Privacy-first personal automation assistant - no GenAI required.
SafeClaw is an open-source alternative to cloud-based AI assistants that runs entirely on your machine. It does 90% of what Clawdbot/OpenClaw does using traditional programming - rule-based parsing, webhooks, web crawling, and extractive summarization.
Features
🔒 Privacy First
- 100% self-hosted - Your data never leaves your machine
- No API keys required - Works completely offline
- No cloud dependencies - Everything runs locally
🤖 No GenAI Required
- Rule-based command parsing - Keyword matching, regex, fuzzy search
- Extractive summarization - Uses sumy (LSA, LexRank, TextRank)
- Pattern matching - dateparser for natural language dates
- Optional AI fallback - Connect to Ollama or local LLMs if desired
📡 Multi-Channel
- CLI - Interactive command line interface
- Telegram - Bot integration
- Discord - (coming soon)
- Slack - (coming soon)
- Webhooks - Inbound/outbound webhook support
📰 RSS News Aggregation
- Preset categories - Tech, World, Science, Business, Programming, Security, Linux, AI
- 50+ feeds included - Hacker News, Ars Technica, BBC, Reuters, Nature, and more
- Custom feeds - Import your own RSS/Atom feeds
- Auto-summarization - Summarize articles with sumy (no AI!)
- Per-user preferences - Each user can customize their news sources
⚡ Automation
- Web crawling - Extract links and content from websites
- Summarization - Summarize articles without AI
- Reminders - Natural language time parsing
- Shell commands - Sandboxed command execution
- File operations - Search, list, read files
- Cron jobs - Scheduled tasks
- Daily briefings - Weather, reminders, news from your RSS feeds
📊 Text Analysis (No ML!)
- VADER Sentiment - Lexicon-based sentiment analysis
- Keyword Extraction - TF-IDF style extraction
- Readability Scoring - Flesch-Kincaid metrics
📧 Email Integration
- IMAP Support - Read emails from Gmail, Outlook, Yahoo
- SMTP Support - Send emails
- Standard Protocols - No API keys required
📅 Calendar Support
- ICS Files - Import and parse .ics calendar files
- CalDAV - Connect to Google Calendar, iCloud (optional)
- Event Filtering - Today, upcoming, by date range
📄 Document Reading
- PDF - Extract text with PyMuPDF
- DOCX - Microsoft Word documents
- HTML/Markdown/TXT - Plain text formats
🔔 Notifications
- Desktop Notifications - Cross-platform (macOS, Windows, Linux)
- Priority Levels - Low, normal, high, urgent
- Rate Limiting - Prevent notification spam
Installation
# Basic installation
pip install safeclaw
# With Telegram support
pip install safeclaw[telegram]
# With all optional features
pip install safeclaw[all]
# Development installation
git clone https://github.com/safeclaw/safeclaw.git
cd safeclaw
pip install -e ".[dev]"
Requirements: Python 3.11+
Quick Start
Interactive CLI
# Start interactive mode
safeclaw
# Or with verbose logging
safeclaw --verbose
Example Commands
> news # Get headlines from enabled feeds
> news tech # Get tech news only
> news categories # See all available categories
> news enable science # Enable science feeds
> add feed https://blog.example.com/rss # Add custom feed
> summarize https://news.ycombinator.com
> crawl https://example.com
> remind me to call mom tomorrow at 3pm
> morning briefing # Includes news from your feeds!
> check my email # View inbox (requires setup)
> calendar today # Today's events from .ics
> analyze sentiment of this text # VADER sentiment analysis
> read document.pdf # Extract text from documents
> help
CLI Commands
# Get news headlines
safeclaw news # From enabled categories
safeclaw news tech # Tech news only
safeclaw news --categories # List all categories
safeclaw news world -n 20 # 20 world news headlines
safeclaw news --add https://blog.example.com/rss --name "My Blog"
safeclaw news -s # With summaries
# Summarize a URL
safeclaw summarize https://example.com/article -n 5
# Crawl a website
safeclaw crawl https://example.com --depth 2
# Analyze text (sentiment, keywords, readability)
safeclaw analyze "This product is amazing! I love it."
safeclaw analyze document.txt --no-readability
# Read documents (PDF, DOCX, TXT, MD, HTML)
safeclaw document report.pdf
safeclaw document paper.docx --summarize -n 5
safeclaw document notes.md --output extracted.txt
# Calendar (ICS files)
safeclaw calendar import --file calendar.ics
safeclaw calendar today
safeclaw calendar upcoming --days 14
# Start webhook server
safeclaw webhook --port 8765
# Initialize config
safeclaw init
Configuration
SafeClaw looks for configuration in config/config.yaml:
safeclaw:
name: "SafeClaw"
language: "en"
timezone: "UTC"
channels:
cli:
enabled: true
webhook:
enabled: true
port: 8765
telegram:
enabled: false
token: "YOUR_BOT_TOKEN"
actions:
shell:
enabled: true
sandboxed: true
timeout: 30
files:
enabled: true
allowed_paths:
- "~"
Architecture
┌──────────────────────────────────────────────────────────────────────┐
│ SAFECLAW │
├──────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌────────────┐ │
│ │ CHANNELS │ │ ACTIONS │ │ TRIGGERS │ │ CORE │ │
│ ├─────────────┤ ├─────────────┤ ├─────────────┤ ├────────────┤ │
│ │ • CLI │ │ • Files │ │ • Cron │ │ • Analyzer │ │
│ │ • Telegram │ │ • Shell │ │ • Webhooks │ │ • Documents│ │
│ │ • Webhooks │ │ • Crawl │ │ • Watchers │ │ • Notify │ │
│ │ • Discord │ │ • Summarize │ │ • Events │ │ • Feeds │ │
│ └─────────────┘ │ • Reminder │ └─────────────┘ │ • Crawler │ │
│ │ • Briefing │ │ • Summary │ │
│ │ • News/RSS │ └────────────┘ │
│ │ • Email │ │
│ │ • Calendar │ │
│ └─────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ COMMAND PARSER │ │
│ │ Keyword + Regex + Fuzzy Match + Date Parser + NLP │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ MEMORY (SQLite) │ │
│ │ History • Preferences • Reminders • Cache • Events │ │
│ └───────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────┘
How It Works (No AI!)
Command Parsing
Instead of using LLMs to understand commands, SafeClaw uses:
- Keyword matching - Fast lookup of command keywords
- Regex patterns - Structured extraction of parameters
- Fuzzy matching - Typo tolerance with rapidfuzz
- Date parsing - Natural language dates with dateparser
# Example: "remind me to call mom tomorrow at 3pm"
# → intent: "reminder"
# → params: {task: "call mom", time: "tomorrow at 3pm"}
# → entities: {datetime: 2024-01-16 15:00:00}
Summarization
Uses sumy’s extractive algorithms:
- LexRank - Graph-based, like PageRank for sentences
- TextRank - Word co-occurrence graphs
- LSA - Latent Semantic Analysis
- Luhn - Statistical word frequency
No neural networks, no API calls - pure math!
Web Crawling
Async crawling with httpx + BeautifulSoup:
- Single page link extraction
- Multi-page crawling with depth limits
- Domain filtering
- Pattern matching
- Built-in caching
RSS News Aggregation
Fetch news from 50+ preset feeds or add your own:
# Available categories
safeclaw news --categories
📂 Available News Categories
✅ tech (6 feeds)
• Hacker News
• Ars Technica
• The Verge
• ... and 3 more
⬜ world (5 feeds)
• BBC World
• Reuters World
• Al Jazeera
• ... and 2 more
⬜ science (5 feeds)
⬜ business (4 feeds)
⬜ programming (5 feeds)
⬜ security (4 feeds)
⬜ linux (4 feeds)
⬜ ai (4 feeds)
Interactive commands:
> news # Headlines from enabled categories
> news tech # Tech news only
> news enable science # Enable science category
> news disable tech # Disable tech category
> add feed https://myblog.com/rss # Add custom feed
> news remove myblog.com # Remove custom feed
> read https://article.com/story # Fetch and summarize article
Summarization with news:
# Get news with auto-summarization (uses sumy, no AI!)
safeclaw news -s
📰 News Headlines
── TECH ──
**Apple Announces New M4 Chip**
Hacker News • Feb 02, 10:30
The new M4 chip features improved neural engine performance
and 40% better battery efficiency compared to M3.
https://...
Webhooks
SafeClaw can both receive and send webhooks:
Inbound Webhooks
# Start webhook server
safeclaw webhook --port 8765
# Webhooks are available at:
# POST http://localhost:8765/webhook/{name}
Configuring Webhooks
from safeclaw.triggers.webhook import WebhookServer
server = WebhookServer(port=8765)
server.register(
name="github",
action="shell",
secret="your-webhook-secret",
)
Outbound Webhooks
from safeclaw.triggers.webhook import WebhookClient
client = WebhookClient()
await client.send_to_slack(
webhook_url="https://hooks.slack.com/...",
text="Deployment complete!",
)
Extending SafeClaw
Custom Actions
from safeclaw.actions.base import BaseAction
class MyAction(BaseAction):
name = "myaction"
async def execute(self, params, user_id, channel, engine):
# Your logic here
return "Action completed!"
# Register it
engine.register_action("myaction", MyAction().execute)
Custom Intent Patterns
Add to config/intents.yaml:
intents:
deploy:
keywords: ["deploy", "release", "ship"]
patterns:
- "deploy to (production|staging)"
examples:
- "deploy to production"
action: "webhook"
Comparison with Clawdbot/OpenClaw
| Feature | SafeClaw | Clawdbot |
|---|---|---|
| Self-hosted | ✅ | ✅ |
| No AI required | ✅ | ❌ |
| Offline capable | ✅ | ❌ |
| Privacy-first | ✅ | ✅ |
| Multi-channel | ✅ | ✅ |
| Web crawling | ✅ | ✅ |
| Summarization | ✅ (extractive) | ✅ (AI) |
| RSS/News feeds | ✅ | ✅ |
| Sentiment analysis | ✅ (VADER) | ✅ (AI) |
| Email integration | ✅ | ✅ |
| Calendar support | ✅ | ✅ |
| Document reading | ✅ | ✅ |
| Desktop notifications | ✅ | ✅ |
| Free-form chat | ❌ | ✅ |
| Creative writing | ❌ | ✅ |
SafeClaw is for you if:
- You want automation without AI dependencies
- Privacy is paramount
- You prefer deterministic, predictable behavior
- You don’t need free-form conversation
- You want to avoid API costs and rate limits
Development
# Clone the repo
git clone https://github.com/safeclaw/safeclaw.git
cd safeclaw
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Type checking
mypy src/safeclaw
# Linting
ruff check src/safeclaw
License
MIT License - see LICENSE for details.
Contributing
Contributions welcome! Please read our contributing guidelines first.
Areas we’d love help with:
- More channel adapters (Discord, Slack, Matrix)
- Smart home integrations (Home Assistant, Philips Hue)
- Better intent patterns
- Documentation improvements
- Tests and CI/CD
Acknowledgments
- sumy - Extractive summarization
- VADER - Sentiment analysis
- feedparser - RSS/Atom feed parsing
- dateparser - Natural language date parsing
- rapidfuzz - Fast fuzzy matching
- httpx - Async HTTP client
- FastAPI - Webhook server
- Rich - Beautiful CLI output
- PyMuPDF - PDF parsing
- python-docx - DOCX parsing
- icalendar - ICS calendar parsing
- desktop-notifier - Cross-platform notifications
SafeClaw - Because sometimes you just want things to work, predictably. 🐾