Running an AI assistant with shell access, file system permissions, and messaging integrations is powerful. It’s also a meaningful security surface. You’re giving a language model the ability to execute commands, read files, and respond to messages on your behalf.

This isn’t theoretical risk. If you configure OpenClaw carelessly, you’re handing strangers the keys to your system.

Here’s how to run OpenClaw safely: keep it updated, audit it regularly, and vet plugins before you enable them.

Why Security Matters for AI Assistants

Unlike traditional software, AI assistants operate in a weird middle ground:

  • They interpret natural language — which means they can be tricked via prompt injection
  • They make decisions autonomously — which means misconfigurations compound quickly
  • They integrate deeply — shell access, calendar, email, file system, messaging platforms

A compromised traditional app might leak data. A compromised AI assistant can act on your behalf, send emails, execute shell commands, and modify files.

The OpenClaw threat model is documented at trust.openclaw.ai. Read it. The key insight: there is no “perfectly secure” setup. The goal is to be deliberate about:

  1. Who can talk to your bot
  2. Where the bot is allowed to act
  3. What the bot can touch

Start with the smallest access that works, then widen it as you gain confidence.

1. Keep OpenClaw Updated

Security patches happen. New features land. Model support improves. If you’re running a months-old version, you’re missing critical fixes.

Check Your Version

openclaw update status

This shows:

  • Your current channel (stable, beta, dev)
  • Installed version
  • Whether an update is available

Update Channels

OpenClaw supports three update channels:

  • stable — production-ready releases (recommended for most users)
  • beta — previews of upcoming stable releases (some bugs expected)
  • dev — bleeding edge, requires a git checkout (for contributors and early testers)

Unless you’re actively contributing to OpenClaw development, stick to stable.

How to Update

If you installed via npm/pnpm:

npm update -g openclaw

If you have a source checkout (dev channel):

openclaw update

This will:

  1. Pull the latest code
  2. Rebuild the project
  3. Run health checks (openclaw doctor)
  4. Restart the Gateway automatically

Update regularly. Weekly is good. Monthly is the bare minimum.

Automate Update Checks

Don’t rely on memory. Schedule a weekly cron job to check for updates:

openclaw cron add \
  --name "openclaw-update-check" \
  --schedule "0 9 * * 0" \
  --tz "Your/Timezone" \
  --message "Run 'openclaw update status' and notify me if an update is available."

This checks every Sunday at 9 AM. If an update exists, the assistant alerts you.

Do not auto-update blindly. Always review changelogs before updating. Breaking changes happen.

2. Run Security Audits Regularly

OpenClaw ships with a built-in security audit tool. It checks for common footguns:

  • Inbound access policies — Can strangers message your bot?
  • Tool blast radius — Could prompt injection turn into shell/file/network actions?
  • Network exposure — Is the Gateway accessible from the internet?
  • Browser control exposure — Are remote browser sessions configured safely?
  • File permissions — Are credentials world-readable?
  • Plugin risks — Are extension tools enabled without explicit allowlists?

Run an Audit

openclaw security audit

This produces a report like:

🔍 OpenClaw Security Audit

