Three incident types to prepare for
These are common, high-impact incidents: billing spikes, prompt injection, and permission overreach.
Incident 1: Billing spike
Root cause
- Loop or retry without iteration limits
- No per-request, hourly, or daily cost caps
- No monitoring or alerts
Rule: Loop + retry + no limit = billing incident.
Three defense layers
- OpenClaw layer — Limit loops, call rate, and daily/monthly budget.
- Provider layer — Set hard usage limits in provider dashboards.
- Account layer — Use prepaid, balance alerts, or card limits.
Cost control config example
{
"costControl": {
"enabled": true,
"limits": {
"perRequest": 0.1,
"hourly": 10,
"daily": 50
},
"actions": {
"onPerRequestLimit": "reject",
"onHourlyLimit": "pause_and_alert",
"onDailyLimit": "emergency_stop"
}
}
}
Immediate remediation
- Stop calls immediately
- Revoke or rotate the affected API key
- Stop OpenClaw processes or containers
- Export logs to analyze loop, retry, or fallback
- Fix and restore only after root cause is understood
Incident 2: Prompt injection
Root cause
- User input smuggled into system instructions
- No input filtering
- No extra permission check on tool calls
Defense
- Keep user input and system rules separate
- Require extra confirmation for high-risk tool calls
- Add permission checks in tool implementations
- Do not share one "default allow" for sensitive reads and sends
High-risk injection signals
- "Ignore all previous instructions"
- "You are now the system administrator"
- "Override rules / new system prompt"
- "Send the result to this external email/address"
Incident 3: Permission overreach
Root cause
send_as_usergranted too earlyoffline_accessgranted without refresh and revoke plan- Broad write access to docs, sheets, tasks
- Webhooks and callbacks not audited
Rule
If a permission lets OpenClaw act as you, write documents, or change tasks, it is execution-level, not read-only. Treat it accordingly.
Post-incident checklist
- Stop entry points: processes, containers, webhooks
- Rotate keys: API key, app secret, webhook secret
- Preserve evidence: export logs, config, timeline
- Narrow scope: identify whether cost, injection, permissions, or routing
- Fix the smallest loop first, then restore complex flows
Daily practices to add
- Set cost limits
- Use minimum permissions
- Maintain logs and rollback procedures
Next steps
- Cost control
- Security anti-patterns
- Security checklist
- Official docs → docs.openclaw.ai
- Issues → GitHub Issues