Skip to content
orilizPublic

About

A community-driven security intelligence platform for ClawHub skills, providing real-time risk assessments and verified safety recommendations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SafeClaw 🛡️

Community-Driven Security Platform for ClawHub Skills

License Python Status

中文文档 | Documentation


⚠️ IMPORTANT DISCLAIMER

SafeClaw is an AI-assisted security tool, NOT a guarantee of safety.

  • We use automated scanning and community voting to assess risks
  • No security tool can guarantee 100% protection against all threats
  • Users are responsible for their own security decisions
  • Always review code before installing any Skill, even "verified" ones
  • We are not liable for any damages caused by malicious Skills

By using SafeClaw, you acknowledge that security is a shared responsibility between the community, developers, and users.


Introduction

SafeClaw is an open-source security platform designed to protect OpenClaw users from malicious Skills. Through community-driven security verification, we establish a multi-layered defense system:

  • 🔍 Static Analysis - Automatically detect suspicious code patterns
  • 🧪 Dynamic Sandbox - Isolate and monitor Skill behavior
  • 🗳️ Community Governance - Vote-based trust establishment
  • 📡 Threat Intelligence - Real-time security monitoring from social media

Quick Start

Installation

# Clone repository
git clone https://github.com/SafeClaw/SafeClaw.git
cd SafeClaw

# Install dependencies
pip install -e .

# Or use as OpenClaw Skill
openclaw skill install safeclaw

CLI Usage

# Sync threat intelligence data
safeclaw sync

# Check Skill safety status
safeclaw check youtube-downloader

# Verify local Skill
safeclaw verify ./my-skill

# Deep code scan
safeclaw scan ./my-skill

# View statistics
safeclaw stats

Python API

from safeclaw import SkillVerifier
from pathlib import Path

verifier = SkillVerifier()
decision = verifier.verify(Path("./skill"))

print(f"Result: {decision.result}")
print(f"Risk Score: {decision.risk_score}")

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                      SafeClaw Security Architecture             │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   ┌─────────────────────────────────────────────────────────┐  │
│   │  Layer 1: Sentinel (Social Media Monitoring)             │  │
│   │  - Monitor X/Twitter, GitHub, Discord for reports        │  │
│   │  - Auto-collect community reports                        │  │
│   │  - Credibility assessment → Graylist generation          │  │
│   └─────────────────────────────────────────────────────────┘  │
│                              │                                  │
│                              ▼                                  │
│   ┌─────────────────────────────────────────────────────────┐  │
│   │  Layer 2: Automated Verification                        │  │
│   │  - Static code scanning (AST + pattern matching)        │  │
│   │  - Dynamic sandbox testing (isolated execution)         │  │
│   │  - Behavior analysis & risk scoring                     │  │
│   └─────────────────────────────────────────────────────────┘  │
│                              │                                  │
│                              ▼                                  │
│   ┌─────────────────────────────────────────────────────────┐  │
│   │  Layer 3: Community Governance                          │  │
│   │  - Community voting mechanism                           │  │
│   │  - Expert review for edge cases                         │  │
│   │  - Version snapshots for audit trail                    │  │
│   └─────────────────────────────────────────────────────────┘  │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

🔒 Sandbox Security Mechanism

SafeClaw implements a multi-layered sandbox isolation system to ensure code execution safety:

Isolation Levels

Level Description Network File System Use Case
NONE No isolation Unrestricted Unrestricted Development only
BASIC Process-level only Environment variables Temporary directory Quick testing
STANDARD Full resource limits Multi-layer blocking Isolated workspace Production default
STRICT Container-level Complete blocking chroot/namespace High-risk code

Security Features

1. File System Isolation (FileSystemIsolation)

  • Isolated workspace: Each Skill runs in a dedicated temporary directory
  • Honeypot detection: Dummy .ssh, .aws, .env files detect unauthorized access attempts
  • Path escape detection: Monitors attempts to access files outside the workspace
  • Sensitive path protection: Blocks access to /etc/passwd, ~/.ssh, and other critical paths

2. Network Isolation (NetworkIsolation)

SafeClaw automatically detects and uses the best available network isolation method:

Method Platform Effectiveness
Docker All Complete network namespace isolation
firejail Linux Seccomp + network filtering
pfctl macOS Packet filter rules
iptables Linux Firewall rules
env_only Fallback Environment variable blocking

Multi-layer environment variable protection:

  • Invalid proxy settings (http_proxy, https_proxy, ALL_PROXY)
  • DNS timeout configuration
  • SSL certificate invalidation

3. Resource Limits (ResourceLimiter)

Hard limits enforced via resource.setrlimit():

  • Memory: 256MB default (configurable)
  • CPU time: 30 seconds max
  • Processes: Maximum 5 subprocesses
  • File size: 10MB limit
  • Open files: 100 file descriptors

