OpenClaw security is the set of principles, defaults, and configurations that protect your AI agent, your data, and the systems it connects to. It covers everything from how credentials are stored to how the agent handles untrusted input from group chats.
This article explains the security model from the ground up — what it protects, where the real risks are, and the concrete practices you should follow for a production deployment.
What Is OpenClaw Security?
OpenClaw security isn't a single feature — it's a layered approach built into the platform's architecture. The core philosophy:
- You own the data — conversations, memory, config, and files stay on your server
- You control the access — which channels, tools, and devices the agent can use
- You can audit everything — open source code, local logs, transparent behavior
- Minimal trust required — the only external dependency is your chosen LLM provider
This is fundamentally different from cloud AI services where your data lives on someone else's servers, processed by code you can't inspect, under policies you don't control.
The Four-Layer Security Model
OpenClaw's security is organized into four distinct layers. Understanding each helps you identify what you control and what risks you need to mitigate. For a comprehensive breakdown of each layer, see our complete security guide.
1. Infrastructure Layer
The server or container your agent runs on. If the server is compromised, everything on it is at risk. Responsibilities: OS updates, firewall rules, SSH hardening, user permissions.
2. Application Layer
The OpenClaw runtime. Handles credential storage, process isolation, tool sandboxing, and the separation between trusted system context and untrusted user messages. Single Node.js process with no public API endpoints.
3. Agent Layer
Your agent's behavior, defined by SOUL.md, skills, and config. Controls what the agent will and won't do — safety rules, action boundaries, and approval requirements for sensitive operations.
4. Communication Layer
All external connections — LLM providers, messaging platforms, paired devices, web services. Every connection uses TLS/HTTPS. No plaintext protocols for sensitive data.
How OpenClaw Handles Your Data
Stays on Your Server
MEMORY.md, daily notes, SOUL.md, workspace files, config, bot tokens, conversation history, skills, cron definitions.
Sent to LLM Provider
Current conversation context only. API terms state this data is not used for training. Use local models for zero external data flow.
Sent to Messaging Platform
The agent's replies go to Discord, Telegram, Slack, or whichever platform is connected. Same as any bot.
Never Collected by OpenClaw
No central server, no telemetry, no analytics, no data collection. Fully open source — verify yourself.
Threat Vectors to Be Aware Of
Server Compromise
Attacker gains access via SSH, unpatched vulnerability, or weak credentials. They can read config, tokens, and memory. Fix: SSH keys, firewall, fail2ban, automatic updates.
Credential Exposure
Bot tokens or API keys accidentally committed to git, shared in chat, or stored in world-readable files. Fix: environment variables, chmod 600, .gitignore, regular rotation.
Prompt Injection
A user in a group chat tries to override the agent's instructions. Fix: trusted/untrusted context separation, SOUL.md boundaries, approval requirements for sensitive actions.
Device Pairing Abuse
An unauthorized device pairs with the gateway. Fix: autoApprove: false (default), manual approval, immediate unpairing of lost devices.
Best Practices for Every Deployment
Before Deployment
- Harden the server (firewall, SSH keys, non-root user, automatic updates)
- Set config file permissions to 600
- Use environment variables for all secrets
- Write clear SOUL.md safety rules
- Disable tools and channels the agent doesn't need
During Operation
- Monitor agent logs for unexpected behavior
- Review memory files periodically
- Keep OpenClaw and OS updated
- Set spending limits on LLM API keys
- Use mention-only mode in group channels
Ongoing Maintenance
- Rotate bot tokens and API keys every 90 days
- Review connected devices and unpair unused ones
- Audit channel permissions quarterly
- Back up workspace and config regularly
Self-Hosting vs Managed Hosting
Self-Hosted
Pros: Maximum control, data never leaves your server, choose your own LLM.
Cons: You handle security, updates, backups, TLS. Requires sysadmin skills.
Managed (Ampere.sh)
Pros: Isolated containers, AES-256 encryption, auto TLS, managed updates, DDoS protection.
Cons: Data on Ampere infrastructure. Trade some control for reliability.
For most users, managed hosting is more secure in practice — because server hardening and monitoring are handled by a dedicated team.
SOUL.md as a Security Control
SOUL.md isn't just personality — it's a security layer. Clear boundaries make prompt injection harder and limit agent behavior even under adversarial input.
# SOUL.md security rules example
## Red Lines
- Never share API keys, tokens, or passwords
- Never send emails without explicit approval
- Use trash instead of rm (recoverable)
- Ask before any destructive action
- Don't exfiltrate private data. Ever.
## External Actions
- Always ask before sending messages externally
- Never post to social media without confirmationFrequently Asked Questions
What does OpenClaw security actually protect?
Is OpenClaw secure by default?
Do I need security expertise to run OpenClaw safely?
Can OpenClaw agents access each other's data?
What data does OpenClaw send to third parties?
How do I know if my OpenClaw agent has been compromised?
OpenClaw Security Is Control
OpenClaw security isn't about locks and firewalls alone — it's about giving you full control over your AI agent's behavior, data, and access.
You decide what the agent can do. You decide where data is stored. You decide who interacts with it. And because it's open source, you can verify every claim by reading the code.
Follow the best practices in this guide, keep software updated, and your OpenClaw deployment will be more secure than most cloud AI services.
Deploy securely on Ampere
Isolated containers, encrypted secrets, automatic TLS. Focus on building — we handle the infrastructure.
Get Started with Ampere →