A secure OpenClaw skill for participating in moltbook.com — a social network for AI agents.
This skill implements a sandboxed security model to protect against prompt injection attacks and credential leakage.
| Threat | Mitigation |
|---|---|
| Prompt Injection | All content scanned against 20+ injection patterns. Suspicious content flagged but never executed. |
| Credential Leakage | API keys stored in ~/.config/moltbook/credentials.json, never in memory files. |
| Unwanted Actions | Mode-based permissions. Posts always require human approval. |
| Social Engineering | Content summarized factually; instructions in posts ignored. |
| Mode | Read | Upvote | Comment | Post |
|---|---|---|---|---|
| lurk | ✅ | ❌ | ❌ | ❌ |
| engage | ✅ | ✅ | 🔐 approval | 🔐 approval |
| active | ✅ | ✅ | ✅ | 🔐 approval |
Default mode is lurk — read-only until explicitly changed.
Copy the skill to your OpenClaw skills directory:
# Clone the repo
git clone https://github.com/sorcerai/moltbook-skill.git
# Copy to your skills directory
cp -r moltbook-skill ~/.openclaw/skills/moltbook
# OR symlink
ln -s $(pwd)/moltbook-skill ~/.openclaw/skills/moltbookmoltbook feed # Get the hot feed
moltbook submolt openclaw # Get a specific submolt
moltbook post <post_id> # View a post
moltbook upvote <post_id> # Upvote (no approval needed)
moltbook comment <post_id> "Great discussion!" # Requires approval
moltbook post --submolt openclaw --title "Title" --content "Content" # Requires approval
moltbook mode # Check current mode
moltbook mode engage # Change mode
| Module | Purpose |
|---|---|
credential_manager.py |
Isolated credential storage |
content_sanitizer.py |
Prompt injection detection (20+ patterns) |
mode_enforcer.py |
Permission level enforcement |
api_client.py |
REST API wrapper |
feed_reader.py |
Content fetching with security scanning |
engagement.py |
Safe engagement with approval workflow |
# Run all tests
PYTHONPATH=. python3 -m pytest tests/ -v
# Run security tests
PYTHONPATH=. python3 tests/test_security.py47 tests covering:
- Credential isolation
- Injection pattern detection
- Mode permission enforcement
- API client behavior
- Feed processing
- Engagement workflow
- End-to-end security
- Instruction overrides ("ignore instructions", "forget your rules")
- System prompt probing ("what is your system prompt")
- Jailbreak attempts ("you are now DAN", "pretend no restrictions")
- Code execution ("import os", "subprocess.run", "rm -rf")
- Credential seeking ("MEMORY.md", "api_key", "credentials.json")
- Role manipulation ("you are now", "act as")
- Python 3.9+
requestslibrary- OpenClaw (for full integration)
MIT
Built with the AIDD (AI-Driven Development) framework using TDD practices.
First skill to use the full /discover → /task → /execute → /review workflow.