A self-hosted OpenClaw Gateway can become a privileged bridge between messaging channels, files, browsers, APIs, command-line tools, and credentials. Security therefore depends on more than a firewall. You need a clear trust boundary, private and authenticated access, narrow tools and credentials, reviewed extensions, patched software, protected backups, and a recovery path.
This checklist is based on OpenClaw’s current security and remote-access documentation. It is operational guidance, not a guarantee that any configuration is risk-free. Revisit the upstream documentation after upgrades because defaults and audit checks can change.
1. Write Down the Trust Boundary
OpenClaw’s security model treats authenticated operator access inside one Gateway as a trusted control-plane role, not as strong multi-tenant isolation. One Gateway should therefore represent one trusted operator or a mutually trusting group.
- List every person and system that can send instructions to the Gateway.
- Identify whether those users fully trust one another.
- Use separate Gateways and credentials for adversarial or mixed-trust users.
- For stronger isolation, use separate OS users or separate hosts.
- Do not mistake separate agent personas or session keys for authorization boundaries.
This decision comes before tool policy. A perfect tool allowlist cannot turn a shared full-control operator boundary into untrusted multi-tenancy.
2. Keep the Gateway Off the Public Internet
A normal host installation binds the Gateway to loopback. Preserve that default where possible. For remote access, OpenClaw recommends an SSH tunnel or Tailscale so the Gateway can remain private.
- Confirm the bind address instead of assuming the default survived configuration changes.
- Use a firewall to prevent direct access to the Gateway port.
- Prefer Tailscale Serve, a trusted tailnet path, or an SSH tunnel for administration.
- If you use a reverse proxy, trust only its known addresses and block bypass access.
- Avoid public reverse proxies or public binds unless you understand and authenticate the full path.
Public exposure is especially dangerous when shell, browser, filesystem, or write-capable API tools are enabled. Network privacy and application authentication should reinforce each other.
3. Enable Strong Gateway Authentication
Gateway authentication protects operator APIs and the control plane. Treat a shared secret with operator access like a root-equivalent application credential: it can authorize powerful actions even if lower-level tools have additional policy.
- Use a strong, unique token or password supported by the current Gateway configuration.
- Store it in a secret manager, protected environment file, or similarly restricted mechanism.
- Do not paste it into chat, tickets, screenshots, or repositories.
- Rotate it after suspected exposure or when an operator leaves.
- Verify that every non-loopback access path still requires authentication.
Tailscale identity can help on supported access paths, but it does not automatically authenticate every OpenClaw HTTP API. Follow the current remote-access and authentication documentation for the exact route you expose.
4. Restrict Messaging Channels and Pairing
A private Gateway can still receive untrusted content through Telegram, Slack, Discord, email, webhooks, or another channel. Restrict who can initiate conversations and what contexts can trigger tools.
- Allowlist expected users, groups, workspaces, or channels.
- Keep unknown direct-message pairing behavior enabled unless you have a deliberate alternative.
- Require mentions or explicit invocation in group contexts where appropriate.
- Separate public content ingestion from privileged operator commands.
- Test that an unapproved sender cannot trigger a tool or expose private context.
Treat every fetched page, email, document, and message as untrusted input. Content can contain instructions intended to manipulate the model even when the sender cannot directly call a tool.
5. Give Credentials the Narrowest Useful Scope
Credentials define the maximum damage available after a policy failure. Model instructions and approval prompts are helpful controls, but the API scope, account role, and funded balance are harder boundaries.
- Use dedicated service accounts instead of personal administrator credentials.
- Begin with read-only scopes and add write scopes only for a documented workflow.
- Use separate credentials for separate agents or environments.
- Set provider-side limits, allowlists, or spending caps where available.
- Rotate long-lived credentials on a schedule and after personnel or scope changes.
- Remove unused credentials instead of leaving them available “just in case.”
Review logs and backups as part of credential handling. An archive or debug log can expose the same secret even when the live configuration file has correct permissions.
6. Minimize Tool and Filesystem Access
Enable only the tools the agent needs. Shell execution, browser control, unrestricted filesystem access, and network clients create a much broader attack surface than a read-only API tool.
- Restrict command execution and remove unused binaries from the service environment.
- Limit filesystem access to required directories.
- Keep sensitive host paths outside the agent workspace.
- Restrict outbound network destinations where practical.
- Require approval for destructive, external, financial, publishing, or account-changing actions.
- Log consequential tool calls without logging secrets.
Test denied actions too. A policy that has only been tested on the happy path may fail open when a tool receives an unexpected argument or follows a redirect.
7. Understand What Sandboxing Does and Does Not Do
OpenClaw sandboxing is off by default in the upstream guidance and can move tool execution into an isolated environment. It limits filesystem and process access, but it does not move the Gateway itself into the sandbox and is not a perfect security boundary.
- Enable sandboxing for workflows that benefit from isolated tool execution.
- Review mounted paths, environment variables, network access, and available binaries.
- Do not mount host secrets into the sandbox unless the task requires them.
- Keep host-level permissions narrow even when sandboxing is enabled.
- Use separate hosts for stronger isolation between hostile users or high-risk workloads.
Think of sandboxing as defense in depth. It can reduce the consequences of a bad tool call, but it cannot compensate for public unauthenticated access or unrestricted credentials.
8. Review Skills, Plugins, and MCP Servers
Extensions are code and instructions added to a privileged system. Review their source, release process, dependencies, requested permissions, and network behavior before installation.
- Prefer maintained upstream repositories and verified release artifacts.
- Pin versions or commits when reproducibility matters.
- Read installation scripts before executing them.
- Inspect tool descriptions for unexpectedly broad capabilities.
- Remove extensions that are abandoned, duplicated, or no longer used.
- Re-review an extension after a major update or ownership change.
A tool’s friendly natural-language description is not a security review. Confirm what code runs and which credentials, files, and network destinations it can reach.
9. Protect the Host and Deployment Pipeline
The Gateway inherits the security of its operating system, container runtime, image source, SSH configuration, and deployment credentials.
- Patch the host and container runtime on a defined cadence.
- Use official OpenClaw images and avoid unofficial mirrors.
- Pin tested release tags or image digests for controlled production changes.
- Run the service as an unprivileged user where supported.
- Restrict access to environment files, volumes, sockets, and deployment keys.
- Remove unused packages, open ports, users, and scheduled tasks.
Follow the production deployment checklist to make these controls reproducible.
10. Run the Security Audit and Review the Result
OpenClaw provides openclaw security audit to identify risky configurations. The audit can review access, authentication, dangerous tools, file permissions, plugins, and cross-agent exposure as supported by the installed release.
openclaw security audit
- Run it before production launch.
- Run it after changes to networking, authentication, tools, channels, plugins, or agents.
- Prioritize public or unauthenticated access combined with powerful tools.
- Record accepted risks and why they are necessary.
- Do not treat a clean audit as proof against unknown vulnerabilities or unsafe workflows.
11. Make Backups Part of Security
Security includes availability and recovery. Ransomware, operator error, a failed update, disk corruption, or a compromised credential can all require a known-good restore.
- Create backups with OpenClaw’s native backup tooling.
- Verify archives and keep at least one protected copy outside the VPS.
- Restrict backup access because archives may contain credentials and private data.
- Test restore into a fresh directory.
- Document credential rotation after a suspected compromise.
See the OpenClaw backup and recovery guide for commands and recovery drills.
12. Repeat the Checklist After Every Boundary Change
Security drifts as integrations, channels, users, tools, and network paths accumulate. Repeat the relevant checks whenever the trust boundary changes, not only when OpenClaw itself is upgraded.
| Change | Security review to repeat |
|---|---|
| New channel or user | Pairing, allowlists, group policy, trust boundary |
| New API credential | Scopes, storage, limits, rotation, logs |
| New skill, plugin, or MCP server | Source, permissions, tools, dependencies, network |
| New public or remote route | Bind address, firewall, proxy trust, authentication |
| OpenClaw or host update | Release notes, audit, backup, rollback, acceptance test |
Should You Self-Host or Use Managed Hosting?
Self-host when you want full infrastructure control and can continuously own this checklist. If you prefer an isolated managed instance and do not want to maintain the underlying VPS, compare managed hosting with self-hosting or review OpenClaw managed hosting.
Managed infrastructure does not decide which tools or credentials are appropriate for your workflow. You still need least privilege, reviewed integrations, and human oversight for consequential actions.
Frequently Asked Questions
Is OpenClaw safe to expose directly to the internet?
Direct public exposure is not the preferred setup. Keep the Gateway loopback-only or private and use an authenticated SSH or Tailscale path. If you deliberately expose a route, follow the current hardening guidance and prevent bypass access.
Does sandboxing make an OpenClaw agent safe?
Sandboxing reduces tool access but is not a complete boundary. It does not replace Gateway authentication, host hardening, credential scoping, extension review, or separation between hostile users.
Can multiple unrelated users share one Gateway?
OpenClaw treats one Gateway as one trust boundary. For users who do not fully trust one another, run separate Gateways and credentials, preferably under separate OS users or on separate hosts.
How often should credentials be rotated?
Rotate after suspected exposure, personnel changes, scope changes, or provider guidance. For routine rotation, choose an interval your workflow can sustain and test the replacement process before an emergency.
Does a clean security audit guarantee the deployment is secure?
No. The audit checks known configuration risks supported by the installed version. It cannot prove that third-party code, workflow design, credentials, operators, or future vulnerabilities are safe.
Sources: OpenClaw Gateway security guidance, OpenClaw remote-access documentation, OpenClaw sandboxing documentation, OpenClaw security audit guidance, and OpenClaw security policy and deployment guidance.