v0.1.0 · MIT · crates.io · docs.rs

The agent runtime that runs as a binary.

Open-source. MIT-licensed. Rust-grade primitives — event-sourced sessions, platform sandboxing, JSON-RPC 2.0 gateway, AES-256-GCM secrets, embedded Vue dashboard. Compatible with TypeScript OpenClaw plugins via an nng IPC bridge.

  • Linux
  • macOS
  • Windows
  • Rust 1.85+ (2024 edition)
  • 10 crates
  • sled event store
  • axum gateway
  • MIT
why · rust

The TypeScript OpenClaw is great. The runtime is the cost.

Node.js is fine for a lot of things and unfortunate for agent runtimes: 100 MB+ deployments, GC pauses under sustained load, soft type guarantees that turn into runtime crashes on hostile input. openclaw-rs is the same architecture, same plugin contract, same config format — but rebuilt in Rust so the runtime itself stops being a liability.

01

Single static binary

cargo install openclaw-cli → one executable: gateway, runtime, sandbox, dashboard, CLI. No Node, no node_modules.

02

Memory-safe, no GC

Ownership model, #![forbid(unsafe_code)], no null pointer exceptions, no data races, no GC pause tails.

03

Drop-in plugin compat

Existing TypeScript plugins run unchanged via an nng IPC bridge. Same 8 lifecycle hooks, same payloads.

04

Security by construction

Input validation at every boundary, platform sandbox per OS, AES-256-GCM credentials, fail-secure errors, audit log.

primitives

Eight load-bearing primitives.

Every one is real, documented, tested. Click any to read the deep dive.

  • 01

    EventStore

    Append-only sled-backed log of every session event.

    Eight event kinds (SessionStarted, MessageReceived, ToolCalled…). Replayable, auditable, time-travel-capable by construction.

    • sled
    • append-only
    • auditable
  • 02

    SessionProjection

    Conflict-free derived state via last-write-wins CRDT merge.

    Project the event log into whatever read model you need — chat view, agent memory, audit trail — without write-write contention.

    • crdt
    • lww
    • projection
  • 03

    Sandbox

    Platform-native tool isolation on Linux, macOS, and Windows.

    bubblewrap, sandbox-exec, and Job Objects behind one Rust API. Three levels — None, Relaxed, Strict — per agent or per tool call.

    • bwrap
    • sandbox-exec
    • job-objects
  • 04

    Gateway

    axum HTTP + WebSocket + JSON-RPC 2.0 in one binary.

    session.create / message / history / end · agent.list / status · tools.list / execute — over HTTP and WS with rate limiting and auth.

    • axum
    • json-rpc
    • websocket
  • 05

    ProviderMatrix

    Anthropic + OpenAI clients with SSE streaming and tool use.

    Same Provider trait for both; custom base URLs for Azure or proxies; per-agent provider routing. Google Gemini and Ollama on the way.

    • anthropic
    • openai
    • sse
  • 06

    Channels

    Telegram Bot API today; trait-based, allowlist-gated.

    Channel / ChannelInbound / ChannelOutbound traits make Discord, Slack, Signal, Matrix, and WhatsApp single-PR additions.

    • telegram
    • allowlist
    • routing
  • 07

    PluginBridge

    TypeScript plugins keep working via nng IPC.

    Eight lifecycle hooks (Before/After Message + ToolCall, Session Start/End, AgentResponse, Error) over JSON-RPC. Drop-in for TS OpenClaw users.

    • nng
    • ipc
    • hooks
  • 08

    NodeBindings

    napi-rs bindings expose the Rust core to Node.js.

    AnthropicProvider, OpenAIProvider, CredentialStore, NodeEventStore, ToolRegistry — pre-built binaries for Linux x64/arm64, macOS x64/arm64, Windows x64.

    • napi-rs
    • node
    • prebuilt
architecture

Three tiers. One binary.

Clients hit the gateway over JSON-RPC. The gateway composes agents, channels, providers, and plugins on top of a shared core. Everything is in one process unless you choose otherwise.

  • Gateway: axum HTTP + WebSocket + JSON-RPC + rate limit + auth + embedded Vue dashboard.
  • Core services: agents, channels, providers, plugins — composable, decoupled.
  • Foundation: sled-backed event store, AES-256-GCM credential store, validation, OAuth.
[ CLIENTS ] CLI · macOS app Node.js (napi-rs) TS plugins (IPC) Channels (Telegram, …) HTTP/WS · JSON-RPC 2.0 [ openclaw-gateway ] axum · WebSocket · rate-limit · auth · CORS embedded Vue 3 dashboard at / openclaw-agents runtime · sandbox workflow · tools openclaw-channels routing · allowlist Telegram adapter openclaw-providers Anthropic · OpenAI SSE streaming openclaw-plugins TS bridge (nng) WASM (planned) openclaw-core types · config · sled event store · validation AES-256-GCM credential store · OAuth openclaw-ipc + openclaw-node nng transport · JSON-RPC msgs napi-rs bindings for Node.js
Clients hit the gateway over JSON-RPC. The gateway composes agents, channels, providers, and plugins on top of a shared core.
event sourcing

Every state change is an event.

Sessions are append-only logs of SessionEvent values in sled. Replayable. Auditable. Time-travel-capable. The rendered conversation is just a projection.

We project with CRDT semantics — last-write-wins on every state key, versioned by the event's monotonic sequence. Future multi-instance coordination is safe by construction.

Read the deep dive →
SessionStarted channel, peer_id MessageReceived content, attachments ToolCalled tool, params ToolResult result, success AgentResponse tokens MessageSent content, message_id StateChanged key, value SessionEnded reason Append-only log in sled · replayable · time-travel debugging · CRDT projection via last-write-wins merge
Every state change is an event. The session is the log; the rendered conversation is just a projection.
quickstart

Three commands.

One cargo install. One interactive wizard. One gateway. The dashboard is at http://localhost:18789.

shell
$ cargo install openclaw-cli
$ openclaw onboard
$ openclaw gateway run
providers

Anthropic + OpenAI today.

Same Provider trait for both. SSE streaming, tool use, custom base URLs. Google Gemini and Ollama on the roadmap.

shipped

Streaming, tool use, drop-in today

  • AnthropicProvider Anthropic Messages API

    Claude 3.5 Sonnet · Haiku · Opus

    Full async client. SSE streaming, tool use, content blocks, custom base URLs.

  • OpenAIProvider OpenAI Chat Completions

    GPT-4o · GPT-4 · GPT-3.5

    Azure-compatible base URLs, org-id headers, function calling, SSE streaming.

planned

On the roadmap

  • GoogleProvider Gemini API

    Gemini 2.5 Pro · Flash

    Roadmap item — see docs/ROADMAP.md. Will reuse the existing Provider trait.

  • OllamaProvider localhost:11434

    Any Ollama-served model

    Local-only deployments. Shares the streaming abstraction.

channels

Telegram now. The rest next.

The Channel trait is stable. Telegram is the reference implementation. Adding Discord, Slack, Signal, Matrix, or WhatsApp is a single-PR add.

Telegram shipped

Full Bot API adapter with attachments, allowlist-based access control, and rule-based agent routing.

  • Long polling + webhook
  • Photo / document / voice attachments
  • Per-channel allowlist
  • Routes to multiple agents by rule
Discord planned

Slash commands, threaded conversations, attachments.

  • Roadmap target
  • Trait-based, single-PR add
Slack planned

App Mention, DM, slash commands, threaded replies.

  • Roadmap target
  • Bolt-equivalent surface
Signal planned

Privacy-first channel via signal-cli or signald.

  • Roadmap target
Matrix planned

Federated open-protocol adapter.

  • Roadmap target
  • End-to-end encrypted rooms
WhatsApp planned

WhatsApp Business API, with template-message support.

  • Roadmap target
crates

Ten crates, one workspace.

Eight stable today. Two partial — the channel adapter set and the WASM plugin runtime.

Crate Status Role Links
openclaw-core stable Foundation: types, JSON5 config loader, sled-backed event store, AES-256-GCM credential store, OAuth token management, input validation.
openclaw-ipc stable IPC message types and nng transport — the wire format for the TypeScript plugin bridge.
openclaw-providers stable Anthropic + OpenAI clients with SSE streaming, tool use, and configurable base URLs.
openclaw-agents stable Agent runtime, platform-specific sandbox (bwrap / sandbox-exec / Job Objects), tool registry, node-based workflow engine.
openclaw-channels partial Channel traits + allowlist + routing. Telegram adapter complete; Discord, Slack, Signal, Matrix, WhatsApp planned.
openclaw-gateway stable axum HTTP/WebSocket server with JSON-RPC 2.0 dispatch, rate-limit and auth middleware, embedded Vue 3 dashboard.
openclaw-plugins partial Plugin API + nng-based TypeScript bridge. WASM runtime (wasmtime vs wasmer) under evaluation.
openclaw-cli stable Top-level CLI: onboard, gateway, doctor, status, config, sessions, channels, daemon, completion.
openclaw-node stable napi-rs bindings: AnthropicProvider, OpenAIProvider, NodeEventStore, CredentialStore, ToolRegistry. Pre-built binaries on npm.
openclaw-ui stable Vue 3 + Vite dashboard. Served by openclaw-gateway at /. No external admin to deploy.
security

Defence in depth, by default.

Input validation at every boundary. Platform sandbox per OS. AES-256-GCM credentials. Fail-secure errors. Audit log throughout.

Oversized payloads (DoS) Hard limits at boundaries

100 KB max message, 50 MB max attachment, 10-attachment cap, JSON depth 32.

Command injection via tools Platform sandbox

bubblewrap (Linux), sandbox-exec (macOS), Job Objects (Windows). Three levels: None / Relaxed / Strict.

Secret exfiltration Redaction by type

ApiKey wraps SecretBox<str>; Debug/Display always print [REDACTED]. Scrubbed in tracing spans.

Credential theft at rest AES-256-GCM + Argon2id

Encrypted credential store with 0600 file permissions; nonce per record.

Path traversal in file ops Validated path handling

validate_path() rejects `..` segments, null bytes, and paths outside the workspace mount.

Rate-limit abuse Per-client buckets

Default 60 requests/min per client and 30 messages/min per session via tower middleware.

Untrusted plugin code Out-of-process IPC

TypeScript plugins run in their own process; communicate over nng with bounded JSON-RPC messages.

Unsafe Rust Forbidden

#![forbid(unsafe_code)] across every workspace crate.

code

Rust core. Node bindings. Same primitives.

The Rust crates expose the runtime directly. openclaw-node wraps them with napi-rs and ships pre-built binaries on npm.

Rust
src/main.rs
use openclaw_providers::{AnthropicProvider, Provider};
use openclaw_core::secrets::ApiKey;

let provider = AnthropicProvider::new(ApiKey::new("sk-ant-...".into()));
let response = provider.complete(request).await?;
Node.js
src/index.ts
import { AnthropicProvider } from "openclaw-node";

const provider = new AnthropicProvider(process.env.ANTHROPIC_API_KEY);
const res = await provider.complete({
  model: "claude-3-5-sonnet-20241022",
  messages: [{ role: "user", content: "Hello!" }],
  maxTokens: 1024,
});
comparison

openclaw-rs vs the rest.

Honest side-by-side reads. Pick by shape, not by feature checklist.

Capability openclaw-rs TS OpenClaw LangChain Mastra Rig
Single static binary cargo install, no runtime needs Node.js needs Python or Node Node.js backend Rust library, embed it
Event sourcing core sled append-only log via storage abstractions ad-hoc / not core via memory adapters library-level only
Platform sandbox for tools bwrap / sandbox-exec / Job Objects process-level only out of scope out of scope library-level only
JSON-RPC HTTP + WS gateway axum, in-binary via plugins bring-your-own server Next.js / Hono bring-your-own server
Encrypted credential store AES-256-GCM + Argon2id env-var / OS keyring user responsibility env-var user responsibility
Input validation at boundary size + depth + char limits ad-hoc user responsibility schema validation user responsibility
TypeScript plugin compat nng IPC bridge native TS no such concept no such concept no such concept
Node.js SDK from same core napi-rs, prebuilt binaries is the Node SDK is JS-native is JS-native FFI wrappers possible
Embedded dashboard UI Vue 3, served by gateway separate web app user responsibility playground UI user responsibility
License MIT MIT MIT Elastic / mixed MIT
faq

The questions developers ask first.

The full set lives on the FAQ page; here are the six that come up before adoption.

openclaw-rs is a Rust implementation of OpenClaw, an open-source AI agent framework. It is event-sourced, sandboxed, and single-binary. The same workspace ships a JSON-RPC 2.0 gateway (axum, HTTP + WebSocket), an agent runtime with platform-specific sandboxes, Anthropic + OpenAI provider clients, a Telegram channel adapter, an AES-256-GCM credential store, a Vue 3 dashboard, and napi-rs bindings for Node.js.

install

Ship event-sourced, sandboxed agents in Rust.

openclaw-rs is MIT, on crates.io, and one cargo install away.