Secure Your OpenClaw Bot: Best Practices & Access Control
Setting up an AI agent is exciting until you realize it has the keys to your digital life. You want it to be helpful, but you also need to make sure it doesn’t go rogue because of a random message or a malicious prompt.
Security isn’t just about locking doors; it’s about knowing who has the keys. When you’re running a bot that can read messages and run commands, you need a clear plan to keep things under control.
Is it safe to use OpenClaw as my main WhatsApp account?
Section titled “Is it safe to use OpenClaw as my main WhatsApp account?”Only if you trust everyone who can message you. Since any DM or group mention can trigger the bot, you should use dmPolicy: "allowlist" and groupPolicy: "allowlist" to limit who can interact with it. The best move is to create a separate WhatsApp account for the bot.
What’s the risk of prompt injection?
Section titled “What’s the risk of prompt injection?”Prompt injection is when malicious text tricks the model into doing something unintended. OpenClaw has guardrails, but no system is immune.
Reduce risk by:
- Using strong models
- Limiting tool permissions
- Enabling sandboxing for untrusted sessions
- Setting
agents.defaults.autonomyto require confirmation for sensitive actions
Should I use a separate account for the bot?
Section titled “Should I use a separate account for the bot?”Recommended for production. A separate account helps keep things organized and safe.
A separate account:
- Isolates the bot’s message history
- Prevents accidental exposure of personal chats
- Makes allowlisting cleaner
- Keeps your personal data private
For casual personal use, your main account is fine with proper allowlists.
How do I limit what the bot can do automatically?
Section titled “How do I limit what the bot can do automatically?”Use agents.defaults.autonomy to control what the bot can do:
{ agents: { defaults: { autonomy: { mode: "supervised", // ask before sensitive actions autoApprove: ["read"], requireApproval: ["write", "execute", "network"] } } }}This makes the bot ask for confirmation before writes, executes, network calls, or any sensitive action.
What is pairing and how does it work?
Section titled “What is pairing and how does it work?”Pairing is how nodes authenticate with the Gateway. When a node first connects, it submits a pairing request that you approve on the Gateway:
openclaw nodes pendingopenclaw nodes approve <requestId>Once approved, the node can receive node.* tool calls from the Gateway.
Can I revoke a paired node?
Section titled “Can I revoke a paired node?”Yes:
openclaw nodes listopenclaw nodes revoke <nodeId>The node will need to re-pair after revocation.
How do I restrict which users can message the bot?
Section titled “How do I restrict which users can message the bot?”You can lock down who can talk to the bot using allowlists for specific channels.
WhatsApp:
{ channels: { whatsapp: { dmPolicy: "allowlist", allowFrom: ["+15551234
```json{ channels: { whatsapp: { dmPolicy: "allowlist", allowFrom: ["+15551234567", "+15559876543"] } }}{ channels: { telegram: { allowFrom: ["123456789", "@username"] } }}OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.