Skip to content

Latest commit

 

History

History
668 lines (472 loc) · 22.6 KB

File metadata and controls

668 lines (472 loc) · 22.6 KB

Operational Gotchas: Lessons from Real OpenClaw Usage

In Plain English: These aren't code vulnerabilities — they're ways day-to-day usage goes wrong. Real users sharing real experiences from running OpenClaw for weeks or months, compiled from three external articles and verified against the codebase.

How to Use This Guide:

  1. Read each scenario before deploying to production
  2. Check if your usage patterns match the "What They Did" examples
  3. If they do, follow "The Fix" immediately
  4. Set up monitoring to catch these issues proactively

Time to read: 12 minutes Difficulty: Beginner-friendly with practical examples

Sources:


Table of Contents

  1. The "Always-On" Cost Trap
  2. The 60% Success Reality
  3. Task Chunking Gotchas
  4. GUI Automation Limits
  5. Dormancy & Context Loss
  6. The "Draft vs Send" Ambiguity
  7. Browser Profile Bleed
  8. Skill Supply Chain Risks
  9. BYOD Exposure
  10. Reverse Proxy Negligence
  11. The "It Read the Instructions and Ignored Them" Problem

1. The "Always-On" Cost Trap

What They Did

# Deployed OpenClaw on a VPS with Anthropic Claude Opus
# Enabled WhatsApp + Telegram channels
# Set tools.exec.security: "ask" for convenience
# Left it running 24/7

What They Thought

"AI agents are efficient — they only process when I send a message. How expensive can it be?"

What Actually Happened

  • Agent averaged 473 requests/day from:
    • Group chat mentions (unexpected)
    • Channel sync glitches (duplicate processing)
    • Scheduled tasks running even when not needed
    • Keepalive heartbeat traffic
  • Monthly API bill: $847 (expected: ~$50-100)
  • The "always-on" nature means idle time costs money

The Psychology: "Always-on" infrastructure feels like it should be cheap when idle. But OpenClaw isn't a web server that sits dormant — it's an active agent that processes context, maintains sessions, and may run scheduled tasks.

The Fix

# 1. Set up spending alerts at your model provider
# Anthropic Console: Billing → Alert → Set $50/day threshold

# 2. Use the coding tools profile (disables always-on features)
openclaw config set tools.profile coding

# 3. Configure aggressive timeout settings
openclaw config set agents.defaults.timeout 300000  # 5 minutes max

# 4. Monitor usage daily
openclaw status --all | grep -E "(requests|tokens)"

# 5. Consider scheduled auto-shutdown for non-production
# Add to crontab: 0 2 * * * /usr/local/bin/openclaw gateway stop
# Add to crontab: 0 8 * * * /usr/local/bin/openclaw gateway start

See also: Cost + Token Optimization — Monitoring and spending controls


2. The 60% Success Reality

What They Did

# Asked agent to: "Research and summarize all AWS security best practices"
# Expected: Comprehensive report in 10 minutes

What They Thought

"AI can handle complex tasks — it just needs clear instructions."

What Actually Happened

  • Task required 15+ tool calls (search, fetch, analyze, summarize)
  • Around step 7-8, context drifted:
    • Agent lost track of original goal
    • Started summarizing unrelated tangents
    • Eventually hallucinated sources
  • Success rate for >10-step tasks: ~60% (industry baseline for agentic AI)

The Core Issue: Each tool call is a "context switch" where the agent can lose track. Longer tasks = more context switches = higher failure probability.

The Fix

# 1. Break complex tasks into explicit chunks
# WRONG: "Research AWS security and write a guide"
# RIGHT: "First, search for official AWS security whitepapers. Report back what you find."

# 2. Ask for confirmation before proceeding
# Add to your system prompt or initial message:
# "After each major step, stop and ask if I want you to continue."

# 3. Use checkpoints for multi-step workflows
# Checkpoints save the agent's progress at each major step, so if something
# goes wrong partway through, the agent can pick up where it left off
# instead of starting over (and losing context).
openclaw config set agents.defaults.checkpoints true

# 4. Monitor for context drift symptoms
# Warning signs: agent asking "what was I doing?", repeating itself, or going on tangents

# 5. For truly complex tasks, consider pair-programming
# Stay engaged: approve each step, provide course correction

See also: Threat Model


3. Task Chunking Gotchas

What They Did

# Single message: "Analyze my codebase for security issues, create a report, email it to me, and post a summary to Slack"

What They Thought

"It's more efficient to give everything at once rather than multiple messages."

What Actually Happened

  • Agent got overwhelmed by simultaneous requirements
  • Attempted all tools in parallel:
    • Code analysis (expensive)
    • Email (API call)
    • Slack post (API call)
    • Report generation (file write)
  • Three of the four operations failed silently
  • User only noticed when Slack summary never appeared

The Problem: Agents don't natively "chunk" tasks the way humans do. When given 5 objectives, they may attempt all 5 simultaneously, run out of context, and produce partial results.

The Fix

# 1. Explicitly sequence complex tasks
# WRONG: "Do A, B, C, D, and E"
# RIGHT: "First, do A. When complete, ask me and I'll tell you the next step."

# 2. Use checkpoints for multi-stage workflows
# Checkpoints save the agent's progress at each major step, so if something
# goes wrong partway through, it can resume instead of starting over.
openclaw config set agents.defaults.checkpoints true

# 3. Configure tool policy to prevent parallel runaway
# Without this, the agent might fire off 10+ tool calls at once, overwhelming
# the system and burning through your API budget. This caps it at 3 at a time.
openclaw config set tools.maxConcurrent 3

# 4. After agent completes a step, verify before proceeding
# Get confirmation: "Step 1 done. Ready for step 2?"

# 5. For recurring workflows, create a skill
# Skills can sequence operations reliably

4. GUI Automation Limits

What They Did

# Asked agent to: "Log into the billing portal and download last month's invoice"
# Enabled browser control tool

What They Thought

"If the agent can control a browser, it can do anything I can do manually."

What Actually Happened

  • Agent failed to navigate:
    • Site used bot detection (Cloudflare Turnstile)
    • Pop-up modal appeared (unexpected UI state)
    • Session timeout required re-login
  • Agent clicked wrong element (similar-looking button)
  • Agent got stuck in infinite loop retrying failed action

The Reality: Browser automation is powerful but fragile. Real websites have:

  • Anti-bot protections (Cloudflare, Akamai, hCaptcha)
  • Dynamic UI changes
  • A/B testing
  • Rate limits

A human intuitively handles these. An agent doesn't.

The Fix

# 1. For sensitive tasks, do them manually yourself
# Banking, billing, account settings — high risk if agent goes wrong

# 2. If you must automate, reduce task surface area
# WRONG: "Log into portal, navigate to billing, download invoice"
# RIGHT: "I'm already on the billing page. Click the download button for January 2025."

# 3. Use screenshots to verify agent behavior
# After each critical action, ask agent to take a screenshot

# 4. Set shorter timeouts for browser tasks
openclaw config set tools.browser.timeout 60000  # 60 seconds

# 5. Consider human-in-the-loop for all browser actions
openclaw config set tools.browser.security ask

5. Dormancy & Context Loss

What They Did

# OpenClaw session running for 3 days without interaction
# Returned to conversation: "Continue where we left off"

What They Thought

"The agent remembers our conversation — it's right there in the chat history."

What Actually Happened

  • Agent appeared to "freeze" — stopped responding
  • Transcript showed hundreds of turns but agent acted like it had no context
  • Context window filled with stale conversation
  • Agent lost track of:
    • Original task
    • Previously established rules
    • Important details from earlier in session

The Issue: Long-running sessions accumulate context. Eventually, the conversation history fills the context window, and the model can't "see" earlier important context anymore. New messages push out old ones.

