GitHub Park

OpenFang: Open-source Agent Operating System

OpenFang is an open-source agent operating system built entirely from scratch using the Rust language. OpenFang is not a simple chatbot framework, not a Python wrapper for large language models, and not a multi-agent orchestrator. The OpenFang system comprises 137,000 lines of code, 14 Rust crates, and over 1,767 test cases. It passes Clippy checks with zero warnings and compiles into a single ~32MB binary file, enabling agents to autonomously complete various tasks for users.

While traditional agent frameworks require users to actively input commands before executing operations, OpenFang allows autonomous agents to run 24/7 according to set plans, completing tasks such as knowledge graph construction, target monitoring, sales lead generation, and social media operations, finally reporting results to a dedicated dashboard.

OpenFang features a simple deployment process: installation with a single command, followed by initialization and startup commands to get the agent online. Basic startup commands for different systems are as follows:

macOS/Linux

curl -fsSL https://openfang.sh/install | sh
openfang init
openfang start

Windows (PowerShell)

irm https://openfang.sh/install.ps1 | iex
openfang init
openfang start

After startup, the dashboard becomes available at http://localhost:4200, where you can view and manage agent operational status.

Hands are the core design concept of OpenFang—pre-built autonomous capability packages that operate independently according to set plans without requiring manual user prompts. These capability packages are not chatbots but rather act like dedicated work assistants. For example, one could automatically research competitors at 6 AM, construct knowledge graphs, score results, and finally send a report to Telegram before the user starts work.

Each Hand integrates four core components, all compiled directly into the binary—no additional downloads, Python package installations, or Docker image pulls are needed during use:

  1. HAND.toml: A manifest file declaring tools, settings, operational requirements, and dashboard metrics.
  2. System Prompt: Multi-stage instruction manuals, not simple one-line commands but professional execution procedures exceeding 500 words.
  3. SKILL.md: Domain-specific knowledge reference documents injected into context during runtime.
  4. Guardrails: Approval checkpoints for sensitive operations. For instance, any purchase operation executed by the Browser Hand requires user approval beforehand.

7 Built-in Hands Capability Packages

Capability Package Core Functionality
Clip Parses YouTube links, downloads videos, identifies highlight reels, edits them into vertical short videos with subtitles and covers, adds AI voiceovers, and finally publishes to Telegram and WhatsApp. Utilizes an 8-stage processing pipeline integrating FFmpeg, yt-dlp, and 5 speech-to-text backends.
Lead Runs automatically daily to discover potential customers matching the ideal customer profile, enriches customer information through web research, scores them from 0-100, deduplicates against the existing database, and outputs qualified sales leads in CSV/JSON/Markdown formats. Can also progressively build the ideal customer profile.
Collector Possesses open-source intelligence (OSINT)-grade information gathering capabilities. After users set targets (companies, individuals, topics), it continuously monitors target dynamics, performs change detection, sentiment tracking, and knowledge graph construction, sending critical alerts when significant changes occur.
Predictor A super-forecasting engine that gathers signals from multiple sources, constructs standardized reasoning chains, provides forecasts with confidence intervals, tracks prediction accuracy via Brier scores, and also supports an inverse mode specifically for challenging mainstream viewpoints.
Researcher A deep-dive autonomous research agent that cross-validates information from multiple sources, assesses information credibility using the CRAAP test (Currency, Relevance, Authority, Accuracy, Purpose), and generates APA-formatted reports with citations in multiple languages.
Twitter An autonomous Twitter/X account management tool that creates content using 7 rotating formats, schedules posts for optimal engagement times, automatically replies to mentions, and tracks engagement metrics. Features an approval queue requiring user confirmation before any content is published.
Browser A web automation agent capable of navigating websites, filling forms, clicking buttons, and handling multi-step workflows. Built on Playwright bridging for session persistence, it includes a mandatory purchase approval checkpoint—no financial transactions occur without explicit user confirmation.

Basic Commands for Using Hands

# Activate the Researcher Hand to start immediately
openfang hand activate researcher

# Check the progress of the Researcher Hand anytime
openfang hand status researcher

# Activate the Lead Hand to run lead generation on its daily schedule
openfang hand activate lead

# Pause the Lead Hand without losing its running state
openfang hand pause lead

# List all available Hands
openfang hand list

Users can also create custom Hands by writing a HAND.toml file to define tools, settings, and system prompts. Once complete, they can be published to the FangHub platform.

Performance Comparison: OpenFang vs. Similar Frameworks

All comparison data is sourced from official documentation and public code repositories of each framework as of February 2026. Measured comparisons were conducted with OpenClaw, ZeroClaw, LangGraph, CrewAI, and AutoGen across six dimensions: cold start time, idle memory usage, installation size, security system, channel adapters, and LLM providers.

Cold Start Time (Lower is Better)

ZeroClaw ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 10 ms
OpenFang ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 180 ms
LangGraph █████████████████░░░░░░░░░░░░░░░░░░░░░░░░░ 2.5 sec
CrewAI ████████████████████░░░░░░░░░░░░░░░░░░░░░░ 3.0 sec
AutoGen ██████████████████████████░░░░░░░░░░░░░░░░░ 4.0 sec
OpenClaw █████████████████████████████████████████░░ 5.98 sec

