Self-hosted · Your data stays yours

Security Built Into Every Layer

OpenClaw is designed for privacy-conscious users who want AI assistance without sacrificing control. Sandboxed execution, encrypted communication, and local-first architecture.

🔒
0
Exposed Ports
🛡️
4
Security Layers
🏠
100%
Local Storage
E2E
Encrypted

Sandboxed Command Execution

OpenClaw doesn't just blindly execute whatever the AI suggests. Multiple layers of protection ensure commands are validated, restricted, and reversible.

1

Tool Policies

Whitelist which tools and operations OpenClaw can use. Block dangerous commands entirely.

2

Working Directory Restrictions

File operations are confined to designated directories. No access to system files or other users' data.

3

Human-in-the-Loop Approval

High-risk actions require explicit confirmation. You see exactly what will happen before it runs.

4

Optional Docker Isolation

Run commands in disposable containers for complete isolation from your host system.

Tool Policy Configuration

You control exactly what OpenClaw can do. The tool policy system lets you whitelist specific capabilities:

# Example tool policy (tools.yaml) exec: allow: ["git", "npm", "python3"] deny: ["rm -rf", "sudo", "curl | bash"] require_approval: ["delete", "send_email"] files: allowed_paths: ["/home/user/projects", "/tmp"] denied_paths: ["/etc", "/var", "~/.ssh"]

Commands not on your allow list simply don't execute. OpenClaw will acknowledge the limitation and suggest alternatives that fit within your policy.

Smart defaults: Out of the box, OpenClaw blocks destructive system commands, limits file access to your workspace, and requires approval for anything that sends data externally.

File Access Controls

OpenClaw's file operations respect boundaries you set:

Even if an AI model hallucinates a command that tries to access restricted areas, the execution layer will block it and log the attempt.

Access Controls & Trust Levels

Not everyone needs full access. OpenClaw's permission system lets you grant different capabilities to different users.

👑

Owner (Full Access)

Complete control over OpenClaw. Can modify settings, access all tools, and manage other users.

Trusted User

Can use most features but can't change system settings or access sensitive configurations.

👤

Limited User

Basic chat and query access. No file operations, no command execution, no external integrations.

🚫

Blocked

Explicitly denied access. Messages are ignored and logged for security review.

User ID Whitelisting

The first line of defense: only users on your whitelist can interact with OpenClaw at all. This is mandatory—there's no "open to everyone" mode.

# users.yaml - Define who can access your bot owner: telegram_id: "123456789" trust_level: "owner" users: - telegram_id: "987654321" name: "Partner" trust_level: "trusted" tools: ["calendar", "reminders", "search"] - telegram_id: "111222333" name: "Assistant" trust_level: "limited"

Each user gets their own conversation context, so multiple users on the same bot won't see each other's messages or history.

Family-friendly: Set up a shared OpenClaw where each family member has their own access level. Kids get limited features, adults get trusted access, you keep owner control.

Per-User Tool Restrictions

Beyond trust levels, you can specify exactly which tools each user can access:

Zero Exposed Ports

OpenClaw communicates through outbound connections only. There are no listening ports for attackers to target.

How It Works

Traditional web services expose ports (80, 443, etc.) to receive incoming connections. This creates attack surface. OpenClaw flips this model:

Result: Your server can have a firewall that blocks ALL incoming connections, and OpenClaw still works perfectly.

Tailscale Integration

For users who want to access OpenClaw's web interface or connect from multiple locations, Tailscale creates a private network that's invisible to the internet:

🔐

WireGuard Encryption

All traffic encrypted with modern WireGuard protocol. No VPN configuration needed.

👻

Zero Public IP

Your OpenClaw server doesn't need a public IP. Access it via Tailscale's private network only.

📱

Device Authentication

Only devices you've approved can join your network. Add phones, laptops, other servers.

🌍

Access From Anywhere

Connect securely from coffee shops, airports, anywhere—without exposing your server.

# Install Tailscale on your OpenClaw server curl -fsSL https://tailscale.com/install.sh | sh tailscale up # Now access OpenClaw via its Tailscale IP (e.g., 100.x.x.x) # Only your authorized devices can reach it

Firewall Configuration

With OpenClaw's outbound-only architecture, you can lock down your server completely:

# Example UFW configuration sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow from 100.64.0.0/10 # Tailscale network only sudo ufw enable # Result: Zero attack surface from the public internet

Local-First, No Cloud Dependencies

Your conversations, files, and memories stay on your server. OpenClaw doesn't phone home, doesn't sync to cloud storage, and doesn't share your data.

What Stays Local

What Goes to AI Providers

When you send a message, OpenClaw sends it to the AI provider (like Anthropic) to generate a response. Here's exactly what's transmitted:

Important: According to Anthropic's API terms, they don't use API data for training and don't store it beyond the request lifecycle. However, prompts may be logged briefly for abuse detection. For maximum privacy, you can use local models.

Local Model Option

For users who want zero external data transmission, OpenClaw supports local models via Ollama:

# Run Llama locally (requires decent GPU) ollama pull llama3.3 openclaw config --model ollama/llama3.3 # Now all AI processing happens on your machine # Trade-off: Less capable than Claude, but 100% private

Local models are great for sensitive tasks where you absolutely can't have data leaving your network—even briefly.

Data Retention Controls

You control how long data persists:

Token Authentication & Rate Limiting