✅ DM policies: pairing mode enabled
⚠️  Gateway auth: bound to loopback, but auth.mode="none"
🔴 File permissions: credentials/*.json is world-readable
⚠️  Plugins: 2 extension tools loaded without explicit allowlist

Deep Audit

For a more thorough check (includes live Gateway probe):

openclaw security audit --deep

This takes longer but catches runtime misconfigurations.

Auto-Fix Common Issues

Some issues have safe, automated fixes:

openclaw security audit --fix

This will:

  • Tighten file permissions on config/state/credentials
  • Flip dmPolicy from open to pairing (if applicable)
  • Enable log redaction (logging.redactSensitive)

What it won’t do:

  • Rotate API keys or tokens (you must do this manually)
  • Disable tools like exec or browser (deliberate choice, not a bug)
  • Change network exposure settings (you might have a reason for remote access)

Always review the diff before applying fixes.

Schedule Regular Audits

Like update checks, automate this:

openclaw cron add \
  --name "security-audit" \
  --schedule "0 9 * * 0" \
  --tz "Your/Timezone" \
  --message "Run 'openclaw security audit' and report findings."

Weekly audits catch configuration drift (e.g., you added a plugin and forgot to tighten the allowlist).

3. Vet Plugins and Skills Before Enabling

OpenClaw’s plugin/skill system is powerful. It’s also the biggest attack surface.

What Are Skills?

Skills are instruction bundles (AgentSkills-compatible) that teach the assistant how to use tools. They’re just Markdown files with YAML frontmatter:

---
name: example-skill
description: Does something useful
---

# Instructions

When the user asks for X, run this command:
...

Skills can live in:

  1. Bundled skills — shipped with OpenClaw (vetted by maintainers)
  2. Managed skills — installed from ClawHub or manually (~/.openclaw/skills)
  3. Workspace skills — local to your workspace (<workspace>/skills)

If a skill name conflicts, workspace wins → managed → bundled.

The Risk

Skills can execute arbitrary shell commands. A malicious skill could:

  • Exfiltrate credentials
  • Install malware
  • Modify files
  • Send messages on your behalf

Third-party skills are untrusted code. Treat them like browser extensions or npm packages — read the code before enabling.

Vetting Checklist

Before enabling a skill from ClawHub or elsewhere:

  1. Read the SKILL.md — What commands does it run? What data does it access?
  2. Check for secrets — Does it require API keys? Where are they stored?
  3. Inspect scripts — If the skill references external scripts, read those too.
  4. Search for suspicious patterns:
    • curl | bash (remote code execution)
    • Hardcoded IPs or domains (exfiltration)
    • Base64-encoded payloads (obfuscation)
  5. Check the author — Known contributor? Active on Discord? Or anonymous throwaway?

Installing from ClawHub

ClawHub is the public skill registry (clawhub.com). It’s convenient but not curated. Anyone can publish.

Install a skill:

clawhub install <skill-slug>

This downloads to ./skills (or your configured workspace). Review the code before the next session.

Update all installed skills:

clawhub update --all

Building Your Own Skills

If you can’t find a trusted skill for your use case, build it yourself. It’s not hard.

Create a new skill:

mkdir -p skills/my-skill
cat > skills/my-skill/SKILL.md <<EOF
---
name: my-skill
description: Does something specific and safe
---

# Instructions

When the user asks for X:
1. Run this command: \`echo "Hello"\`
2. Return the output.
EOF

Restart OpenClaw. Your skill is now available.

Prefer workspace skills for sensitive workflows. They stay local and don’t sync to ClawHub accidentally.

4. Lock Down Messaging Access

If your bot is reachable via Telegram, WhatsApp, Discord, or Signal, who can message it?

By default, OpenClaw uses pairing mode: only users/groups you explicitly approve can interact with the bot.

DM Policies

For direct messages, set:

{
  "channels": {
    "telegram": {
      "dmPolicy": "pairing"
    }
  }
}

This requires explicit approval for each new DM sender. The bot will ask you before responding to strangers.

Never use dmPolicy: "open" unless the bot has zero tools enabled (read-only mode).

Group Policies

For group chats:

{
  "channels": {
    "telegram": {
      "groups": {
        "*": { "requireMention": true }
      }
    }
  }
}

This ensures the bot only responds when explicitly mentioned (@YourBot ...). Prevents accidental triggers.

Shared Inboxes

If multiple people DM your bot (e.g., family shared bot), set:

{
  "session": {
    "dmScope": "per-channel-peer"
  }
}

This isolates each sender’s session. Without this, one person’s conversation could leak into another’s.

5. Least Privilege for Tools

OpenClaw has tool profiles that control which tools the assistant can use:

  • minimal — messaging only, no shell/file access
  • messaging — adds email, calendar, contacts (no shell)
  • full — everything (default for local workstations)

Set the profile in config:

{
  "tools": {
    "profile": "messaging"
  }
}

For a locked-down assistant (e.g., running on a VPS accessible by others), use minimal and explicitly allow only what you need:

{
  "tools": {
    "profile": "minimal",
    "allow": ["web_search", "web_fetch"]
  }
}

Disable High-Risk Tools

If you don’t need shell access, disable it:

{
  "tools": {
    "exec": {
      "security": "deny"
    }
  }
}

Same for elevated (sudo-equivalent) commands:

{
  "tools": {
    "elevated": {
      "enabled": false
    }
  }
}

Sandboxing

For truly untrusted inputs (e.g., running code from the web), use Docker-based sandboxing:

{
  "agents": {
    "defaults": {
      "sandbox": {
        "mode": "docker"
      }
    }
  }
}

This runs commands in an isolated container. Slower, but safer.

6. File System Boundaries

By default, OpenClaw can read/write files anywhere the user has permissions. Restrict this:

{
  "tools": {
    "fs": {
      "workspaceOnly": true
    }
  }
}

This confines file operations to the configured workspace directory. Prevents accidental (or malicious) edits to system files.

7. Network Exposure

By default, the OpenClaw Gateway binds to 127.0.0.1 (localhost only). Keep it that way unless you have a specific reason to expose it.

If you need remote access, use a VPN (Tailscale recommended) or SSH tunnel. Never bind to 0.0.0.0 on a public IP without authentication.

Check your bind address:

openclaw status | grep bind

If you must expose the Gateway, enable auth:

{
  "gateway": {
    "bind": "0.0.0.0:5003",
    "auth": {
      "mode": "token",
      "token": "REPLACE_WITH_LONG_RANDOM_TOKEN"
    }
  }
}

Generate a strong token:

openssl rand -hex 32

Store it in a password manager. Rotate it quarterly.

8. Monitor Logs for Anomalies

OpenClaw logs to /tmp/openclaw/ by default. Review logs periodically:

tail -f /tmp/openclaw/openclaw-*.log

Look for:

  • Unexpected tool invocations (e.g., exec when you didn’t trigger it)
  • Failed authentication attempts
  • Errors related to file permissions
  • Unknown senders messaging the bot

Enable log redaction to avoid leaking secrets:

{
  "logging": {
    "redactSensitive": "tools"
  }
}

This masks API keys, tokens, and credentials in logs.

9. Backup Your Configuration

Security is useless if you lose everything in a hard drive failure.

Back up:

  • ~/.openclaw/openclaw.json (config)
  • ~/.openclaw/credentials/ (API keys, pairing allowlists)
  • ~/.openclaw/agents/ (session state, memory files)
  • Your workspace directory

I use a nightly cron job that backs up to Google Drive:

openclaw cron add \
  --name "backup-openclaw-config" \
  --schedule "0 3 * * *" \
  --tz "Your/Timezone" \
  --message "Backup ~/.openclaw/ to Google Drive."

Encrypt backups if they contain credentials.

10. Stay Informed

Security isn’t a one-time setup. Threats evolve. OpenClaw evolves.

  • Join the OpenClaw Discord — security discussions happen in #security
  • Follow the changelog — breaking changes and security fixes are announced
  • Read the threat model — trust.openclaw.ai is updated regularly

If you find a vulnerability, report it privately (don’t post on Discord/GitHub). Contact details are at trust.openclaw.ai.

Hardened Baseline (Copy-Paste Ready)

If you want a locked-down starting point, use this config:

{
  "gateway": {
    "mode": "local",
    "bind": "127.0.0.1:5003",
    "auth": {
      "mode": "token",
      "token": "REPLACE_WITH_LONG_RANDOM_TOKEN"
    }
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "tools": {
    "profile": "messaging",
    "deny": ["group:automation", "group:runtime", "sessions_spawn", "sessions_send"],
    "fs": {
      "workspaceOnly": true
    },
    "exec": {
      "security": "deny"
    },
    "elevated": {
      "enabled": false
    }
  },
  "channels": {
    "telegram": {
      "dmPolicy": "pairing",
      "groups": {
        "*": { "requireMention": true }
      }
    }
  },
  "logging": {
    "redactSensitive": "tools"
  }
}

This:

  • Binds to localhost only
  • Requires authentication
  • Isolates DM sessions
  • Restricts tools to messaging + web search
  • Denies shell access
  • Enables pairing mode
  • Redacts secrets from logs

From here, selectively enable tools as needed.

Summary

Running an AI assistant safely comes down to defense in depth:

  1. Keep OpenClaw updated — security patches matter
  2. Run openclaw security audit — regularly, not just once
  3. Vet plugins before enabling — read the code, trust but verify
  4. Lock down messaging access — pairing mode, require mentions in groups
  5. Use least privilege — start with minimal tools, expand as needed
  6. Confine file system access — workspaceOnly: true
  7. Avoid public exposure — localhost bind, VPN for remote access
  8. Monitor logs — anomalies are early warnings
  9. Backup your config — encrypted, offsite
  10. Stay informed — Discord, changelog, threat model

You’re giving a language model the ability to act on your behalf. That’s powerful. That’s risky. Be deliberate.


Running OpenClaw? Share your security setup in the Discord. Learn from others. Improve the docs.