π‘οΈ Security Gateway for AI Agents π‘οΈ
Protect your AI agents from accidentally leaking sensitive information when posting to social networks.
# Clone repository
git clone https://github.com/elazarprojects/moltblock.git
cd moltblock
# Install package (this automatically installs all dependencies)
pip install -e .
# Run setup wizard
moltblockThat's it! The pip install -e . command will automatically install all required dependencies from pyproject.toml, and then the interactive wizard will guide you through the rest.
Note: If you encounter any issues with dependencies, you can manually install them with:
pip install -r requirements.txtFor detailed installation instructions, troubleshooting, and alternative methods, see docs/INSTALLATION.md.
MoltBlock is a security gateway that sits between your AI agents and the internet, scanning all outbound messages for sensitive information before they're posted to AI-focused social networks like:
- π Moltbook.com - Social network for AI agents
- π€ TheColony.cc - AI agent community
- π Clawstr.com - AI content platform
AI Agents can accidentally leak sensitive data:
- π API keys (OpenAI, AWS, GitHub)
- π Passwords and tokens
- π§ Personal information (email, phone)
- π³ Financial data (credit cards, SSN)
- πͺ Crypto wallet addresses
- ποΈ SSH keys and certificates
MoltBlock intercepts every POST request to monitored platforms, scans the content, and requires your approval before sending anything suspicious.
Key Features:
- β Two Protection Modes: Port Mode (easy) or Network Monitor (bulletproof)
- β Two Scanning Modes: Regex-based (fast) or AI-powered (smart)
- β Multiple Alert Channels: Desktop notifications + Telegram bot
- β Fail-Closed Design: If in doubt, block it
- β Persistent Alerts: Approve/block even after CLI restart
- Prevent accidental API key leaks during development
- Test AI agents safely before production
- Learn what your agents are trying to post
- Protect sensitive internal information
- Comply with data protection regulations
- Audit AI agent communications
- Study AI agent behavior safely
- Prevent unintended data exposure
- Control what your agents share publicly
ββββββββββββββββ
β AI Agent β
ββββββββ¬ββββββββ
β POST request
v
ββββββββββββββββββββββββββββββββ
β MoltBlock Proxy β
β β’ Intercepts request β
β β’ Scans content β
β β’ Detects sensitive data β
ββββββββ¬ββββββββββββββββββββββββ
β
ββ Safe ββββββββββββββββ> β
Forward to internet
β
ββ Dangerous ββ> π¨ Alert user βββ¬β> Approved ββ> β
Forward
ββ> Blocked βββ> π« Block (403)
- AI agent configured to use proxy via environment variables
- No admin rights required
- Easy setup for development
β οΈ Agent can bypass if compromised
set HTTP_PROXY=http://127.0.0.1:8080
set HTTPS_PROXY=http://127.0.0.1:8080
python your_agent.py- System-wide traffic interception
- Requires administrator privileges
- Agent cannot bypass even if compromised
- Recommended for production
- β‘ Ultra-fast (< 10ms per request)
- π Works offline
- π° Free, no API costs
- π― 3 sensitivity levels
Level 1 - Paranoid: Blocks everything suspicious (many false positives)
Level 2 - Moderate: Balanced security vs usability β
Recommended
Level 3 - Strict: Only high-value secrets (API keys, credit cards)
- π§ Context-aware scanning
- β Fewer false positives
- π Requires LLM API (Anthropic, OpenAI, Google, etc.)
- πΈ Small cost per request ($0.0001-0.001)
Level 1 - Ultra-Strict: Blocks PII, system info, everything identifiable
Level 2 - Moderate: Blocks credentials and identifying info β
Recommended
Level 3 - Basic: Only explicit secrets
- Windows toast notifications
- Always enabled (read-only)
- Quick visibility
- Interactive approve/block buttons
- Real-time decision making
- Works even when CLI is closed
- Live alert log
- Approve/block by ID
- Persistent alert history
ββββββββββββββββββββββββββββββββββββββββββ
β π‘οΈ MoltBlock Setup Wizard β
β Version 1.0.0 β
ββββββββββββββββββββββββββββββββββββββββββ
[1/6] Choose Protection Mode
[1] Port Mode (Recommended for Development)
[2] Network Monitor Mode (Recommended for Production)
Enter choice [1-2]: _
π‘οΈ MoltBlock Protection Active
Status: Running
Mode: Network Monitor (cannot be bypassed)
Scanning: Smart Mode - Level 2 (Moderate)
Monitored Platforms: 3
Requests Scanned: 47
Alerts Generated: 5
[LOG]
[19:25:30] β οΈ ALERT #42: Potential API key detected!
[19:25:30] β³ Waiting for user decision... (60s timeout)
βββββββββββββββββββββββββββββββββββββββββββββββ
β ALERT #42 - CRITICAL β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Domain: thecolony.cc β
β Detected: OpenAI API Key β
β Pattern: sk-proj-[...] β
β β
β [A] Approve [B] Block [V] View β
βββββββββββββββββββββββββββββββββββββββββββββββ
Configuration is stored in C:\ProgramData\MoltBlock\config.yaml:
# Protection Mode
protection:
mode: "network_monitor" # port | network_monitor
monitored_domains:
- "moltbook.com"
- "thecolony.cc"
- "clawstr.com"
# Scanning
scanning:
mode: "smart" # dumb | smart
dumb_mode:
level: 2 # 1=Paranoid, 2=Moderate, 3=Strict
smart_mode:
level: 2 # 1=Ultra-Strict, 2=Moderate, 3=Basic
provider: "anthropic"
model: "claude-haiku-4-5"
api_key: "${ANTHROPIC_API_KEY}"
# Alerts
alerts:
desktop:
enabled: true
telegram:
enabled: true
bot_token: "${TELEGRAM_BOT_TOKEN}"
chat_id: "${TELEGRAM_CHAT_ID}"
timeout: 60 # Auto-block after 60 seconds# Start MoltBlock
moltblock
# In another terminal, test with Python
python -c "import requests; r = requests.post('https://moltbook.com/api/posts', json={'content': 'My API key is sk-proj-test123'}, verify=False); print(r.text)"You should see an alert! π¨
# Start MoltBlock (auto-detects first run vs normal run)
moltblock
# Run setup wizard again (reconfigure)
moltblock setup # (from main menu)
# View pending alerts
moltblock # β Choose option [2]
# View alert history
moltblock # β Choose option [3]β
Accidental data leaks by AI agents
β
Prompt injection attacks that extract secrets
β
Agent bugs that expose sensitive info
β
Copy-paste errors in agent code
β Intentional exfiltration by malicious users
β Attacks outside monitored platforms
β Data already posted before MoltBlock was installed
β Non-HTTP communication channels
- π All data stays on your machine
- π Certificates are local-only
- π Alert history stored locally
- π LLM API calls only for Smart Mode (you choose provider)
Contributions are welcome! See CONTRIBUTING.md for guidelines.
# Clone repository
git clone https://github.com/elazarprojects/moltblock.git
cd moltblock
# Create virtual environment (recommended)
python -m venv venv
venv\Scripts\activate # Windows
# Install in development mode with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Code formatting
black moltblock/
ruff check moltblock/- π Installation Guide - Detailed installation instructions & troubleshooting
- π Quick Start - Get started in 5 minutes
- π± Telegram Setup - Configure Telegram notifications
- β FAQ - Frequently asked questions
- β Port Mode & Network Monitor Mode
- β Dumb Mode & Smart Mode scanning
- β Desktop & Telegram alerts
- β Windows support only
- macOS support
- Linux support
- GUI version (Tauri/Electron)
- Custom regex patterns
- Browser extension
- Cloud sync
- Team dashboard
- More AI platforms
This project is licensed under the MIT License - see LICENSE file for details.
- mitmproxy - Powerful HTTPS proxy framework
- LiteLLM - Unified LLM API interface
- Rich - Beautiful terminal output
- Click - CLI framework
- π Report a Bug
- π‘ Request a Feature
MoltBlock is a security tool designed to help prevent data leaks. It is not a guarantee of absolute security. Always review your AI agent's code and monitor its behavior.
Use at your own risk.
Built with β€οΈ by Elazar to protect AI agents from data leaks. i β€οΈ you π€
Star β this repo if you find it useful!