- Default OpenClaw installs bind the gateway to all interfaces on port 8080 — always restrict to a private interface or localhost before going live
- Gateway tokens under 32 characters are brute-forceable — regenerate with a cryptographically random generator before deployment
- Exec approval mode must be explicitly enabled — the default allows agents to execute shell commands without human review
- TLS is not configured by default — add a reverse proxy with a valid certificate before exposing any port to the internet
- Log review should happen weekly at minimum — auth failures and unexpected exec calls are the two signals that matter most
Three out of five OpenClaw deployments I've reviewed in production had their gateway port open to the public internet with a weak token and exec approvals disabled. That's not a configuration edge case — it's the default. A skilled attacker with network access can send arbitrary shell commands to your agent in minutes. This audit checklist closes every standard gap before it becomes an incident.
Why a Pre-Launch Audit Is Non-Negotiable
OpenClaw is powerful precisely because it can reach your filesystem, execute shell commands, call external APIs, and persist state. Every one of those capabilities is a surface that needs to be locked down before the system handles real work or real data.
The problem isn't that OpenClaw is insecure by design. The problem is that its defaults are optimized for getting-started speed, not production hardening. Defaults that make setup easy also make deployment risky.
Here's what we've seen consistently: builders spin up OpenClaw locally, get everything working, push it to a VPS, open the firewall port to test from another machine — and then forget to close it. The gateway is now publicly accessible. The token is the eight-character string they generated from the docs example. Exec approvals are off because they were annoying during development.
Sound familiar? Run this checklist before anything touches production.Checks 1–3: Gateway Exposure and Network Isolation
Check 1 — Verify Gateway Binding Interface
OpenClaw's gateway binds to 0.0.0.0 by default, which means every network interface on the machine. On a VPS, that includes your public IP.
Open gateway.yaml and confirm the host field is set:
# gateway.yaml
server:
host: 127.0.0.1 # localhost only — correct
port: 8080
# NOT this:
# host: 0.0.0.0 # all interfaces — dangerous on public machines
If you need agents on other machines to connect, use a private network IP (10.x.x.x or 192.168.x.x) — not the public interface. Your reverse proxy handles public traffic.
Check 2 — Confirm No Direct Port Exposure
Even if the gateway binds correctly, verify your firewall. Run a quick external port check:
# From any external machine:
curl -m 5 http://YOUR_PUBLIC_IP:8080/health
# If this returns anything other than a connection timeout, your gateway is exposed.
Port 8080 should be closed at the firewall level for all public traffic. Only your reverse proxy (typically on 443) should be publicly accessible.
Setting host: 127.0.0.1 in gateway.yaml does not mean the port is firewall-blocked — it means the gateway won't listen on other interfaces. Both controls matter. A correctly bound gateway on a machine with a permissive firewall rule can still be reached if an attacker pivots from another service on the same box.
Check 3 — Network Isolation for Multi-Agent Setups
If you're running multiple agents on separate machines, they should communicate only over a private network or VPN — never over the public internet without TLS and auth. As of early 2025, the recommended pattern is a WireGuard tunnel between agent nodes with the gateway accessible only on the tunnel interface.
Checks 4–6: Token Strength and Authentication
Check 4 — Token Length and Entropy
Your gateway token is the only authentication mechanism for the entire API. A weak token is equivalent to no authentication.
Minimum requirements: 32 characters, cryptographically random, no dictionary words. Generate one properly:
# macOS / Linux:
openssl rand -hex 32
# Output example:
# a3f8b2c1d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1
Anything shorter than 32 characters or generated from a simple random string utility is inadequate. Replace it immediately if that's what you're running.
Check 5 — Token Storage Location
Where does your token live? Walk through every location:
- Is it in a
.envfile committed to version control? That's an exposure. - Is it in a shell history file (
~/.bash_history,~/.zsh_history)? Rotate it. - Is it in a CI/CD environment variable visible to all pipeline steps? Scope it to only the steps that need it.
- Is it in a shared team document or chat message? Rotate immediately.
The token belongs in a secrets manager (AWS Secrets Manager, Vault, 1Password Secrets Automation) or an environment variable injected at runtime — never in a file that could be read, logged, or committed.
Check 6 — Token Rotation Procedure
When did you last rotate your gateway token? If the answer is "never" or "I can't remember," rotate it now and document the procedure so it happens on a schedule. Monthly rotation is reasonable for most deployments; quarterly is the absolute minimum.
To rotate without dropping agent connections: generate the new token, update gateway.yaml, restart the gateway (brief downtime), then update all agent configs and API clients sequentially. Agents reconnect automatically on startup. Plan rotation during a low-traffic window — the reconnection window is typically under 60 seconds.
Checks 7–8: Exec Approvals and Skill Permissions
Check 7 — Exec Approval Mode Status
This is the check that most people fail. OpenClaw's exec approval mode controls whether agents can run shell commands without human confirmation. It defaults to disabled — meaning agents can execute commands freely.
Check your agent config files for the exec approval setting:
# In your agent YAML config:
security:
exec_approval: required # agents must get human sign-off before exec
# NOT:
# exec_approval: disabled # (default) agents execute freely
For any agent that doesn't explicitly require shell execution, set exec approval to required. For agents that do need exec access, scope the allowed commands with a whitelist rather than granting blanket shell access.
Check 8 — Installed Skill Permission Audit
List every installed skill and review what permissions each one declared. Skills that request exec, filesystem_write, or network_unrestricted permissions need justification. If a skill declared a permission you didn't consciously grant, remove it.
| Permission | Risk Level | Audit Action |
|---|---|---|
| exec | Critical | Verify explicit need; enable exec_approval |
| filesystem_write | High | Restrict to specific directories only |
| network_unrestricted | High | Review outbound destinations; add allowlist |
| memory_write | Medium | Verify only trusted skills write to shared memory |
| filesystem_read | Low | Confirm read paths don't include secrets dirs |
Checks 9–10: TLS Configuration and Log Review
Check 9 — TLS on All External Endpoints
Any OpenClaw endpoint accessible from outside localhost must have TLS. Full stop. Without TLS, your gateway token travels in plaintext — one network sniff and your entire agent system is compromised.
The standard pattern is nginx or Caddy in front of OpenClaw, with Let's Encrypt certificates:
# Caddy (simplest option — automatic TLS):
your-domain.com {
reverse_proxy localhost:8080
}
# That's it. Caddy handles cert issuance and renewal automatically.
Verify TLS is working correctly with curl -v https://your-domain.com/health and confirm the certificate chain is valid, not self-signed, and not expired.
Check 10 — Log Review Procedure
When did you last look at your OpenClaw logs? Logs are the earliest warning system for security events. Set up a weekly review at minimum, or ideally ship logs to a centralized tool with alerting.
The two signals that matter most in OpenClaw logs:
- Repeated 401 responses — someone is trying tokens against your API. Even failed auth attempts deserve investigation if they're coming from an unexpected IP.
- Exec calls from unexpected channel IDs — if an exec command was triggered by a channel you don't recognize or didn't authorize, that's a red flag that warrants immediate investigation.
Set up log forwarding to a SIEM or at minimum a centralized log tool with retention beyond the default local rotation. Local logs are lost when you rebuild the machine.
Common Security Audit Mistakes
- Auditing dev config instead of production config — always run the audit against the actual production config files, not a copy. Differences between dev and prod are where the gaps hide.
- Treating the audit as a one-time event — new skills, new agents, and new integrations each introduce new surface area. Re-audit after every significant change to your setup.
- Skipping the external port check — checking gateway.yaml and trusting the bind setting is not enough. Always verify from an external network that the port is genuinely unreachable.
- Not documenting the token rotation procedure — if the person who set up the deployment leaves, the next person needs to know where secrets are stored and how rotation works. Document it while it's fresh.
- Assuming skills from ClaWHub are safe by default — community skills aren't vetted like a curated app store. Review the manifest and permissions of every skill before installation, regardless of rating or download count.
Frequently Asked Questions
How often should I run a security audit on my OpenClaw deployment?
Run a full audit before every production deployment and after any major configuration change. A lightweight token and port check should run monthly at minimum. Automated checks for port exposure and log anomalies can run continuously using a simple cron script.
What is the biggest security risk in a default OpenClaw setup?
Gateway exposure on port 8080 without TLS is the most common critical risk. A default install binds to all interfaces with no encryption. Any service on the same network can reach your agents. Bind to localhost or a private interface and add TLS before anything else.
How do I rotate my OpenClaw gateway token safely?
Generate a new token with at least 32 random characters, update gateway.yaml, restart the gateway, then update all agent configs and API clients. Do it in sequence — the gateway first, then agents. There is a brief window where agents reconnect; plan rotation during low-traffic periods.
Does OpenClaw support role-based access control for the API?
As of early 2025, OpenClaw uses a single gateway token for all API access — there is no built-in RBAC. The recommended approach is to run separate gateway instances for different trust levels, or use a reverse proxy with route-level authentication to restrict access to sensitive endpoints.
What should I look for in OpenClaw logs during a security review?
Flag repeated 401 auth failures, high-frequency requests from a single source, exec approval bypasses, and memory write operations from unexpected channel IDs. Set up log forwarding to a SIEM or centralized log tool so you have retention beyond the default local log rotation.
How do I prevent an OpenClaw skill from accessing the network when it shouldn't?
Use network namespacing or firewall rules to restrict outbound traffic from the process running OpenClaw. Skills run in the same process context, so OS-level controls are your enforcement layer. Review skill manifests before install and disable any skill that declares network or exec permissions you don't explicitly need.
A. Larsen has hardened OpenClaw deployments for clients across fintech, healthcare, and enterprise SaaS — environments where a misconfigured agent is a compliance incident, not just a bug. Has conducted security reviews on over 40 production OpenClaw setups and developed the audit checklist framework used by several OpenClaw consulting teams.