Gateway Security
title: Gateway Security description: Security considerations, audit tools, and best practices for running an AI gateway. sidebar: label: Security order: 3
Section titled “title: Gateway Security description: Security considerations, audit tools, and best practices for running an AI gateway. sidebar: label: Security order: 3”Security 🔒
Section titled “Security 🔒”Running an AI agent with shell access and network capabilities is powerful but requires vigilance. OpenClaw provides built-in tools to help you secure your instance.
Security Audit
Section titled “Security Audit”The fastest way to check your security posture is the built-in audit tool.
Run Basic Audit Checks for common misconfigurations (open ports, weak policies).
Terminal window openclaw security auditDeep Scan Probes the live gateway to verify reachability and auth.
Terminal window openclaw security audit --deepAuto-Fix Applies recommended guardrails automatically.
Terminal window openclaw security audit --fixThis will:
- Restrict
groupPolicytoallowlist. - Redact sensitive logs.
- Tighten file permissions (
chmod 700on~/.openclaw).
- Restrict
Threat Model & Philosophy
Section titled “Threat Model & Philosophy”OpenClaw is designed with a “Defense in Depth” approach:
- Identity: Every connection is authenticated (Device Auth or Token).
- Policy: You explicitly define who can talk to the bot (
dmPolicy,allowFrom). - Capabilities: You explicitly define what the bot can do (Tools, Sandbox).
Credential Storage
Section titled “Credential Storage”Sensitive data is stored in ~/.openclaw/:
| Credential Type | Path |
|---|---|
| WhatsApp Sessions | ~/.openclaw/credentials/whatsapp/ |
| Pairing Allowlists | ~/.openclaw/credentials/*-allowFrom.json |
| Model Auth | ~/.openclaw/agents/*/agent/auth-profiles.json |
Ensure these files are readable only by the user running the Gateway.
Reverse Proxy Configuration
Section titled “Reverse Proxy Configuration”If running behind Nginx, Caddy, or Traefik:
- Configure Trusted Proxies: Tell OpenClaw to trust headers from your proxy.
- Pass Real IP: Ensure your proxy sends
X-Forwarded-For.
gateway: trustedProxies: - "127.0.0.1" # If proxy is local auth: mode: password password: ${OPENCLAW_GATEWAY_PASSWORD}