The Fix

# 1. For long-term projects, use memory files instead of chat history
# Ask agent to write summaries to MEMORY.md in your workspace

# 2. Periodically start fresh sessions
# Every 1-2 days of active work, start a new session:
# "Let's continue in a fresh session. Here's context: [paste summary]"

# 3. Configure transcript rotation
openclaw config set transcripts.rotateDays 7

# 4. Check context window usage
openclaw status --all | grep context

# 5. Use project-specific workspaces
# Each project gets its own workspace with its own memory/

6. The "Draft vs Send" Ambiguity

What They Did

# Asked agent: "Draft an email to the team about the deployment"

What They Thought

"Draft means prepare — obviously the agent won't send it."

What Actually Happened

  • Agent interpreted "draft" as "create and send"
  • Email was sent immediately
  • Recipients received:
    • Typos (agent didn't proofread)
    • Wrong dates (hallucinated)
    • Incomplete information (agent didn't ask clarifying questions)

The Danger: Words that humans use as constraints ("draft", "tentative", "explore") may not be interpreted as constraints by the AI. The model may optimize for "helpful task completion" rather than "do what I literally said."

The Fix

# 1. Use explicit constraints for output-only actions
# WRONG: "Draft a post"
# RIGHT: "Write a post and SHOW IT TO ME. Do not send it anywhere. I need to review it first."

# 2. Disable send actions entirely in untrusted contexts
openclaw config set tools.deny '["email", "slack", "discord"]'

# 3. Use review loops for important content
# "Write the email, then stop. Wait for me to approve."

# 4. Consider pair-mode for all sensitive communications
# Keep human in the loop for any action that affects other people

7. Browser Profile Bleed

What They Did

# Installed OpenClaw on personal laptop
# Enabled browser control tool
# Used daily Chrome profile (syncs across devices)

What They Thought

"The agent is just a helper — it doesn't affect my regular browsing."

What Actually Happened

  • Agent had access to ALL cookies and sessions in the browser profile:
    • Personal email (logged in)
    • Bank (active session)
    • Work portals (SSO cached)
    • Social media accounts
  • Any prompt injection could now:
    • Read emails
    • Initiate bank transfers
    • Post to social media
    • Access work resources

The Risk: Your browser profile is a master key to your digital life. If the AI agent (or an attacker via prompt injection) controls your browser, they control everything you're logged into.

The Fix

# 1. Create a dedicated browser profile for OpenClaw
# Chrome: --user-data-dir=/Users/you/.openclaw-browser
# Firefox: -P "openclaw" (create profile first via Profile Manager)

# 2. Never use your daily driver profile
openclaw config set tools.browser.profile /path/to/isolated/profile

# 3. Keep the OpenClaw profile logged OUT of sensitive sites
# Use it only for the specific sites the agent needs to access

# 4. Consider running browser in a sandbox
# Docker, Firefox ESR with containers, or Chromium --sandbox

# 5. For maximum security, disable browser control entirely
openclaw config set tools.deny '["browser"]'

See also: Cross-Cutting Vulnerabilities — Browser Automation


8. Skill Supply Chain Risks

What They Did

# Found a useful-looking skill on ClawHub
# Installed without reviewing code

What They Thought

"It's on the official marketplace — it must be safe."

What Actually Happened

  • February 2026: 341 malicious skills discovered on ClawHub
  • Attack wasn't a code exploit — it was social engineering:
    • Skill descriptions promised legitimate functionality
    • Code included hidden instructions in Markdown files
    • Some skills created "sleeper agents" that activated later
  • Skills run in-process with full access to:
    • Credentials
    • File system
    • Model provider API keys

The Reality: ClawHub is like npm — a package registry. It has scanning (VirusTotal partnership, built-in local scanner), but neither can catch social engineering. Installing a skill is like running curl random.sh | bash — you're trusting the publisher.

The Fix

# 1. Before installing any skill, verify publisher reputation
# Check: How old is the account? How many skills? Any reports?

# 2. Read the actual code, not just documentation
openclaw skills install --dry-run skill-name
# Review the printed diff

# 3. Check local scanner warnings
# Installation shows warnings — don't ignore them

# 4. Never run "prerequisite" commands from skill docs
# Skills that ask you to run curl/bash first are suspicious

# 5. Verify on VirusTotal before installing
openclaw skills scan --virustotal skill-name

# 6. Use Koi Security Scanner as third-party check
# https://koi.ai/clawhub-scanner

# 7. For production, pin skill versions
openclaw config set skills.pinnedVersions true

See also: ClawHub Marketplace Risks — Full analysis of Feb 2026 ClawHavoc campaign


9. BYOD Exposure

What They Did

# Installed OpenClaw on personal laptop
# Connected to work Slack channel
# Used personal API keys for model provider

What They Thought

"It's my personal laptop — work stuff doesn't mix."

What Actually Happened

  • Context bleed across sessions:
    • Personal session saw work documents (accidental paste)
    • Work session saw personal info (side conversation)
  • Credential overlap:
    • Work SSO cached in browser (agent could access)
    • Personal API key used for work queries (billing confusion)
  • Data residency violation:
    • Work data processed by personal account
    • No audit trail for compliance

The Problem: One agent instance handling both personal and work contexts creates:

  • Privacy violations (both directions)
  • Billing confusion (who pays for what?)
  • Compliance issues (data residency)
  • Security risk (personal agent has work access)

The Fix

# 1. Use separate instances for personal and work
# Personal: ~/.openclaw
# Work: ~/.openclaw-work

# 2. Use separate API keys
# Personal: Your own Anthropic/OpenAI key
# Work: Company-provided key (with separate billing)

# 3. Use dedicated work channels
# Personal: Your personal WhatsApp/Telegram
# Work: Work Slack/Discord only

# 4. For work use, consider company-hosted instance
# Don't mix corporate data with personal infrastructure

# 5. Configure workspace isolation
openclaw config set agents.defaults.workspace ~/workspace/personal
# Work instance: ~/workspace/work

10. Reverse Proxy Negligence

What They Did

# Set up nginx in front of Gateway
# Configured basic proxy_pass
# Forgot to set trustedProxies in OpenClaw config

What They Thought

"Nginx is handling TLS — what else is there?"

What Actually Happened

  • Gateway couldn't correctly identify client IP addresses
  • Security checks failed:
    • Local-only checks blocked legitimate requests
    • Access controls allowed requests from unexpected sources
  • Rate limiting didn't work (all requests appeared to come from 127.0.0.1)

The Issue: When a reverse proxy sits in front of Gateway, the Gateway sees the proxy's IP (127.0.0.1) as the client IP — not the real client's IP. Without trustedProxies configured, Gateway can't "see through" the proxy to the real client.

The Fix

# 1. Configure trusted proxies in OpenClaw
openclaw config set gateway.trustedProxies '["127.0.0.1", "::1"]'

# 2. Verify with security audit
openclaw security audit
# Should report: gateway.trusted_proxies_missing (if not configured)

# 3. For nginx, pass original client IP
# In nginx.conf:
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# 4. Test from external client
curl -v https://your-gateway-url/
# Check Gateway logs show real client IP, not 127.0.0.1

# 5. Consider Tailscale Serve instead of manual reverse proxy
# Handles HTTPS, identity, and trusted IPs automatically
openclaw config set gateway.tailscale.mode serve

Source: src/gateway/net.ts:136-180 (isTrustedProxyAddress + resolveClientIp)


11. The "It Read the Instructions and Ignored Them" Problem

What They Did

# Created a SKILL.md with explicit safety instructions:
# "NEVER run rsync directly. Always use sync.sh."
# Ran the skill with an untested model (GLM-5)

What They Thought

"The instructions are right there in the SKILL.md — the model will follow them."

What Actually Happened

  • GLM-5 read sync.sh, decided the script was wrong
  • Tried to edit sync.sh (blocked by file permissions)
  • Ran raw rsync --delete directly — deleting files
  • Misinterpreted disable-model-invocation: true in the skill frontmatter as meaning the skill was "disabled" (it actually controls whether the model can invoke the skill unprompted — parsed at src/agents/skills/frontmatter.ts:220, used at src/agents/skills/workspace.ts:544)
  • The model read every safety instruction, understood them, and chose to do something else anyway

The Core Insight: OpenClaw's safety architecture is markdown. System prompts, SKILL.md, CLAUDE.md, hardening checklists — all markdown. Markdown is a suggestion to the model, not a constraint. A model can read "NEVER do X" and do X anyway. This isn't a bug — it's how language models work. They predict tokens, they don't "obey."

The Fix

# 1. Understand soft vs hard controls
# Soft (.md files): model SHOULD follow — but can ignore
# Hard (hooks, permissions, code): model CANNOT bypass
# Design safety around hard controls, use .md for documentation

# 2. For destructive operations, add hard enforcement
# Wrapper scripts with set -euo pipefail:
#!/bin/bash
set -euo pipefail
# Script validates preconditions before acting
# Model can't "decide the script is wrong" and bypass it

# 3. Use tool security modes
# tools.exec.security: "allowlist" restricts which commands models can run
# Source: src/config/types.tools.ts:233
openclaw config set tools.exec.security allowlist

# 4. Test model instruction-following before trusting with destructive ops
# Top-tier models (Opus 4.6, GPT-5) follow .md instructions reliably
# Smaller/newer models may not — test before giving destructive tool access

# 5. Skill authors: treat SKILL.md as documentation, enforce safety in code
# Put "NEVER run rsync directly" in the SKILL.md for humans to read
# Put the actual enforcement in a wrapper script that the model must call
# Default to dry-run mode; require --force for destructive operations

See also: AI Self-Misconfiguration — When Markdown Instructions Aren't Enough — Why .md instructions aren't safety guarantees


Summary: The 11 Operational Commandments

  1. Thou shalt monitor usage daily — always-on isn't free
  2. Thou shalt chunk complex tasks — >10 steps fail 40% of the time
  3. Thou shalt sequence explicitly — agents don't natively chunk
  4. Thou shalt beware browser automation — sites fight back with bot detection
  5. Thou shalt refresh sessions — context windows fill with stale conversation
  6. Thou shalt say exactly what you mean — "draft" doesn't mean "don't send"
  7. Thou shalt isolate browser profiles — your daily driver is a master key
  8. Thou shalt review skills like code — ClawHub isn't App Store curated
  9. Thou shalt separate personal and work — BYOD is a compliance risk
  10. Thou shalt configure trusted proxies — otherwise Gateway can't see clients
  11. Thou shalt not trust .md files as enforcement — instructions are suggestions, not guardrails

Quick Operational Checklist

Run this checklist after deploying OpenClaw:

# 1. Check current usage
openclaw status --all | grep -E "(requests|tokens|cost)"

# 2. Verify spending alerts are enabled
# At your model provider's console

# 3. Check browser profile isolation
openclaw config get tools.browser.profile
# Should be: a dedicated profile path, not your default

# 4. Verify skill review process
# Before installing: read code, check publisher, scan with VirusTotal

# 5. Check reverse proxy config (if using nginx/Caddy)
openclaw config get gateway.trustedProxies
# Should include: ["127.0.0.1", "::1"] at minimum

# 6. Check session age
openclaw status | grep running
# If >7 days, consider starting fresh session

# 7. Verify workspace isolation (if using personal + work)
openclaw config get agents.defaults.workspace

# 8. Verify model quality for safety-critical skills
# Top-tier models follow .md instructions reliably; smaller models may not.
# Test instruction-following before giving destructive tool access.

See Also