The Problem

Enterprises that need autonomous software agents today must stitch together multiple LLM wrappers, schedule cron jobs, and maintain separate services for persistence, networking, and tooling. The result is fragile integration work, duplicated binaries, and unpredictable security posture.

What This Does

OpenFang delivers a single‑binary Agent Operating System written in Rust. The repository is a portfolio of four self‑contained projects:

  • openfang‑cli – the command‑line driver (crates/openfang-cli/src/main.rs).
  • openfang‑api – an HTTP front‑end exposing agent actions (crates/openfang-api/src/*).
  • openfang‑channels – adapters for external services such as Bluesky (crates/openfang-channels/src/bluesky.rs).
  • openfang‑runtime / kernel – the core scheduler, state store and model inference layer (crates/openfang‑runtime/src/*, crates/openfang‑kernel/src/kernel.rs).

Agents (“Hands”) are defined by TOML manifests under agents/ and are compiled into the binary, so no runtime package manager is required.

How It Is Wired

Execution begins at the CLI entry point:

  • crates/openfang-cli/src/main.rs:745 → main (calls run).
  • run (crates/openfang-cli/src/launcher.rs:183) boots the runtime (boot_kernel) and, depending on sub‑command, starts the API server or a channel bridge.

From main the call graph follows the most‑used functions:

  1. validate → Err (56 times) and is_empty (49 times) – guard clauses that gate every user‑initiated action.
  2. api_send_message (used by the API bridge) → status (46 times) → network POST to /api/shutdown (e.g., main -> cmd_stop).
  3. daemon_client (50 calls) creates an HTTP client for outbound calls such as token validation in crates/openfang‑channels/src/bluesky.rs.
  4. record (via run -> shutdown) writes to the SQLite store (conn.execute).
  5. boot_kernel → MemorySubstrate::open accesses the embedded file‑based KV store.

Key effect owners:

EffectFileFunctions that cause itReach
DB read/writecrates/openfang‑api/src/routes.rs (172 functions) – e.g., spawn_agent, list_agents55 callers, 38 calleesBroad
Network outboundcrates/openfang‑channels/src/bluesky.rs (validate_token, api_send_message)31 callersMedium
File I/Ocrates/openfang‑kernel/src/kernel.rs (open, save_agent)22 callersLimited
Model inferencecrates/openfang‑runtime/src/a2a.rs::new (calls inference)47 callersMedium

The import graph shows only two edges and no circular dependencies, so the modules are loosely coupled. The most‑connected module is sdk/javascript/index (imported by two other modules), but it does not participate in the core runtime.

How To Use It

# Clone the repo
git clone https://github.com/moses-y/openfang
cd openfang

# Build the single binary (requires Rust toolchain)
cargo build --release          # produces target/release/openfang

# Run the CLI (see built‑in help)
./target/release/openfang --help

# Example: start the API server
./target/release/openfang api serve

# Example: launch a specific hand (agent)
./target/release/openfang start --hand lead

A Docker image can be built with the provided Dockerfile:

docker build -t openfang:0.1.0 .
docker run --rm -p 4200:4200 openfang:0.1.0 api serve

Configuration files such as agents/<name>/agent.toml and the optional .env.example supply required keys (e.g., LLM API tokens, database URL). No additional package managers are required.

Real‑World Use

A SaaS provider wants daily prospect generation. They place the lead hand under agents/lead/agent.toml, configure the OpenAI key in .env, and run openfang start --hand lead. The binary schedules the hand, writes qualified leads to the embedded SQLite store, and pushes a CSV to a configured webhook—all without external orchestration tools.

Code Health & Issues

  • Critical – wasmtime@41 vulnerable to CVE‑2026‑34971 (pinned). Fix: upgrade version and update Cargo.lock.
  • High – Pin GitHub Actions to commit SHA (.github/workflows/*.yml). Fix: replace @vN with full SHA.
  • High – Upgrade vulnerable crates: tokio@1 (CVE‑2021‑45710), rmp-serde@1, aes-gcm@0.10. Fix: bump to patched releases.
  • High – Wildcard CORS (packages/whatsapp-gateway/index.js). Fix: enumerate allowed origins.
  • Medium – Declare least‑privilege GITHUB_TOKEN permissions (.github/workflows/ci.yml).
  • Medium – Enable Dependabot/Renovate for 17 manifests.
  • Medium – Pin Docker base images by digest (Dockerfile).
  • Medium – Set persist-credentials: false on checkout (.github/workflows/release.yml).
  • Medium – Add non‑root USER to container (Dockerfile).
  • Low – Add timeout-minutes to CI jobs (.github/workflows/ci.yml).

All findings are derived from the static analysis report; no additional issues were detected.

The Bottom Line

OpenFang offers a cohesive, single‑binary platform for autonomous agents, with a well‑structured Rust codebase and complete test suite. Security‑related dependency pinning and CI hardening need immediate attention before production use. It is best suited for teams that want a Rust‑native agent runtime without managing a microservice mesh.