OpenClaw Sacred Rules
The 8 Sacred Rules learned from production disasters. Never violate these rules.
The 8 Sacred Rules
1. Verify Backups Before Confirming
CODEBLOCK0
2. Never Edit openclaw.json Manually
Wrong: nano ~/.openclaw/openclaw.json
Right: Use Python/CLI tools that handle JSON safely
3. Never Add Unverified Config Keys
Check official docs or ask before adding ANY new configuration keys.
4. Never Enable Sandbox Without Backup
Sandbox mode can cascade auth failures. Always backup first and test in isolation.
5. All Providers Failing = Config Issue
If multiple model providers fail simultaneously, suspect recent config changes, not provider outages.
6. Prefix Auth Commands with Environment
CODEBLOCK1
7. Anthropic 401 = Check auth-profiles.json
Don't read the file directly - use
openclaw status or CLI tools.
8. tooluse without toolresult = Reset Session
Corrupted sessions need
/reset to recover.
Safe Backup Script
Use the provided backup script instead of manual file copying:
CODEBLOCK2
Cooldown Reset Script
When experiencing "all providers unavailable" errors despite valid credentials, the in-memory cooldown state may be stale. Use:
CODEBLOCK3
This clears expired cooldowns from auth-profiles.json.
Note: This is a workaround for a bug where in-memory cooldown state doesn't refresh when file timestamps expire.
Config Validation
Before applying config changes:
CODEBLOCK4
Recovery Procedures
When you break a rule, see references/recovery.md for step-by-step recovery procedures.
Auth Troubleshooting
For auth issues, use the safe checker:
CODEBLOCK5
Never directly read auth-profiles.json - use the checker script instead.
OpenClaw 神圣规则
从生产事故中总结出的8条神圣规则。切勿违反这些规则。
8条神圣规则
1. 确认前先验证备份
bash
始终验证文件是否存在且有效
ls -la backup-file.json
python3 -m json.tool backup-file.json > /dev/null
2. 切勿手动编辑 openclaw.json
错误做法: nano ~/.openclaw/openclaw.json
正确做法: 使用能安全处理JSON的Python/CLI工具
3. 切勿添加未经验证的配置键
在添加任何新的配置键之前,请先查阅官方文档或进行询问。
4. 切勿在无备份情况下启用沙箱模式
沙箱模式可能导致级联认证失败。务必先备份并在隔离环境中测试。
5. 所有提供商均失败 = 配置问题
如果多个模型提供商同时失败,应怀疑近期配置变更,而非提供商故障。
6. 认证命令前添加环境前缀
bash
source ~/.openclaw/.env && openclaw auth
7. Anthropic 401 = 检查 auth-profiles.json
不要直接读取该文件——请使用 openclaw status 或 CLI 工具。
8. tooluse 无 toolresult = 重置会话
损坏的会话需要执行 /reset 才能恢复。
安全备份脚本
使用提供的备份脚本,而非手动复制文件:
bash
scripts/safe_backup.sh
冷却重置脚本
当凭据有效却遇到所有提供商不可用错误时,内存中的冷却状态可能已过期。请使用:
bash
scripts/reset_cooldowns.sh
该脚本会清除 auth-profiles.json 中已过期的冷却状态。
注意: 这是针对内存冷却状态在文件时间戳过期后无法刷新的bug的临时解决方案。
配置验证
在应用配置变更前:
bash
scripts/config_validator.py ~/.openclaw/openclaw.json
恢复流程
当违反规则时,请参阅 references/recovery.md 获取逐步恢复流程。
认证故障排查
对于认证问题,请使用安全检查器:
bash
scripts/auth_checker.sh
切勿直接读取 auth-profiles.json —— 请使用检查器脚本。