Idle Memory Usage (Lower is Better)

ZeroClaw █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 5 MB
OpenFang ████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 40 MB
LangGraph ██████████████████░░░░░░░░░░░░░░░░░░░░░░░░░ 180 MB
CrewAI ████████████████████░░░░░░░░░░░░░░░░░░░░░░░ 200 MB
AutoGen █████████████████████████░░░░░░░░░░░░░░░░░░ 250 MB
OpenClaw ████████████████████████████████████████░░░░ 394 MB

Installation Size (Lower is Better)

ZeroClaw █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8.8 MB
OpenFang ███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 32 MB
CrewAI ████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 100 MB
LangGraph ████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 150 MB
AutoGen ████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░ 200 MB
OpenClaw ████████████████████████████████████████░░░░ 500 MB

Security System (Higher is Better)

OpenFang ████████████████████████████████████████████ 16
ZeroClaw ███████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6
OpenClaw ████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3
AutoGen █████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2
LangGraph █████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2
CrewAI ███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1

Channel Adapters (Higher is Better)

OpenFang ████████████████████████████████████████████ 40
ZeroClaw ███████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 15
OpenClaw █████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 13
CrewAI ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0
AutoGen ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0
LangGraph ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0

LLM Providers (Higher is Better)

ZeroClaw ████████████████████████████████████████████ 28
OpenFang ██████████████████████████████████████████░░ 27
LangGraph ██████████████████████░░░░░░░░░░░░░░░░░░░░░ 15
CrewAI ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 10
OpenClaw ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 10
AutoGen ███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8

Detailed Feature Comparison

Feature OpenFang OpenClaw ZeroClaw CrewAI AutoGen LangGraph
Language Rust TypeScript Rust Python Python Python
Autonomous Hands 7 built-in None None None None None
Security Layers 16 independent 3 basic 6 layers 1 basic Docker containers AES encryption
Agent Sandbox WASM dual-metered None Allowlist None Docker containers None
Channel Adapters 40 13 15 0 0 0
Built-in Tools 53 + MCP + A2A 50+ 12 Plugin-based MCP LC tools
Memory Storage SQLite + Vector File storage SQLite FTS5 4-layer storage External storage Checkpoints
Desktop App Tauri 2.0 None None None Studio None
Audit Trail Merkle Hash Chain Logs Logs Traces Logs Checkpoints
Cold Start Time <200ms ~6s ~10ms ~3s ~4s ~2.5s
Installation Size ~32 MB ~500 MB ~8.8 MB ~100 MB ~200 MB ~150 MB
Open Source License MIT MIT MIT MIT Apache 2.0 MIT

OpenFang's security is not an afterthought but is integrated from the ground up into the system design. All security layers are independently testable, and there is no single point of failure during operation. The specific functions of the multiple security systems are as follows:

# Security System Core Function
1 WASM Dual-Metered Sandbox Tool code runs within WebAssembly, combined with fuel metering and cycle interruption mechanisms. A monitoring thread terminates any失控 code.
2 Merkle Hash Chain Audit Trail All operations are cryptographically linked to the previous operation. Tampering with any single record invalidates the entire chain.
3 Information Flow Taint Tracking Adds labels to data during execution, tracking the flow of sensitive information from source to sink throughout the process.
4 Ed25519 Signed Agent Manifests Identities and capability sets of all agents are cryptographically verified via signatures.
5 SSRF Protection Intercepts access to private IPs and cloud metadata endpoints, guarding against DNS rebinding attacks.
6 Zeroizing on Drop for Secrets Utilizes a Zeroizing<String> mechanism to ensure secrets are automatically cleared from memory immediately after use.
7 OFP Mutual Authentication Constant-time verification based on HMAC-SHA256 nonces, securing peer-to-peer network communication.
8 Capability Access Gates Role-based access control. Agents declare required tools, and the kernel enforces permission checks.
9 Secure Response Headers All responses are configured with CSP, X-Frame-Options, HSTS, and X-Content-Type-Options headers.
10 Health Endpoint Info Sanitization Public health checks return minimal information; full diagnostic details require authentication.
11 Subprocess Sandbox Clears environment variables + selective variable passing, achieving process tree isolation with cross-platform process termination support.
12 Prompt Injection Scanning Detects attempts for privilege escalation, data leakage patterns, and shell injection in skills.
13 Loop Protection SHA256-based tool call cycle detection coupled with a circuit breaker to handle ping-pong calling patterns.
14 Session Healing 7-stage message history verification enabling automatic recovery of corrupted sessions.
15 Path Traversal Protection Prevents symlink escapes and renders ../ path traversal attempts ineffective through path normalization.
16 GCRA Rate Limiting Cost-aware token bucket rate limiting, tracking access by IP and cleaning up expired rules.

OpenFang employs a modular kernel design, composed of 14 independent Rust crates, each with specific responsibilities working together to support the entire system. The functions of the core crates are as follows:

