Skip to content

ManintheCrowds/moltbook_watchtower

Repository files navigation

Moltbook Watchtower — Passive monitoring for the Moltbook agent network

Read-only observability; leak, injection, and behavior analysis over collected data; no writes to the network. Local-first analysis and static dashboard.

Python 3.10+

Key Concepts

Concept Description
Read-only collector Fetches posts, feed, submolts, comments via watchdog agent; rate-limited (90 req/min)
Leak/injection/behavior analyzers Detects credential patterns, prompt-injection content, and agent behavior drift
Static dashboard HTML dashboard with tables and graphs; no server required
Local-first Analysis runs locally over SQLite; data stored locally after fetch

Problem → Solution → Impact

  • Problem: Moltbook agent networks generate content that may leak credentials, exhibit injection patterns, or drift from expected behavior. Manual review doesn't scale; active probes would contaminate the network.
  • Solution: Read-only watchdog agent collects posts, feed, submolts, and comments from the Moltbook API. Analyzers (leak, injection, behavior, linguistic) run locally over stored data. Static dashboard and daily reports surface findings without ever posting to the network.
  • Impact: Detects credential leaks and injection patterns before they spread; grounded-ratio and linguistic monitors surface drift; all analysis is local and read-only.

Architecture

flowchart LR
  subgraph external [Moltbook API]
    API[GET posts, feed, submolts, comments]
  end
  subgraph watchtower [Watchtower]
    Collector[run_collector.py]
    Analyzers[run_analyzers.py]
    Dashboard[generate_dashboard_html.py]
    Report[report_summary.py]
    Collector --> Analyzers
    Analyzers --> Dashboard
    Analyzers --> Report
  end
  API -->|Read-only| Collector
  Collector -->|SQLite| Analyzers
Loading

Features

  • Read-only collector — Fetches posts, feed, submolts, comments via watchdog agent; rate-limited (90 req/min)
  • Leak analyzer — Detects credential patterns (API keys, passwords, tokens)
  • Injection analyzer — Detects prompt-injection–style content
  • Behavior analyzer — Tracks agent behavior patterns
  • Linguistic analyzer — Monitors grounded ratios and language drift
  • Static dashboard — HTML dashboard with tables and graphs (no server)
  • Daily reports — Optional markdown summaries for cron
  • Optional alerting — Signal, Slack, or email on critical findings

Tech stack

Python 3.10+, requests, python-dotenv, SQLite.

Local-first alignment

Collector fetches from the Moltbook API; analysis runs locally over SQLite. Dashboard is static HTML. Data is stored locally after fetch. Aligns with local-first principles. Community: LoFi, Local-First News.

AI security: When using AI (e.g. for analysis or automation), see D:\local-first\AI_SECURITY.md for MVP checklist.

Quick start

git clone <your-fork-url>   # Replace with your fork URL or the upstream repo if public
cd moltbook-watchtower
cp .env.example .env
# Edit .env: set MOLTBOOK_API_KEY (register watchdog at https://www.moltbook.com/skill.md)
pip install -r requirements.txt

# Collect from live API
python scripts/run_collector.py

# Run analyzers
python scripts/run_analyzers.py

# Generate dashboard
python scripts/generate_dashboard_html.py
# Open exports/dashboard.html in browser

See docs/SETUP.md for API key registration and full go-live steps.

Documentation

Testing

Same command as CI (.github/workflows/tests.yml):

pip install -r requirements.txt
python -m playwright install chromium   # once per machine; CI does this automatically
python -m pytest tests/ -v --tb=short

(pytest tests/ -v is equivalent if pytest is on your PATH.)

Dashboard GUI smoke only: python -m pytest tests/e2e/ -m e2e -v (see docs/audit/gui-2026-03-26.md).

Unit, integration, and Playwright e2e tests (59 total including one browser smoke test).

License

MIT (see LICENSE).

Built by a programmer who ships. See portfolio-harness/docs/AUTHOR.md if viewing from sibling workspace.

About

Passive monitoring for the Moltbook agent network. Read-only observability; leak, injection, and behavior analysis; local-first, no writes to the network.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages