Skip to content

NirDiamant/moltbook-agent-guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Moltbook Agent Guard

Moltbook Agent Guard

Real-time security for AI agents on Moltbook

Moltbook Security First License

LinkedIn Twitter Discord


πŸ“« Stay Updated

Subscribe to Newsletter
Join 50,000+ AI enthusiasts for cutting-edge insights and tutorials

DiamantAI Newsletter


Why This Toolkit?

Moltbook is the world's largest social network for AI agents (770K+ agents). Research shows 2.6% of posts contain prompt injection attacks targeting vulnerable agents.

This toolkit protects your agent from hijacking, credential theft, and manipulation.

Security Dashboard
Real threats detected and blocked on Moltbook

Attacks Blocked

Attack Type Risk
Jailbreak attempts πŸ”΄ High
Credential extraction πŸ”΄ High
Data exfiltration πŸ”΄ High
System prompt extraction πŸ”΄ High
Role hijacking 🟑 Medium
Encoded payloads 🟑 Medium

How It Works

When your agent runs, the security scanner protects it in real-time:

How It Works

# Inside the agent runtime (tools/agent/runtime.py)
def _process_post(self, post):
    is_safe, scan_result = self._scan_content(post.content)  # Every post is scanned
    if not is_safe:
        return None  # Malicious content never reaches your LLM
    # ... process safe content

Without this toolkit: Your agent processes malicious posts and risks leaking API keys or getting hijacked.

With this toolkit: Threats are detected and blocked before they ever reach your LLM.


Quick Start

git clone https://github.com/NirDiamant/moltbook-agent-toolkit.git
cd moltbook-agent-toolkit
pip install -r requirements.txt

# Setup (interactive wizard)
export MOLTBOOK_API_KEY="your_key"
export ANTHROPIC_API_KEY="your_key"
./moltbook init

# Deploy
./moltbook deploy --direct

Security Dashboard

Deploy your own dashboard to track threats in real-time.

Streamlit Cloud (Free, 2 min):

  1. Fork this repo
  2. Go to share.streamlit.io
  3. Set app path: dashboard/streamlit_app.py
  4. Add secret: MOLTBOOK_API_KEY = "your_key"
  5. Deploy

Local:

MOLTBOOK_API_KEY="your_key" streamlit run dashboard/streamlit_app.py

CLI Commands

./moltbook init                    # Setup wizard
./moltbook deploy                  # Deploy agent
./moltbook security                # View security incidents
./moltbook security --scan         # Scan for threats
./moltbook security --html report.html  # Export report

Security Modules

24 modules across 6 protection layers:

  • Critical: Output scanner, error sanitizer, log redactor
  • AI Firewall: Llama Guard + LLM Guard + pattern matching
  • Platform: Memory sanitizer, egress firewall, credential monitor
  • Social: Social engineering detection, reputation protection
  • Data: Exfiltration prevention, financial safety
  • Infrastructure: Docker isolation (cap_drop ALL, read-only fs)
from tools.security import SecurityManager

security = SecurityManager(level="standard")
result = security.scan_input(user_content)
if result.blocked:
    print(f"Blocked: {result.reason}")

Related Projects


License

Apache 2.0 β€” see LICENSE


Disclaimer

This toolkit is built in good faith with a genuine desire to help developers secure their AI agents. However, security is an ongoing battle β€” every lock has someone trying to pick it.

We cannot guarantee this will stop all attacks. Attackers evolve, new techniques emerge, and no security solution is bulletproof. This toolkit raises the bar significantly, but determined adversaries may still find ways through.

Use this as one layer in your security strategy, not your only defense. Stay vigilant, keep your dependencies updated, and monitor your agents in production.

By using this software, you accept that the authors are not liable for any security incidents, damages, or losses that may occur.

About

Real-time security for AI agents on Moltbook

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors