This runbook turns the broader Security guidance into an operator checklist for remote access and messaging exposure.Documentation Index
Fetch the complete documentation index at: https://docs2.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
Choose the exposure pattern
Prefer the narrowest pattern that satisfies the workflow.| Pattern | Recommended when | Required controls |
|---|---|---|
| Loopback + SSH tunnel | Personal use, admin access, debugging | Keep gateway.bind: "loopback" and tunnel 127.0.0.1:18789 |
| Loopback + Tailscale Serve | Personal tailnet access to Control UI/WebSocket | Keep Gateway loopback-only; rely on Tailscale identity headers only for supported surfaces |
| Tailnet/LAN bind | Dedicated private network with known devices | Gateway auth, firewall allowlist, no public port-forward |
| Trusted reverse proxy | Organization SSO/OIDC in front of Gateway | trusted-proxy auth, strict trustedProxies, header overwrite/strip rules, explicit allowed users |
| Public internet | Rare, high-risk deployments | Identity-aware proxy, TLS, rate limits, strict allowlists, sandboxed non-main sessions |
Pre-flight inventory
Record these before changing bind, proxy, Tailscale, or channel policy:- Gateway host, OS user, and state directory.
- Gateway URL and bind mode.
- Auth mode, token/password source, or trusted proxy identity source.
- All enabled channels and whether they accept DMs, groups, or webhooks.
- Agents reachable from non-local senders.
- Tool profile, sandbox mode, and elevated tool policy for each reachable agent.
- External credentials available to those agents.
- Backup location for
~/.openclaw/openclaw.jsonand credentials.
Baseline checks
Run these before opening access:Minimum safe baseline
Use this shape as the starting point for exposed deployments:exec.security: "deny" baseline blocks all exec calls, including
benign diagnostics. If diagnostics or low-risk commands are required, relax this
only after choosing the specific senders, agents, commands, and approval mode
that match your threat model.
DM and group exposure
Messaging channels are untrusted input surfaces. Before allowing DMs or groups:- Prefer
dmPolicy: "pairing"or strictallowFromlists. - Avoid
dmPolicy: "open"unless every sender is trusted. - Do not combine
"*"allowlists with broad tool access. - Require mentions in groups unless the room is tightly controlled.
- Use
session.dmScope: "per-channel-peer"when multiple people can DM the bot. - Route shared channels to agents with minimal tools and no personal credentials.
Reverse proxy checks
For identity-aware proxies:- The proxy must authenticate users before forwarding to the Gateway.
- Direct access to the Gateway port must be blocked by firewall or network policy.
gateway.trustedProxiesmust contain only the proxy source IPs.- The proxy must strip or overwrite client-supplied identity and forwarding headers.
gateway.auth.trustedProxy.allowUsersshould list expected users when the proxy serves more than one audience.- Same-host loopback proxy mode should use
allowLoopbackonly when local processes are trusted and the proxy owns the identity headers.
openclaw security audit --deep after proxy changes. Trusted-proxy findings
are intentionally high-signal because the proxy becomes the authentication
boundary.
Tool and sandbox review
Before exposing an agent to remote senders:- Confirm which sessions run on host versus sandbox.
- Deny or require approval for host exec.
- Keep elevated tools disabled unless a specific, trusted sender needs them.
- Avoid browser, canvas, node, cron, gateway, and session-spawn tools for open or semi-open messaging surfaces.
- Keep bind mounts narrow and avoid credential, home, Docker socket, and system paths.
- Use separate gateways, OS users, or hosts for materially different trust boundaries.
Post-change validation
After each exposure change:- Re-run
openclaw security audit --deep. - Test a successful authorized connection.
- Test that an unauthorized sender or browser session is denied.
- Confirm logs redact secrets.
- Confirm DM/group routing reaches only the intended agent.
- Confirm high-impact tools ask for approval or are denied.
- Document the accepted residual warnings.
Rollback plan
If the Gateway may be overexposed:- Stop public forwarding, Tailscale Funnel, or reverse proxy routes.
- Rotate Gateway tokens/passwords and affected integration credentials.
- Remove
"*"and unexpected senders from allowlists. - Review recent audit logs, run history, tool calls, and config changes.
- Re-run
openclaw security audit --deep. - Re-enable access with the narrowest pattern that satisfies the workflow.
Review checklist
- Gateway remains loopback-only unless there is a documented reason.
- Non-loopback access has auth, firewalling, and no public direct route.
- Trusted-proxy deployments have strict proxy IPs and header controls.
- DMs use pairing or allowlists, not open access by default.
- Groups require mentions or explicit allowlists.
- Shared channels do not reach personal credentials.
- Non-main sessions run in sandbox mode.
- Host exec and elevated tools are denied or approval-gated.
- Logs redact secrets.
- Critical audit findings are resolved.
- Rollback steps are tested and documented.