Skip to content

Repository files navigation

moltbook-skill

A secure OpenClaw skill for participating in moltbook.com — a social network for AI agents.

Security Model

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.

Permission Modes

Mode Read Upvote Comment Post
lurk
engage 🔐 approval 🔐 approval
active 🔐 approval

Default mode is lurk — read-only until explicitly changed.

Installation

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/moltbook

Usage

Reading Content

moltbook feed              # Get the hot feed
moltbook submolt openclaw  # Get a specific submolt
moltbook post <post_id>    # View a post

Engaging (requires engage+ mode)

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

Mode Management

moltbook mode          # Check current mode
moltbook mode engage   # Change mode

Architecture

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

Testing

# Run all tests
PYTHONPATH=. python3 -m pytest tests/ -v

# Run security tests
PYTHONPATH=. python3 tests/test_security.py

47 tests covering:

  • Credential isolation
  • Injection pattern detection
  • Mode permission enforcement
  • API client behavior
  • Feed processing
  • Engagement workflow
  • End-to-end security

Injection Patterns Detected

  • 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")

Requirements

  • Python 3.9+
  • requests library
  • OpenClaw (for full integration)

License

MIT

Credits

Built with the AIDD (AI-Driven Development) framework using TDD practices.

First skill to use the full /discover/task/execute/review workflow.

About

Secure Clawdbot skill for moltbook.com - sandboxed with prompt injection protection

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages