Back to Blog

OpenClaw Security Audit - Hardening Your AI Agent Deployment

April 21, 20267 min readMichael Ridland

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.

Running AI agents in production without a security audit is like deploying a web application without running a vulnerability scan. You might be fine. You might also be exposing your systems to risks you haven't thought about yet.

OpenClaw's security audit command is one of those tools that's easy to overlook because it doesn't build features. It just tells you what's wrong with your current setup. But the findings it surfaces can be genuinely important - especially if you're running agents that interact with messaging platforms, process user input, or have access to filesystems and tools.

We've been deploying OpenClaw for clients who need AI agents integrated into their communication workflows, and the security audit has caught configuration issues on every single project. Not because people are careless - because the default configurations are designed for quick setup, not production hardening.

What the Security Audit Checks

The OpenClaw security CLI runs a set of checks against your configuration and reports findings by severity. You can run the basic version with openclaw security audit or go deeper with the --deep flag.

Here's what it actually looks for, grouped by the categories that matter most in practice.

Group and DM Policy

This is where the most common findings show up. OpenClaw is built as a personal assistant by default - it assumes one user talking to one agent. When you start sharing an agent across a team or exposing it to group channels, the security model changes.

The audit checks whether multiple DM senders share a main session. If they do, it recommends switching to session.dmScope="per-channel-peer" so each user gets their own session context. Without this, users can potentially see conversation history from other users' sessions. For multi-account setups, the recommendation escalates to per-account-channel-peer.

It also flags open group policies. If your configuration has groupPolicy="open", any group your agent is added to becomes an active channel. For an internal team tool, this might be acceptable. For anything facing external users, it's a problem.

Webhook Hardening

If you're using webhooks to trigger agent actions - and most production deployments do - the audit checks several things:

  • Is your webhook token the same as your gateway token? Reusing tokens is a common shortcut that creates unnecessary risk.
  • Is the webhook token short? Short tokens are easier to brute force.
  • Is the webhook path set to /? This makes discovery trivial.
  • Is defaultSessionKey unset? Without it, incoming webhooks might create sessions in unexpected ways.
  • Are allowedAgentIds unrestricted? This means any agent in your deployment could process webhook-triggered tasks.
  • Are session key overrides enabled without prefix restrictions? This lets webhook callers specify arbitrary session keys, which could be used to hijack existing sessions.

Each of these on its own might seem minor. Together, they create an attack surface that's larger than most teams realise.

Sandbox Verification

For agents running in sandboxed environments (which they should be - see our previous post on OpenClaw sandboxing), the audit checks for configuration inconsistencies.

It flags situations where Docker sandbox settings are configured but sandbox mode is actually turned off. It checks network modes and warns about dangerous configurations like host networking, which defeats the purpose of sandboxing. It verifies that browser sandbox containers have the correct hash labels, and recommends recreation when they're stale.

There's also a check for whether small models (under 300B parameters) are being used without sandboxing while web/browser tools are enabled. Smaller models are more susceptible to prompt injection, so running them with broad tool access and no sandbox is a real risk.

Plugin and Tool Safety

The audit examines your installed plugins for security concerns. It checks whether npm-based plugin install records are pinned to specific versions and whether integrity metadata is present. Unpinned dependencies that drift from installed versions are a supply chain risk.

It also looks at tool profiles. If you've set a restrictive global profile like tools.profile="minimal" but individual agents override it with broader profiles, the audit flags the inconsistency. Your security posture is only as strong as your most permissive agent.

Network and Discovery

A few network-level checks round out the audit. It flags gateway.allowRealIpFallback=true, which could let someone spoof their IP if your proxy configuration isn't perfect. It warns about discovery.mdns.mode="full", which broadcasts metadata via mDNS TXT records that could leak information about your deployment.

It also checks channel allowlists and warns when they rely on mutable identifiers (names, emails, tags) instead of stable IDs. A user can change their display name. They can't change their platform-assigned ID.

Running the Audit

The basic audit is simple:

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.

openclaw security audit

For production deployments, use the deep scan:

openclaw security audit --deep

If your configuration uses token-based authentication, pass it directly:

openclaw security audit --deep --token <your-token>

For CI/CD integration, the JSON output mode is what you want:

openclaw security audit --json | jq '.summary'

You can filter for critical findings specifically:

openclaw security audit --deep --json | jq '.findings[] | select(.severity=="critical") | .checkId'

This makes it straightforward to build a pipeline gate that fails deployments when critical security issues exist.

The --fix Flag

The audit includes an auto-fix mode that handles safe, deterministic remediations:

openclaw security audit --fix

What it does:

  • Flips open group policies to allowlist mode
  • Enables sensitive data redaction in logs
  • Tightens file permissions on state, config, credentials, and session files

What it doesn't do:

  • Rotate tokens, passwords, or API keys
  • Disable tools or gateway features
  • Change network exposure settings
  • Remove or rewrite plugins

The distinction makes sense. The things --fix changes are configuration tightenings that are always safe. Token rotation and network changes require human judgement because they can break things.

I'd recommend running --fix on every new deployment as part of your initial setup. Then run the full audit to see what remains for manual remediation.

Practical Recommendations

Based on what we've seen across deployments, here's what I'd prioritise:

Fix webhook security first. Webhook endpoints are your most exposed attack surface. Unique tokens, non-default paths, session key restrictions, and agent ID allowlists are the minimum. This takes about 15 minutes to configure properly.

Enable per-user sessions. If more than one person interacts with your agent, configure session scoping. The default shared session is designed for personal use and doesn't provide isolation between users.

Pin your plugin versions. Unpinned dependencies in an AI agent context are more dangerous than in a typical web application, because the agent has tool access and can take actions. A compromised dependency in a web app might leak data. A compromised dependency in an agent can execute commands.

Run the audit in CI. Add openclaw security audit --deep --json to your deployment pipeline and fail on critical findings. Security configuration that isn't tested drifts over time. Someone changes a setting to debug a problem, forgets to change it back, and now your webhook accepts any session key.

Treat the "dangerous" flags as what they are. Settings prefixed with dangerous or dangerously are explicit break-glass overrides. If you find them in your configuration, make sure someone made a deliberate decision to enable them and documented why.

Why This Matters For Production AI Agents

AI agents are different from traditional applications because they take actions. A misconfigured web form might leak some data. A misconfigured AI agent might execute arbitrary commands, access files it shouldn't, or process messages from users it shouldn't be talking to.

The security audit doesn't guarantee your deployment is secure, but it catches the common misconfigurations that create unnecessary risk. It takes two minutes to run. There's no good reason not to include it in your deployment process.

If you're deploying AI agents for your organisation and want help with security architecture - from the agent configuration through to the underlying infrastructure - our AI consulting team has done this across multiple industries. We also offer managed services for OpenClaw deployments where we handle the ongoing security monitoring and configuration management.

For teams building agentic workflows that need to interact with business systems - processing messages, triggering actions, integrating with existing platforms - our agentic automation practice can help design architectures that are both useful and secure from the start.

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.