- Home (README)
- Plain English
- Technical
- Privacy + safety
- Deployment
- Optimizations
- Reference
Purpose: This is a reference configuration for a hardened, high-privacy OpenClaw deployment. Save this as
~/.openclaw/openclaw.jsonafter reviewing and customizing for your environment.
This config assumes:
- Gateway bound to loopback only
- Access via SSH tunnel or Tailscale
- Your chosen model provider configured via
openclaw onboard - Minimal tool surface
- Pairing required for DM access
Note: Configure your model provider credentials using
openclaw onboard --install-daemon. The onboarding wizard handles API key storage securely. Do not put API keys directly in this config file.
Every option below has been verified against OpenClaw's config type definitions in src/config/types.*.ts.
{
"$schema": "https://openclaw.ai/schemas/2024-11/config.json",
"version": 1,
// --- Gateway Security ---
"gateway": {
"bind": "loopback", // Listen on 127.0.0.1 only
"port": 18789, // Default port
"auth": {
"mode": "token",
"token": "GENERATE_WITH_OPENSSL_COMMAND_BELOW"
},
"trustedProxies": [], // Empty = no reverse proxy
"controlUi": {
"dangerouslyDisableDeviceAuth": false // Keep device auth enabled
}
},
// --- Channel Configuration ---
// Configure per-channel via openclaw onboard or openclaw config set
// Examples shown as comments:
// Telegram - pairing mode (recommended)
// "channels": [{
// "type": "telegram",
// "enabled": true,
// "dmPolicy": "pairing",
// "groupPolicy": {
// "requireMention": true,
// "allowedGroups": ["your-approved-group-id"]
// },
// "configWrites": false
// }]
// WhatsApp - pairing mode
// "channels": [{
// "type": "whatsapp",
// "enabled": true,
// "dmPolicy": "pairing"
// }]
// Discord - allowlist mode
// "channels": [{
// "type": "discord",
// "enabled": true,
// "dmPolicy": "allowlist",
// "allowFrom": ["your-user-id"],
// "configWrites": false
// }]
// --- Agent Defaults: Tool Security ---
"agents": {
"defaults": {
"tools": {
"profile": "minimal" // Read-only status, no tool access
},
"sandbox": {
"mode": "all", // Sandbox all non-main sessions
"workspaceAccess": "none" // No workspace filesystem access
}
}
},
// --- Logging with Redaction ---
"logging": {
"redactSensitive": "tools" // Redact tool input/output from logs
},
// --- Browser Safety ---
"browser": {
"evaluateEnabled": false // Disable browser JS evaluation
},
// --- Discovery ---
"discovery": {
"mdns": {
"mode": "off" // Don't advertise on local network
}
},
// --- Plugin Safety ---
"plugins": {
"enabled": false // No plugins until explicitly needed
},
// --- Command Safety ---
"commands": {
"config": false // Disable /config set chat command
}
}| Value | Meaning | Risk Level |
|---|---|---|
"loopback" |
Listen on 127.0.0.1 only | Lowest - no external access |
"lan" |
Listen on all LAN interfaces | Medium - requires auth |
"tailnet" |
Bind to Tailscale IP only | Low - tailnet-only |
Source: src/config/types.gateway.ts
| Value | Meaning |
|---|---|
"pairing" |
Unknown senders get a pairing code; ignored until approved |
"allowlist" |
Only listed IDs can DM; others blocked |
"open" |
Anyone can DM (NOT recommended for bots with tools) |
requireMention: true- Bot only responds when mentionedallowedGroups: ["id1", "id2"]- Only respond in these groupsrequireCommandPrefix: "!"- Only respond to commands starting with !
| Profile | Description |
|---|---|
"minimal" |
Read-only status - no tool access |
"coding" |
Filesystem, runtime, sessions, memory, images |
"messaging" |
Messaging group, session management |
null (empty) |
All tools available |
Source: src/agents/tool-catalog.ts:264-280
# Generate a random 64-character hex token
export GATEWAY_AUTH_TOKEN="$(openssl rand -hex 32)"
# Verify it's set
echo $GATEWAY_AUTH_TOKENReplace GENERATE_WITH_OPENSSL_COMMAND_BELOW with your actual token.
Use the onboarding wizard to set up your chosen provider securely:
openclaw onboard --install-daemonThe wizard handles:
- Provider selection (Anthropic, OpenAI, Zhipu AI, etc.)
- API key storage (environment variable or keychain)
- Default model selection
- Background service installation
# Copy this config to your OpenClaw directory
cp high-privacy-config.example.json5 ~/.openclaw/openclaw.json
# Edit to add your specific values
nano ~/.openclaw/openclaw.jsonopenclaw gateway restart# Check Gateway status
openclaw gateway status
# Run security audit
openclaw security audit --deep
# Check health
openclaw health-
Create a bot via @BotFather:
- Send
/newbot - Follow prompts to set name and description
- Copy the bot token
- Send
-
Add your user ID to
allowFromarray- Find your Telegram user ID: message
@userinfoboton Telegram - Add numeric ID to config
- Find your Telegram user ID: message
-
For pairing, after receiving a code:
openclaw pairing approve telegram <CODE>
- Run
openclaw channels login - Scan QR code with your phone
- Approve paired devices as needed
# From your local machine
ssh -N -L 18789:127.0.0.1:18789 user@gateway-hostThen open: http://127.0.0.1:18789/
- Install Tailscale on both Gateway host and your local machine
- On Gateway host:
sudo tailscale serve --bg --https=443 127.0.0.1:18789
- Configure OpenClaw to accept Tailscale identity:
"gateway": { "tailscale": { "mode": "serve" }, "auth": { "allowTailscale": true } }
- Access from your local machine: https://..ts.net/
# Validate configuration syntax
openclaw config validate
# Check logs
openclaw logs --follow# Get a tokenized URL
openclaw dashboard
# Run security audit to detect misconfigurations
openclaw security audit --deep- Never commit
openclaw.jsonto git - it may contain tokens - Never share screenshots containing your config or tokens
- Rotate tokens regularly if you suspect exposure
- Run security audit after any config changes:
openclaw security audit --fix - Back up known-good config before making changes (OpenClaw keeps 5 rotating
.bakfiles automatically)
- Gateway Security: https://docs.openclaw.ai/gateway/security
- Configuration: https://docs.openclaw.ai/gateway/configuration
- Tailscale: https://docs.openclaw.ai/gateway/tailscale
- Pairing: https://docs.openclaw.ai/start/pairing