4. Security Failure Handling

Critical improvement: If security setup fails, the process terminates immediately (os._exit(126)) instead of continuing in an unsafe state.

5. Transparency (isolation_effective flag)

Every sandbox result includes isolation_effective: boolean to clearly indicate whether promised isolation was actually achieved.

result = sandbox.run(skill_path)
if not result.isolation_effective:
    print("⚠️  Warning: Isolation may be incomplete on this platform")

Platform Compatibility

Feature Linux macOS Notes
Resource limits ✅ ✅ Full support
Process groups ✅ ⚠️ Different implementation
Network namespaces ✅ ❌ Use Docker for macOS
File system isolation ✅ ✅ Temporary directory based
chroot ✅ ❌ Requires root
Docker integration ✅ ✅ Recommended for strict isolation

Recommendation: For production security on macOS, use Docker-based isolation (isolation_level=STRICT).

Project Structure

SafeClaw/
├── docs/                      # Documentation
│   ├── defense-architecture.md
│   ├── threat-model.md
│   ├── verification-workflow.md
│   ├── blacklist-system.md
│   ├── monitor-design.md
│   └── zero-cost-data-sync.md
├── src/                       # Core Library
│   ├── scanner.py            # Static analyzer
│   ├── sandbox.py            # Sandbox runner
│   ├── verifier.py           # Verification manager
│   ├── database.py           # SQLite storage
│   ├── reputation.py         # Author reputation
│   └── sync.py               # GitHub data sync
├── skills/                    # OpenClaw Skill
│   └── safeclaw/
│       ├── SKILL.md
│       ├── safeclaw.py
│       └── requirements.txt
├── data/                      # Threat intelligence data
│   ├── signatures/           # Malware signatures
│   ├── blacklist.json        # Known malicious Skills
│   ├── graylist.json         # Suspicious Skills (under review)
│   └── authors.json          # Author reputation database
└── tests/                     # Test cases

Security Levels

Level Icon Description Action
TRUSTED ⭐ Verified by community with excellent history Recommended
VERIFIED ✅ Passed automated verification + community voting Safe to install
PENDING 🕐 Under review, no confirmed risks Install with caution
GRAYLIST ⚠️ Suspicious behavior detected, needs review Warning shown
BLACKLIST ❌ Confirmed malicious Installation blocked

Zero-Cost Data Architecture

We use GitHub as our database - no server costs:

  • Threat Intelligence: Stored as JSON in SafeClaw/intelligence repo
  • Distribution: GitHub Raw CDN (free, globally accelerated)
  • Local Cache: SQLite on user's machine for fast queries
  • Community Updates: Via Pull Requests

See zero-cost-data-sync.md for details.

Contributing

We welcome all forms of contribution!

Reporting Security Issues

Please DO NOT open public issues for security vulnerabilities.

Instead:

  1. Email security@safeclaw.org
  2. Include reproduction steps and impact assessment
  3. Allow reasonable time for remediation

Contributing Data

To add a Skill to the blacklist:

  1. Fork the intelligence repo
  2. Edit blacklist.json with evidence
  3. Submit PR with verification details

Code Contributions

git clone https://github.com/YOUR_USERNAME/SafeClaw.git
git checkout -b feature/your-feature
git commit -m "Add your feature"
git push origin feature/your-feature

Roadmap

Phase 1: Foundation (Current)

  • Core library architecture
  • Static analyzer implementation
  • Basic sandbox environment
  • Blacklist system
  • Zero-cost data sync
  • OpenClaw Skill release

Phase 2: Community Expansion

  • Social media monitoring system
  • Community voting platform
  • GitHub snapshot archiving
  • Web dashboard

Phase 3: Advanced Features

  • AI-assisted code analysis
  • Multi-platform threat sharing
  • Automated response mechanisms
  • Enterprise security services

Legal Notice

Disclaimer of Warranty: SafeClaw is provided "as is" without warranty of any kind. We do not guarantee detection of all malicious code. Users assume all risk.

Limitation of Liability: In no event shall the authors be liable for any damages arising from the use of this software.

AI Assistance Disclosure: This project uses AI-assisted tools for code analysis. Human review is still essential for security decisions.

See DISCLAIMER.md for full legal terms.

License

MIT License - See LICENSE

Acknowledgments

Thanks to all community members contributing to SafeClaw!

Special thanks to:

  • OpenClaw team for the infrastructure
  • Early testers and feedback providers
  • Security researchers sharing threat intelligence

Links


🛡️ Together, we build a safer OpenClaw ecosystem.

About

A community-driven security intelligence platform for ClawHub skills, providing real-time risk assessments and verified safety recommendations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages