OpenClaw is an open-source, self-hosted AI assistant whose long-running Gateway connects messaging channels and operator clients to models, sessions, memory, tools, skills, plugins, and execution backends. Its value is not that it makes an LLM magically autonomous. It gives an operator a persistent control plane for receiving requests, assembling context, invoking models, executing allowed actions, and returning results.
That power changes the security question. A chatbot usually produces text. An OpenClaw deployment may hold channel credentials, read private context, execute shell commands, control a browser, and send messages. The right evaluation starts with trust boundaries and effective permissions, not a feature checklist.
Key takeaways
- The Gateway is the trusted control plane. It owns channel connections, configuration, credentials, sessions, routing, and the control API.
- Self-hosting controls where OpenClaw state lives; it does not guarantee that prompts or tool data never leave the machine.
- Sandboxing is off by default. In the trusted single-operator profile, tool execution can occur on the Gateway host.
- A sandbox decides where a tool runs. Tool policy decides which tools exist. Elevated execution is a separate escape path for
exec. - One Gateway represents one trust boundary. Separate mutually untrusted users or tenants with distinct Gateways, credentials, and preferably OS users or hosts.
- Production readiness requires evidence for admission control, session isolation, least privilege, egress, recovery, upgrades, and auditability.
What is OpenClaw?
OpenClaw is best understood as an operator-owned agent system, not merely a model wrapper. A persistent Gateway accepts messages from supported channels and clients, resolves the target session and agent, builds the model context, exposes the permitted tools, streams work, stores state, and routes the final reply.
The project is MIT-licensed and can use hosted or local model providers. It supports chat channels, a browser-based Control UI, command-line clients, device nodes, skills, plugins, scheduled work, and several execution targets. The exact surface depends on the installed release and enabled configuration, so a deployment inventory matters more than a generic capability list.
OpenClaw is not automatically:
| Claim | Accurate interpretation |
|---|---|
| "Everything stays local" | Gateway state can be local, but configured model providers, channels, plugins, tools, and diagnostics may receive data. |
| "Every command runs in Docker" | Sandboxing is optional and off by default. Only configured tool execution moves into the selected backend. |
| "One instance securely isolates any number of users" | One Gateway is one operator or mutually trusting team boundary, not hostile multi-tenant isolation. |
| "A skill is a secure plugin" | A skill supplies instructions. A plugin can add executable runtime capabilities. Both require provenance review. |
| "The agent completes any digital task" | Success depends on the model, tool contracts, credentials, environment, failure handling, and task acceptance criteria. |
The official project repository and Getting Started guide are the authoritative starting points for current prerequisites and installation commands.
How the OpenClaw architecture works
OpenClaw separates a durable control plane from clients, model runtimes, and optional execution backends. This separation is useful because identity, policy, state, and credentials can stay with the Gateway while risky work is moved elsewhere.
Gateway: the system of record
The Gateway is a long-lived process. According to the official architecture reference, it owns messaging connections and exposes a typed WebSocket API to the Control UI, CLI, apps, automations, and paired nodes. It validates protocol frames, emits lifecycle events, and stores the state needed to continue sessions.
The normal local bind is 127.0.0.1:18789. Loopback is a useful network default, but it is not a substitute for authentication, channel admission, tool restrictions, or host hardening.
Agent loop: one message becomes a controlled run
The agent loop turns an accepted message into a serialized run:
- Validate the request and resolve its session.
- Resolve the model, authentication profile, workspace, and skill snapshot.
- Assemble the system prompt and conversation context.
- Call the model and stream assistant or tool events.
- Check policy before each tool call and run allowed work on the configured target.
- Persist transcript and lifecycle state.
- Shape and deliver the final reply.
Runs are serialized per session to reduce races. That does not make side effects transactional. A tool may send a message or mutate an external system before a later step fails, so important workflows still need idempotency keys, operation receipts, and reconciliation.
Tools, skills, and plugins are different
OpenClaw exposes three extension layers:
| Layer | Purpose | Main risk |
|---|---|---|
| Tool | A typed action such as file access, browser control, execution, or messaging | Direct side effects and data disclosure |
| Skill | Instructions that teach the agent a repeatable workflow | Malicious or weak instructions can steer permitted tools |
| Plugin | Runtime code that adds tools, providers, channels, hooks, or skills | Supply-chain code executes inside the trusted installation boundary |
A tool policy filters which tool schemas reach the model. A skill cannot restore a denied tool. A plugin, however, is code and should be reviewed, pinned, tested, and allowlisted like any other dependency.
Sessions and memory are explicit state
Sessions are Gateway-owned conversation records. Direct messages share the main session by default for a personal assistant, while groups and rooms are normally isolated. If several people can send direct messages, configure session.dmScope: "per-channel-peer" or a stricter account-aware scope; otherwise different senders can share context.
Long-term memory is not hidden model state. The memory documentation describes durable Markdown files such as USER.md, MEMORY.md, and dated notes, plus searchable indexes. Session transcripts and runtime state live separately. Treat both as sensitive data because they can contain prompts, file contents, tool output, and identifiers.
The security model: defaults versus hardened deployment
OpenClaw's default posture is designed for one trusted operator on a local machine. It is not the same as a hardened shared deployment.
| Control | Typical default | What a hardened deployment should decide |
|---|---|---|
| Gateway network | Loopback bind | Authenticated private ingress, firewall, tunnel, or tailnet |
| Unknown DMs | Pairing on most DM-capable channels | Explicit allowlists and periodic approval review |
| DM session scope | Shared main session | Per-channel-peer isolation for multiple senders |
| Host execution | Allowed for trusted personal use | Deny, approve, or move to an isolated execution target |
| Sandbox | Off | Enable deliberately and inspect effective mode, scope, mounts, and network |
| Cross-agent session reach | Broad inside one Gateway | Narrow visibility or split Gateways where trust differs |
| Skills and plugins | Operator-selected | Pin, review, verify provenance, and minimize enabled surface |
One Gateway equals one trust boundary
The official trust model supports a single operator or mutually trusting team per Gateway. It explicitly does not claim hostile multi-tenant isolation. Session keys route context; they are not authorization tokens. Anyone who can modify Gateway state or configuration is a trusted operator.
For a shared business assistant, use a dedicated machine or VM, dedicated OS user, business-only accounts, scoped credentials, and a separate Gateway from personal data. For mutually untrusted users or organizations, isolate each tenant in its own Gateway cell and host boundary.
Sandboxing, tool policy, and elevated execution
These controls answer different questions:
| Control | Question | Important limit |
|---|---|---|
| Sandbox | Where does tool execution run? | The Gateway remains on the host; sandboxing is off by default. |
| Tool policy | Which tools can the model call? | Denying file tools does not make an allowed shell read-only. |
| Exec approval | Which host commands need approval? | Approval is an intent guardrail, not tenant isolation. |
| Elevated | May exec leave an ordinary sandbox? |
It is an explicit escape path and must be disabled or tightly scoped. |
| OS/host boundary | What can a compromised process ultimately reach? | This is the strongest boundary for mutually untrusted workloads. |
The official sandbox guide states that sandboxing reduces blast radius but is not a perfect security boundary. Mounts, network access, credentials, browser profiles, and tool policy still define what the process can reach. Never mount a Docker socket into an agent sandbox unless host control is the intended outcome.
Prompt injection is an authorization problem
Prompt injection cannot be solved by telling the model to ignore malicious text. Web pages, documents, emails, quoted messages, and tool results can all carry untrusted instructions. The OWASP prompt injection guidance recommends least privilege, deterministic validation, external-content separation, human approval for high-risk actions, and adversarial testing.
Apply that guidance operationally:
- Admit only known senders and channels.
- Give each agent the smallest tool set and credential scope it needs.
- Keep untrusted content separate from operator instructions.
- Require approval or deterministic policy for irreversible actions.
- Sandbox execution and restrict egress.
- Record requested action, policy decision, tool arguments, result, and delivery receipt.
A practical hardened baseline
A useful baseline keeps the Gateway local, isolates direct-message sessions, disables broad runtime and filesystem access, and turns off elevated execution. Adapt the exact fields to the installed release and validate them with the official configuration reference.
{
gateway: {
mode: "local",
bind: "loopback",
auth: {
mode: "token",
token: "<long-random-token>"
}
},
session: {
dmScope: "per-channel-peer"
},
tools: {
profile: "messaging",
deny: [
"group:automation",
"group:runtime",
"group:fs",
"sessions_spawn",
"sessions_send"
],
fs: {
workspaceOnly: true
},
exec: {
security: "deny",
ask: "always"
},
elevated: {
enabled: false
},
sessions: {
visibility: "agent"
},
agentToAgent: {
enabled: false
}
}
}
This is a starting point, not a certificate. A real deployment must also define channel-specific pairing and group policies, sandbox mode and workspace access, plugin allowlists, secret ownership, outbound network destinations, retention, and incident response.
Inspect the effective posture rather than trusting the source file:
openclaw gateway status
openclaw security audit --deep
openclaw sandbox explain --json
security audit checks exposure, admission, permissions, plugins, and policy drift. sandbox explain shows where a particular session will execute and which rules produced that result.
Where data actually goes
Self-hosting means you operate the Gateway and its state; it does not mean every byte remains on that host.
| Data | Possible destination | Operator decision |
|---|---|---|
| Messages and conversation context | Configured model provider | Provider, retention policy, regional endpoint, or local model |
| Replies and attachments | Messaging platform | Channel choice and account scope |
| Tool arguments and results | APIs, browsers, nodes, sandboxes, plugins | Tool allowlist, egress policy, credentials, redaction |
| Sessions, credentials, memory, logs | Gateway state directory and backups | Encryption, permissions, retention, backup access |
| Diagnostics and metrics | Configured telemetry backend | Whether export is enabled and what fields leave the host |
The secrets and storage guide advises treating the entire OpenClaw state directory as sensitive. Protect it with restrictive file permissions, full-disk encryption, a dedicated OS account on shared hosts, and a tested retention policy. Do not assume log redaction removes every business secret from transcripts.
Deployment patterns and when to use them
Choose a deployment pattern from the trust model, not from convenience.
| Pattern | Suitable for | Required controls |
|---|---|---|
| Personal laptop Gateway | One trusted operator and low-impact personal tasks | Loopback, pairing, scoped accounts, reviewed tools, reliable backups |
| Dedicated personal server | Always-on access for one operator | Private ingress, service supervision, disk encryption, sandboxing, cost limits |
| Team Gateway | Mutually trusting team with business-only data | Dedicated host identity, per-peer sessions, role limits, minimal tools, audit and recovery |
| Per-tenant Gateway cells | Users or organizations that do not trust each other | Separate Gateway, credentials, OS identity or host, state, network policy, and backups |
| Disposable worker execution | High-risk coding or browser workloads | Scoped short-lived credentials, isolated workspace, restricted egress, artifact review |
OpenClaw is a strong fit when you need a persistent, self-managed assistant across several channels and are prepared to operate its identity, policy, state, and recovery surface. It is a poor fit when a deterministic workflow engine would be clearer, when no one owns ongoing patching, or when mutually hostile tenants must share one process.
OpenClaw versus adjacent options
| Option | Primary abstraction | Best fit | Main tradeoff |
|---|---|---|---|
| Hosted chat assistant | Vendor-managed conversation | Low-operations interactive help | Less control over runtime and integration boundary |
| Workflow automation | Explicit trigger and action graph | Deterministic business processes | Less flexible natural-language planning |
| Agent SDK or graph framework | Components for building an application | Product teams implementing custom control planes | You own channels, state, policy, and operations |
| Coding agent | Repository-centered software task loop | Code changes, tests, and review | Narrower general-assistant and channel scope |
| OpenClaw | Persistent operator-owned Gateway | Multi-channel personal or trusted-team assistant | Significant security and operations responsibility |
A safe evaluation workflow
Evaluate OpenClaw on an isolated test identity before connecting personal mail, production repositories, payment systems, or administrator credentials.
1. Define the acceptance contract
Write down:
- Who may send requests?
- Which data may enter the model context?
- Which tools and destinations are allowed?
- Which actions require approval?
- What must be logged?
- How will you stop, recover, and reconcile partial work?
Without these answers, a successful demo proves only that the happy path worked.
2. Install from the current official instructions
Check the supported Node.js versions in the Getting Started guide, then use the documented installer or package command. Do not reuse an old blog's version requirements or Compose file.
npx openclaw@latest
For a persistent service, complete onboarding and install the Gateway through the supported CLI:
openclaw onboard --install-daemon
openclaw gateway status
openclaw dashboard
Record the exact OpenClaw version, Node.js version, plugins, model provider, channel adapters, and effective configuration used in the evaluation.
3. Start with one low-risk channel and tool set
Use pairing, a temporary provider credential with a spending cap, and a workspace that contains no production secrets. Deny shell, broad filesystem access, outbound messaging, and control-plane tools until the test requires one of them.
4. Test security properties, not just task completion
| Test | Evidence to retain |
|---|---|
| Unknown sender attempts a DM | Pairing or rejection result |
| Two approved senders ask about private context | Proof that session scope prevents cross-user disclosure |
| Untrusted page contains tool instructions | Tool denial, approval, or sandbox containment result |
| Agent requests an undeclared destination | Egress or tool-policy denial |
| Gateway restarts during a run | Recovery outcome and duplicate-side-effect check |
| Model provider returns timeout or rate limit | Bounded retry and visible terminal result |
| Plugin or skill version changes | Review record, pinned artifact, and rollback path |
5. Prove backup and restore before upgrades
OpenClaw provides verified backup commands. Store archives outside the live state directory and protect them like production credentials.
openclaw backup create --verify --output "$HOME/Backups"
openclaw backup verify "$HOME/Backups/<archive>.tar.gz"
Restoration targets a fresh directory and activation is a separate offline step. Test that procedure before relying on a backup. Then use the documented updater and run post-update health and security checks:
openclaw update
openclaw doctor
openclaw gateway status
openclaw security audit --deep
Production evaluation scorecard
Do not choose an agent platform from a demo success rate alone. Measure safety and operability alongside task quality.
| Dimension | Example metric | Release gate |
|---|---|---|
| Task quality | Accepted outcomes / evaluated tasks | Meets task-specific target on a frozen fixture set |
| Side-effect precision | Correct writes or sends / attempted writes or sends | No unapproved destination or scope |
| Containment | Blocked adversarial actions / attempted adversarial actions | All critical attempts blocked or approved explicitly |
| Recovery | Runs reconciled without duplicate effects / interrupted runs | Idempotency and replay behavior verified |
| Cost | Model and tool cost per accepted outcome | Budget and runaway-loop limits defined |
| Latency | p50 and p95 time to accepted result | Fits the channel's response expectations |
| Audit completeness | Actions with identity, policy, arguments, result, and receipt | Complete for privileged actions |
| Upgrade safety | Successful staged update and rollback exercises | Backup verified and rollback rehearsed |
The fixture set should include ordinary tasks, ambiguous requests, indirect prompt injection, unavailable dependencies, expired credentials, duplicate messages, interrupted runs, and denied operations. Keep the test inputs and expected outcomes versioned.
Common failure modes
Assuming local state means local processing
A hosted model still receives the context sent to it. A messaging provider still carries inbound and outbound messages. Remote tools and plugins may add more destinations. Maintain a data-flow inventory for every enabled integration.
Sharing the default DM session
The personal-assistant default favors continuity across direct-message channels. In a multi-user inbox, that can expose one sender's context to another. Set a peer-isolated DM scope and test it with separate accounts.
Enabling a sandbox without checking mounts
A sandbox with a writable host workspace, broad network access, or a mounted Docker socket can retain a large blast radius. Verify mode, scope, workspace access, mounts, user, capabilities, and egress.
Denying file tools while leaving unrestricted shell access
Tool names are not semantic side-effect controls. If exec remains available on the host, the agent may still read or modify files through shell commands. Deny runtime tools or enforce the boundary at the execution environment.
Treating skills as harmless text
Skills can tell an agent when and how to call privileged tools. Plugins add executable code. Review provenance, permissions, dependencies, network behavior, update ownership, and the exact revision before enabling either.
Skipping recovery design
Long-running agent work crosses model calls, local state, messaging systems, and external APIs. A timeout may happen after an external side effect. Use idempotency keys where supported, record operation receipts, reconcile uncertain outcomes, and make retries explicit.
Frequently asked questions
Is OpenClaw an AI model?
No. OpenClaw is an agent platform that connects models or model-specific harnesses to channels, state, policies, and tools. Model quality affects planning and tool use, but the Gateway owns the surrounding operational system.
Is OpenClaw fully autonomous?
Autonomy is a deployment choice, not a binary product property. Scheduled triggers, tools, and long-running sessions can reduce human involvement, while approvals, allowlists, and restricted tools can keep high-impact decisions under operator control.
Can OpenClaw run entirely offline?
Only if every dependency is local. That includes the model, embeddings, channels, tools, package sources, and any external APIs. A locally hosted Gateway with a cloud model or Telegram channel is not offline.
Does Docker make OpenClaw safe?
Docker can reduce process and filesystem access when configured correctly, but it does not remove prompt injection, credential misuse, unsafe mounts, excessive network access, vulnerable plugins, or cross-user context risks. Treat it as one layer.
How is OpenClaw different from LangGraph or an automation platform?
OpenClaw provides an operator-facing, persistent assistant with a Gateway, channels, sessions, memory, and execution controls. An agent framework supplies application-building primitives, while workflow automation emphasizes explicit trigger-action graphs. Choose based on the control plane you need to own.
Summary
OpenClaw is valuable because it turns models, channels, state, and tools into one persistent assistant under operator control. The same integration depth also makes its Gateway, credentials, session routing, plugins, and execution targets part of your security perimeter.
The decisive questions are therefore concrete: who can trigger the agent, what context they can reach, which actions the model can request, where those actions run, what data leaves the host, and how the operator proves recovery. Answer those with configuration and test evidence before connecting valuable accounts.