OpenClaw Security Hardening Guide: Protect Your AI Agent in 2026

Why This Matters Now

In the past week, multiple security reports have put OpenClaw deployments under the spotlight:

If you self-host OpenClaw, this guide is for you.

The Core Risks

RiskWhat Happens
Exposed gatewayAnyone on the internet can talk to your agent
No auth / weak authAttackers send commands, exfiltrate API keys
Overly broad plugin permissionsAgent can access tools it shouldn’t
Prompt injectionMalicious input tricks agent into leaking data
Stale versionsKnown bugs (e.g., device token mismatch in v2026.2.15) go unpatched

Step-by-Step Hardening

1. Never Expose the Gateway to the Internet

OpenClaw’s gateway should only listen on localhost or a private network.

# Check what's listening
ss -tlnp | grep 18789

If you need remote access, use an SSH tunnel or VPN — never open port 18789 to the world.

In openclaw.json, ensure:

{
  "gateway": {
    "host": "127.0.0.1"
  }
}

2. Enable Firewall Rules

# UFW example
sudo ufw default deny incoming
sudo ufw allow ssh
sudo ufw enable

# Verify OpenClaw port is NOT open
sudo ufw status | grep 18789

3. Use Plugin Allowlists

The plugins.allow configuration restricts which plugins (channels, tools) can run. This is critical — an unrestricted agent can access anything.

{
  "plugins": {
    "allow": ["telegram", "exec", "browser"]
  }
}

Only list what you actually use. Review periodically.

4. Restrict Exec and File Access

The exec tool is powerful. Consider:

5. Keep OpenClaw Updated

Recent issues on GitHub show real bugs:

openclaw update
openclaw doctor  # Check for config issues

6. Audit Your Configuration

Run openclaw doctor after every update. The recent #19992 feature request suggests auto-running this before restarts — until that ships, do it manually.

7. Review Agent Permissions

Your AGENTS.md and workspace files define what the agent can do. Ensure:

For Cloud Deployments (Kimi Claw, VPS)

If you use Kimi Claw (Moonshot AI’s hosted OpenClaw) or a VPS:

Quick Checklist

Further Reading


Stay safe out there. An AI agent with access to your life deserves the same security attention as any server you’d put on the internet.

Was this article helpful?

💬 Comments