McClawd
A Rust agent platform that keeps OpenClaw's skills and workspace files, runs each task in its own Docker container and screens every tool call through security hooks.
Key metrics
Architecture
A Cargo workspace of 13 crates. Rig runs the agent loop; the `mc` binary (Axum API plus CLI) starts each task in its own Docker container, where an agent-runner binary streams results back as JSON lines. MCP tools reach the agent through AgentGateway, with an Invariant policy proxy in front of it. Every tool call passes a hook pipeline (DLP, secret scanning, AgentGuard, a Presidio/detect-secrets sidecar, audit) before and after it runs. Secrets are encrypted with AES-256-GCM-SIV and argon2 and written into the container's tmpfs at /run/secrets, never into the prompt.
Case study
McClawd
A secure agent platform, written in Rust, that stays compatible with OpenClaw.
OpenClaw-style agents are useful because they can do things: run skills, call tools, read files, send messages. That is also the problem. A tool that can reach the agent's API keys, or an injected instruction that rides in on a web page, can turn the agent against its owner.
McClawd keeps the OpenClaw ecosystem (ClawHub SKILL.md skills, SOUL.md / AGENTS.md / USER.md workspace files, openclaw.json and .mcp.json MCP config) and changes where and how the work runs. Each task gets its own Docker container. Secrets stay encrypted and out of the model's context. Every tool call passes a chain of security checks on the way in and on the way out.
What it does
- One container per task. The
mcserver starts an agent-runner container for each task through the Docker API, with memory, CPU and process limits andno-new-privileges. Withstrict_sandboxon, a task fails rather than run on the host when Docker is unavailable. - Secrets the model never sees. Secrets are encrypted at rest (AES-256-GCM-SIV, key derived with argon2) and written into the container's tmpfs at
/run/secretsafter it starts. They are not put in the prompt or set as container environment variables. - A security hook pipeline on every tool call. DLP patterns modelled on detect-secrets and Presidio, an entropy-based secret scanner, AgentGuard checks for command injection, prompt injection, homoglyphs and path traversal, a Presidio / detect-secrets sidecar with optional VirusTotal lookups, and user-defined hooks. Findings are recorded as security events in an audit log (file, Postgres or tracing sinks).
- Policy on the data flow, not just the call. A taint trace follows data through each task's tool calls, and an Invariant gateway sits in front of the MCP tools to enforce flow-based policies.
- MCP tools behind a gateway. MCP servers (filesystem, scraping, document extraction) run behind AgentGateway in their own container; the agent reaches them over MCP rather than running them in its own process.
- Single agents or swarms. A swarm crate plans a task as a dependency graph of subtasks, runs workers against it with shared memory and merges their output.
- Five chat channels. Telegram, Discord, Slack, WhatsApp and email connectors, each its own crate.
- A web console. A React UI for tasks, workspaces, skills, MCP servers, secrets, agents, usage, Docker containers, the audit log and detection rules, plus a command bar for asking the system agent.
How it works
McClawd is a Cargo workspace of 13 crates. Rig provides the LLM layer and the agent loop, so there is no hand-written ReAct loop, and rmcp handles MCP connections. mc is one binary: a CLI (mc run, mc secrets, mc workspace) and an Axum API server for the console. Inside each container a separate agent-runner binary builds the Rig agent, streams its output as JSON lines and exits, or stays up in server mode for multi-turn work. Task state lives in PostgreSQL.
The home screen embeds WorldMonitor, a third-party open-source (AGPL) world-news globe, in a secure space inside McClawd, with McClawd's agent navigation, tasks and system-agent prompt around it.
Security reviews
The project was audited from the start. A Phase 0 code-quality audit and a security audit (March 2026) found, among other things, that authentication middleware was defined but not applied to any route and that the secrets vault used a fixed passphrase; a container audit two days later found a silent fallback to host execution. The auth middleware is now applied to the protected routes, and the host fallback is now governed by the strict_sandbox setting.
Status
Built from March to September 2026; latest tag v0.9.0. About 45,000 lines of Rust with 890 Rust tests and 30 Playwright end-to-end specs for the console. Proprietary, Macleod Labs.
Tech stack
Gallery