openfang-kernel : Orchestration, workflows, metering, RBAC, scheduling, budget tracking
openfang-runtime : Agent loop, 3 LLM drivers, 53 tools, WASM sandbox, MCP, A2A
openfang-api : 140+ REST/WS/SSE endpoints, OpenAI-compatible API, dashboard
openfang-channels : 40 message adapters with rate limiting, DM/group policies
openfang-memory : SQLite persistence, vector embeddings, session normalization, data compression
openfang-types : Core types, taint tracking, Ed25519 manifest signing, model catalog
openfang-skills : 60 built-in skills, SKILL.md parser, FangHub marketplace
openfang-hands : 7 autonomous Hands, HAND.toml parser, lifecycle management
openfang-extensions: 25 MCP templates, AES-256-GCM credential store, OAuth2 PKCE
openfang-wire : OFP P2P protocol with HMAC-SHA256 mutual authentication
openfang-cli : CLI tool with daemon management, TUI dashboard, MCP server mode
openfang-desktop : Tauri 2.0 native app with system tray, notifications, global shortcuts
openfang-migrate : Migration engine for OpenClaw, LangChain, AutoGPT
xtask : Build automation tools

OpenFang is equipped with 40 message channel adapters, enabling agents to connect to users across various platforms. These cover six major categories: Core Messaging, Enterprise Collaboration, Social Platforms, Community Forums, Private Communication, and Workplace Collaboration. Supported platforms include:

  • Core Messaging: Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Email (IMAP/SMTP)
  • Enterprise Collaboration: Microsoft Teams, Mattermost, Google Chat, Webex, Feishu/Lark, Zulip
  • Social Platforms: LINE, Viber, Facebook Messenger, Mastodon, Bluesky, Reddit, LinkedIn, Twitch
  • Community Forums: IRC, XMPP, Guilded, Revolt, Keybase, Discourse, Gitter
  • Private Communication: Threema, Nostr, Mumble, Nextcloud Talk, Rocket.Chat, Ntfy, Gotify
  • Workplace Collaboration: Pumble, Flock, Twist, DingTalk, Zalo, Webhooks

Each adapter supports per-channel coverage models, DM/group policies, rate limiting, and output formatting.

OpenFang has 3 native drivers (Anthropic, Gemini, OpenAI-compatible) and can interface with 27 LLM providers, covering 123+ models. Supported providers include: Anthropic, Gemini, OpenAI, Groq, DeepSeek, OpenRouter, Together, Mistral, Fireworks, Cohere, Perplexity, xAI, AI21, Cerebras, SambaNova, HuggingFace, Replicate, Ollama, vLLM, LM Studio, Alibaba Cloud (Tongyi Qianwen), MiniMax, Zhipu AI, Moonshot AI, Baidu Qianfan, AWS Bedrock, and more.

The system supports intelligent routing based on task complexity scores, coupled with automatic fallback, cost tracking, and per-model pricing, automatically selecting the appropriate model based on requirements.

If currently using OpenClaw, a seamless migration can be performed with simple commands. The migration engine imports agents, conversation history, skills, and configurations. OpenFang natively supports reading SKILL.md files and is compatible with the ClawHub marketplace. Specific migration commands are as follows:

# Migrate everything: agents, memory, skills, config
openfang migrate --from openclaw

# Migrate OpenClaw content from a specified path
openfang migrate --from openclaw --path ~/.openclaw

# Perform a dry-run migration to preview changes
openfang migrate --from openclaw --dry-run

OpenFang provides a drop-in replacement OpenAI-compatible API. Simply point your existing tools' request URLs to OpenFang. Example request:

curl -X POST localhost:4200/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "researcher",
"messages": [{"role": "user", "content": "Analyze Q4 market trends"}],
"stream": true
}'

The system offers 140+ REST/WS/SSE endpoints covering all functional modules: agents, memory, workflows, channels, models, skills, A2A, Hands, and more.

Quick OpenFang Installation

macOS/Linux

# 1. Install the system
curl -fsSL https://openfang.sh/install | sh

# 2. Initialize, follow the prompts to configure providers
openfang init

# 3. Start the daemon
openfang start

# 4. Dashboard becomes available at http://localhost:4200

# 5. Activate a Hand to start working immediately
openfang hand activate researcher

# 6. Chat with the agent
openfang chat researcher
> "What are the emerging trends in AI agent frameworks?"

# 7. Spawn a pre-built agent
openfang agent spawn coder

Windows (PowerShell)

irm https://openfang.sh/install.ps1 | iex
openfang init
openfang start

Subsequent commands for activating Hands, chatting with agents, etc., are identical to those for macOS/Linux.

OpenFang Development Commands

# Build the workspace
cargo build --workspace --lib

# Run all tests (1767+ tests)
cargo test --workspace

# Run linter (requires zero warnings)
cargo clippy --workspace --all-targets -- -D warnings

# Check code formatting
cargo fmt --all -- --check
Visit RightNow-AI/openfang to access the source code and obtain more information.