中文版 | English
OpenClaw is a powerful AI assistant that can run on your own hardware. First released in November 2025, it has released dozens of versions as of March 2026. While powerful, it also comes with significant security risks. According to ZoomEye mapping data, as of March 4, 2026, there are 63,026 identifiable OpenClaw instances worldwide, and the GitHub Advisory Database has recorded as many as 245 related vulnerabilities, highlighting the coexistence of rapid growth and security challenges. For some research findings on its security, click here to view.
This project is an internal team summary of OpenClaw's full-lifecycle security practice guide, covering installation, configuration, daily use, and maintenance, helping you maintain security while enjoying OpenClaw's powerful capabilities.
The audit script supports Linux, macOS, and Windows.
Run the automated audit script to quickly check the security status of your OpenClaw environment:
git clone https://github.com/knownsec/openclaw-security.git
cd openclaw-security
python3 tools/openclaw_security_audit.py
# View the audit report
cat /tmp/openclaw-security-reports/report-$(date +%Y-%m-%d).txtCopy the contents of OpenClaw-Security-Practices-Guide.md into the OpenClaw dialog so the AI assistant is aware of security practices and follows security best practices in future interactions.
Read through this README to master OpenClaw security practices across the entire lifecycle, including installation, configuration, daily use, incident response, and more.
-
Download OpenClaw from a trusted source, official website: https://openclaw.ai. Some unofficial "quick deployment" or "one-click installation" scripts online may contain modified versions or backdoors.
-
Prioritize isolated environments. Do not use your primary computer system or sensitive machines. Recommended priority: Independent VPS > Local virtual machine (VMware, VirtualBox, etc.) > Local Docker.
-
Follow the principle of least privilege. Do not run or install OpenClaw using a root account or an account with administrator privileges. Incorrect example:
# Linux/macOS
curl -fsSL https://openclaw.ai/install.sh | sudo bash # Using sudo for convenienceWindows users:
Right-click "Command Prompt" and select "Run as administrator"
After installation, it is strongly recommended to copy the contents of OpenClaw-Security-Practices-Guide.md into the OpenClaw dialog.
- Upgrade to the latest version regularly, do not use outdated versions:
openclaw update- Before any operation that may cause abnormal configuration, back up the critical OpenClaw data directory in advance:
# Linux/macOS
cp -a ~/.openclaw ~/openclaw_bakWindows users:
Copy folder %USERPROFILE%\.openclaw to another location
The OpenClaw configuration file is located at ~/.openclaw/openclaw.json (Linux/macOS) or %USERPROFILE%\.openclaw\openclaw.json (Windows).
- Minimize exposure, run in local mode, do not expose port 18789 to the external network:
openclaw config set gateway.mode localTo prevent accidental operations, it is recommended to configure the system firewall to deny access to port 18789.
# Linux - Ubuntu ufw
sudo ufw enable
sudo ufw deny 18789/tcp# macOS - System Preferences > Security & Privacy > Firewall
Windows users:
Control Panel > Windows Defender Firewall > Advanced Settings > Inbound Rules > New Rule
- If providing access in an intranet environment, enable authentication and configure:
openclaw config set gateway.auth.mode token
openclaw config set gateway.auth.token <custom TOKEN>- Regularly run OpenClaw security verification commands to check security configuration:
openclaw security audit --deep- SKILL Review You must review SKILLs before installation, focusing on whether the SKILL exhibits the following behaviors:
- Arbitrary shell command execution
- File system writes (outside specified directories)
- Network requests to unknown domains
- Accessing environment variables/credentials
- Base64 encoded code
- Dynamic code execution (
eval,exec)
Some common review points:
# Linux/macOS
grep -r "exec\|spawn\|child_process\|os.system\|subprocess" .
grep -r "fs.write\|fs.unlink\|rm \|chmod \|chown " .
grep -r "fetch\|axios\|requests\|http" .
grep -r "process.env\|\.env\|SECRET\|KEY\|TOKEN" .Windows users:
Open search in SKILL directory, search for keywords: exec, spawn, SECRET, KEY, TOKEN, etc.
-
Sensitive operations, such as transactions and account logins, always require manual review.
-
Only enable necessary tools and disable unused ones promptly.
OpenClaw is very powerful but also brings many security risks. During daily use, you should regularly perform system checks.
- Check if the Gateway port is bound to 0.0.0.0:
# Linux/macOS
ss -lntp | fgrep 18789Windows users:
Open Command Prompt, type: netstat -ano | findstr 18789
-
For instances allowing remote access, directly visit http://:18789 to verify whether anonymous access is allowed.
-
Check if the service is running with root identity:
# Linux/macOS
ps aux | grep openclaw | grep -v rootWindows users:
Task Manager > Details > Find openclaw process, check "User name"
- Check if firewall access policies are configured:
# Linux - ufw
sudo ufw status | grep 18789Windows users:
Control Panel > Windows Defender Firewall > Advanced Settings > Inbound Rules > Find 18789
When system abnormalities are detected, such as lag, excessive traffic, or high CPU and memory usage:
- Immediately stop the OpenClaw service
# Linux/macOS
killall openclaw-gatewayWindows users:
Task Manager > Find openclaw process > End task
-
Revoke all credentials
-
Check system logs:
# Linux/macOS
grep -E "auth_failed|unauthorized|error" /var/log/openclaw/*.logWindows users:
Event Viewer > Windows Logs > Application/Security
- Check system login accounts:
# Linux/macOS
wWindows users:
Task Manager > Users tab
- Check system processes:
# Linux/macOS
topWindows users:
Task Manager
- Regularly back up OpenClaw configuration and workspace:
# Linux/macOS
cp -r ~/.openclaw ~/openclaw-backup-$(date +%Y%m%d)Windows users:
Copy folder %USERPROFILE%\.openclaw
- Back up the list of installed SKILLs:
openclaw skill list > ~/skill-list-backup.txt- Recommend using Git to manage important workspaces for quick rollback in case of anomalies.
This project provides automated audit scripts that can execute most of the above checks with one command:
# Basic audit
python3 tools/openclaw_security_audit.py
ls /tmp/openclaw-security-reports/Audit content includes:
- Environment isolation detection
- Port exposure check (18789)
- Permission compliance check
- SKILL source verification
- Sensitive information scanning (private keys, mnemonics, etc.)
- File integrity verification
- Process and network listening analysis
- System log audit
It is recommended to add this script to your daily inspection routine and run audits regularly to continuously maintain OpenClaw security.
Here are some additional references for more advanced users: