OpenClaw is only as safe as the way you set it up. The real-world problems so far have come from four places: Gateways left open to the internet, malicious skills, a one-click bug that stole login tokens, and prompt injection hiding in emails and web pages.
You can shut down most of that in an afternoon. Update to the latest version, keep the Gateway on loopback with token auth, pair every sender, restrict the tools, vet every skill and run openclaw security audit.
Here’s what actually happened, and the exact settings that fix each one.
Why OpenClaw security is a bigger deal than most apps
OpenClaw is an open-source AI assistant you run on your own machine and talk to through chat apps. Depending on how you set up its tools, it can run commands on your computer and message people for you.
So anyone who gets control of it gets all of that too.
The project is upfront about its trust model. Each Gateway is one trust boundary, built for a single operator or a team that trusts each other. It isn’t meant to keep hostile users apart. If you need that, the answer is separate Gateways, ideally on separate OS users or machines.
Why does that matter to you? Because if you let other people message your bot, they’re inside your trust boundary.
I run Claude Code agents on a Mac Mini at home that works as an always-on worker, and I’ve run it in skip-permissions mode for speed.
What makes that OK for me is the boring stuff: backups before edits and scoped helper scripts, so a bad call can only reach so far.
OpenClaw needs the same thinking. It’s the same idea as Claude Code’s permission rules: decide up front what the agent can do on its own and what has to come to you first.
The real risks, with what actually happened
1. Gateways exposed to the internet
This is the big one. In February 2026, SecurityScorecard counted 40,214 exposed OpenClaw instances across 28,663 IP addresses, and said 12,812 of them were exploitable by remote code execution. Infosecurity Magazine put it down to widespread misconfiguration.
On a regular install today, the Gateway binds to loopback, which means only the machine itself can connect. The trouble starts when you change that so you can reach it from your phone or another computer, or when you run it in a container.
Container images default to an exposed bind.
2. Malicious skills on ClawHub
Skills are add-ons, and ClawHub is the public place to get them. In early February 2026, Koi Security audited 2,857 skills and found 341 malicious ones, according to The Hacker News. Most were one campaign, nicknamed ClawHavoc.
The trick was simple. A skill posing as something useful, like a crypto tracker or a YouTube tool, had a “Prerequisites” section telling Mac users to paste a script into Terminal. That script installed Atomic Stealer, a Mac infostealer that goes after your passwords and keys.
Some other skills hid backdoors in code that otherwise worked fine.
At the time, all you needed to publish on ClawHub was a GitHub account at least a week old.
OpenClaw responded by scanning every ClawHub upload with VirusTotal starting February 7, 2026. Malicious skills get blocked and suspicious ones get a warning label. But OpenClaw says itself that the scan is “not a silver bullet.”
Plain-English instructions that steer an agent somewhere bad won’t trip a virus scanner.
3. The one-click token theft bug (CVE-2026-25253)
This one’s sneaky.
The Control UI trusted a gatewayUrl value in the link and sent your Gateway token to whatever server it pointed at. Click a bad link and an attacker had operator access, which they could use to turn off approvals and run commands on your machine.
It worked even on loopback-only setups, because your own browser made the connection. It’s rated CVSS 8.8 and was fixed in version 2026.1.29, released January 30, 2026.
Lesson: loopback isn’t enough on its own. Stay updated.
4. Prompt injection
You don’t need strangers messaging your bot for this to bite. Any web page, email or attachment your agent reads can carry instructions aimed at it, and your agent can’t always tell your instructions from theirs. OpenClaw’s docs put it well: “The content itself is a threat surface, not just the sender.”
Model choice matters here. The docs cite a 2026 test of 272,000 attacks where Claude Opus 4.5 was fooled 0.5% of the time and Gemini 2.5 Pro 8.5% of the time. They also say small models plus web tools is a bad mix.
And no model is a complete fix, so don’t let a good model talk you out of restricting tools.
Risks and fixes at a glance
| Risk | What it looks like | Main fix |
|---|---|---|
| Exposed Gateway | Bound to 0.0.0.0, a LAN address or a forwarded port | gateway.bind: "loopback" plus token auth. Use Tailscale Serve for remote access |
| Malicious skill | A skill that asks you to paste a Terminal command, or hides code | Read skills first, run openclaw skills verify, never paste setup commands |
| Token theft | A crafted link to your Control UI | Version 2026.1.29 or later, and keep updating |
| Prompt injection | Instructions hidden in email or a web page | Strong model, restricted tools, a separate reader agent for untrusted content |
| Strangers messaging it | Open DMs or groups | dmPolicy: "pairing" or an allowlist, mention-only groups |
How to lock down OpenClaw, step by step
- Update OpenClaw and Node. The docs recommend Node 24.22.1+ or 26.12.1+ for security, and the audit checks your Node version.
- Keep the Gateway local. Set
gateway.bindto"loopback"andgateway.auth.modeto"token". Never expose it unauthenticated on0.0.0.0, and don’t put it on the public internet at all. - Lock down who can talk to it. Use
dmPolicy: "pairing"(the default on most channels) or an allowlist. Approve only yourself. Groups should be allowlisted and set to require a mention. - Isolate DMs. Set
session.dmScopeto"per-channel-peer"so each person gets their own session. - Restrict tools. Keep file access to the workspace with
tools.fs.workspaceOnly: true, and leavetools.elevatedoff unless you know why you need it. - Sandbox anything that touches untrusted input. Sandbox mode
"all"withworkspaceAccess: "none"or"ro"keeps a reader agent away from your real files. - Turn off LAN discovery you don’t need. Set
discovery.mdns.modeto"off"or"minimal". - Run the audit and fix what it finds.
Here’s what that looks like in ~/.openclaw/openclaw.json. It’s a trimmed version of the hardened baseline in the official docs, so check the current page before you copy it.
{
gateway: {
mode: "local",
bind: "loopback",
port: 18789,
auth: { mode: "token", token: "use-a-long-random-token" },
},
session: { dmScope: "per-channel-peer" },
tools: {
profile: "messaging",
fs: { workspaceOnly: true },
exec: { security: "deny", ask: "always" },
elevated: { enabled: false },
},
channels: {
whatsapp: { dmPolicy: "pairing" },
},
}
That’s a strict setup.
It turns off shell commands entirely, which is the right place to start, and you can open things up one tool at a time as you find you need them.
Run the OpenClaw security audit
openclaw security audit
openclaw security audit --deep
openclaw security audit --fix
The plain audit checks the settings that got people in trouble above, including tool and sandbox settings, network exposure and any flag starting with “dangerous.” --deep adds live Gateway checks.
Know what --fix won’t do. It tightens file permissions and switches open group policies to allowlists. It doesn’t rotate your keys, change your network settings or remove skills.
Those are still on you.
If the audit flags settings like allowUnsafeExternalContent on your Gmail hook or other mappings, turn them back off. The docs say those belong only in short, isolated debugging sessions.
How to vet a skill before you install it
Treat every third-party skill as code you’re about to run, because it is. Skills are folders with a SKILL.md file, so you can read the whole thing before it goes anywhere near your agent.
- Run
openclaw skills verify @owner/<slug>. It fails if ClawHub has marked the skill’s verification as failed. - Read
SKILL.mdand every script in the folder. If it asks you to paste a command into Terminal or download a “helper,” stop there. - Install into one workspace first, not with
--global, so other agents don’t pick it up. - Prefer known publishers, and be extra wary of anything crypto, wallet or “auto-updater” flavored. Those were favorite disguises in ClawHavoc.
- Lock down write access to your skill folders. OpenClaw reloads a skill when its
SKILL.mdchanges.
Plugins are an even bigger deal. They run inside the Gateway process, so the docs say to treat them as trusted code, use a plugins.allow allowlist and pin exact versions.
Put it on its own machine or account
Running OpenClaw on the same laptop you use for banking is asking for trouble. A dedicated machine, or at least a separate macOS user, limits what a bad skill or a hijacked agent can reach.
That’s why a lot of people use a Mac Mini. I walk through that whole setup in how to set up OpenClaw on a Mac Mini.
On a Mac, grant only the macOS permissions you’ll use. Don’t give Accessibility to node, since any script run through Node could inherit it. And use a separate phone number for WhatsApp or Signal so your personal messages never become agent input.
Whatever machine you pick, back it up before you let an agent loose, and keep an off-site copy too. A backup the agent can reach is a backup the agent can wipe, which is how one startup lost its database and its backups in April 2026.
If you think your OpenClaw was compromised
- Stop the Gateway. Quit the app if it runs the Gateway, or kill the
openclaw gatewayprocess. - Close the door. Set
gateway.bindback to"loopback", turn off Tailscale Funnel or Serve, and set risky DM policies to"disabled". - Rotate everything. That’s the Gateway token or password, remote client secrets, model API keys and every channel login (WhatsApp, Slack, Discord and the rest).
- Look at what happened. Run
openclaw logs, read the session transcripts under~/.openclaw/agents/, and check for recent changes to bind, auth, DM policies,tools.elevatedand plugins. - Run
openclaw security audit --deepand clear every critical finding before you turn it back on.
Did a skill have you paste a Terminal command? Then assume the whole Mac is compromised, not just OpenClaw, and change your passwords from a different device.
FAQ
Is OpenClaw safe to use?
It can be, if you keep it updated, local and locked down. The worst incidents so far came from exposed Gateways, old versions and skills people installed without reading. Bottom line: the defaults are decent, and most of the damage came from people loosening them.
Does VirusTotal scanning make ClawHub skills safe?
No. It catches known malware and some suspicious behavior. It won’t catch a skill that simply tells your agent to do something bad in plain English, and OpenClaw says a clean scan isn’t proof of safety.
Is binding to loopback enough?
It’s the most important setting, but no. CVE-2026-25253 worked on loopback-only installs because the victim’s browser made the connection. You still need updates, token auth and care with links.
Can I safely expose OpenClaw so I can reach it remotely?
Don’t open it to the internet. Use Tailscale Serve, which keeps the Gateway on loopback and lets Tailscale handle access. If you have to bind to your LAN, use auth and firewall the port to a tight list of IP addresses.
Want this done for you?
I run AI agents on my own Mac Mini, and I’m putting together a done-for-you setup for people who’d rather not spend a weekend on it. Join the waitlist and I’ll email you when spots open.
Running a business and want AI doing more of your marketing? See AI consulting.