Every integration point is secured with proper authentication, rotation capabilities, and abuse prevention.

API Token Management

OpenClaw handles multiple API tokens securely:

🔑

Encrypted Storage

API keys stored encrypted at rest using your system's keychain or encrypted config files.

🔄

Easy Rotation

Rotate keys without downtime. Perfect for responding to security incidents.

📋

Minimal Permissions

Request only the OAuth scopes actually needed. No excessive permissions.

Expiry Warnings

Get notified before tokens expire so you can refresh them proactively.

Rate Limiting

Built-in protections prevent runaway costs and abuse:

# Rate limit configuration rate_limits: anthropic: daily_budget: "$5.00" monthly_cap: "$50.00" per_user_daily: "$2.00" alert_at: "80%"

Tool Policy Enforcement

Beyond rate limits, tool policies provide fine-grained control over what actions OpenClaw can take:

Best Practices for Your Installation

Follow these recommendations to maximize the security of your OpenClaw setup.

Server Hardening

# Quick server hardening commands # Create dedicated user sudo adduser openclaw sudo usermod -aG sudo openclaw # Install and enable fail2ban sudo apt install fail2ban sudo systemctl enable fail2ban # Configure firewall sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow ssh # Or your custom SSH port sudo ufw enable # Enable automatic security updates sudo apt install unattended-upgrades sudo dpkg-reconfigure unattended-upgrades

OpenClaw Configuration

Ongoing Security

Self-Hosted vs Cloud AI Services

Why privacy-conscious users choose OpenClaw over ChatGPT, Copilot, and other cloud AI services.

Feature OpenClaw (Self-Hosted) Cloud AI (ChatGPT, etc.)
Data storage location Your server only Corporate servers
Conversation privacy 100% private May be reviewed for safety
Training on your data Never (API terms) Often (unless you opt out)
Data breach exposure Isolated to your server Millions of users affected
Audit logging Complete control Limited visibility
Data retention You decide Provider policy
Access controls Full customization Basic team features
Compliance (GDPR, etc.) Full control Depends on provider
Network requirements Works behind firewall Requires internet access
Local-only option Yes (Ollama) No

The Core Difference

When you use ChatGPT, your data travels through OpenAI's infrastructure, gets processed on their servers, and may be stored in their logs. A breach of their systems could expose millions of users' conversations—including yours.

With OpenClaw, your server is a standalone fortress. Even if Anthropic were breached, attackers wouldn't find your conversation history—because it was never sent there for storage. They'd only see API calls, not your data.

Compliance advantage: For businesses handling sensitive data (healthcare, finance, legal), self-hosted solutions dramatically simplify compliance. You control the data, you control the audit trail, you control retention.

When Cloud AI Makes Sense

To be fair, cloud AI services have their place:

But the moment you're asking AI about your emails, your calendar, your business plans, or your personal life—self-hosted is the answer.

Security FAQ

Is OpenClaw secure for handling sensitive data?

Yes. OpenClaw runs entirely on your own server with sandboxed command execution, user trust levels, and encrypted communication. Your data never touches shared cloud infrastructure.

The only external calls are to the AI API (like Claude), which doesn't store your data according to their API terms. For maximum privacy, you can use local models that never send data off your machine.

How does OpenClaw sandbox command execution?

OpenClaw uses multiple layers of sandboxing:

Tool policies whitelist allowed operations
Working directory restrictions prevent access outside designated folders
Human-in-the-loop approval for high-risk commands
Optional Docker containerization for complete isolation

Even if the AI suggests a dangerous command, it won't execute unless it passes all these checks.

Can hackers access my OpenClaw?

OpenClaw exposes no ports to the public internet by default. It communicates through Telegram/WhatsApp APIs using outbound connections only—there's nothing for attackers to connect to.

With Tailscale integration, you can create a completely private network that's invisible to the internet. User ID whitelisting ensures only authorized users can interact with your bot even through Telegram.

What data does OpenClaw send to AI providers?

Only the content needed to generate responses: your message and relevant context. Anthropic's API terms state they don't train on API data or store it beyond the request lifecycle.

For complete privacy, you can use local models like Llama via Ollama. They're less capable than Claude but keep everything on your machine.

Is self-hosted AI more secure than ChatGPT?

For sensitive use cases, yes. With cloud AI services, your data travels through corporate servers, may be logged, could be used for training, and a breach could expose millions of users' data—including yours.

With OpenClaw, your conversations stay on your server, you control data retention, and there's no shared infrastructure where breaches could expose your information. Your risk is isolated to your own security practices.

How do I secure my OpenClaw installation?

Key steps:

• Use SSH keys instead of passwords
• Enable fail2ban for brute-force protection
• Configure UFW firewall rules
• Set up Tailscale for private networking
• Use strong API tokens
• Enable user ID whitelisting
• Regularly update OpenClaw and your server OS
• Review tool policies to restrict capabilities

Full security hardening guide →

What happens if my API key is leaked?

If an API key is compromised:

1. Immediately revoke it in your provider's console (Anthropic, OpenAI, etc.)
2. Generate a new key
3. Update OpenClaw: openclaw config --api-key NEW_KEY
4. Review your logs for any unauthorized usage

With spending limits configured, damage from a leaked key is contained. This is why we recommend setting daily/monthly caps.

Security Resources

Ready to take control of your AI?

Set up OpenClaw in 30 minutes with security built in from the start.

Start Secure Setup