Config Guardian
Overview
For Agent use only. Safe config updates with automatic backup, validation, and rollback. Prevents the agent from updating non-existent keys or invalid values.
When to Use
Use this skill
every time you need to update
openclaw.json. Prevents:
- - Updating non-existent config keys
- Using invalid values
- Breaking the gateway with bad config
Workflow: Atomic Apply (Default)
For all config changes - handles everything in one command:
CODEBLOCK0
What it does:
- 1. Creates timestamped backup automatically
- Applies change via INLINECODE1
- Validates with INLINECODE2
- Auto-rollback if validation fails
- Trap ensures rollback even on crash
Backup location:
CODEBLOCK1
Guardrails
- - Never restart or apply config without explicit user approval
- Always use INLINECODE3
- If validation fails -> config auto-rolled back, don't force it
Scripts
| Script | Purpose |
|---|
| INLINECODE4 | Default - all-in-one safe apply |
| INLINECODE5 |
Validate via OpenClaw doctor |
|
restore_config.sh | Manual restore from backup |
配置守护者
概述
仅供代理使用。 安全的配置更新,具备自动备份、验证和回滚功能。防止代理更新不存在的键或无效值。
使用时机
每次需要更新 openclaw.json 时
都应使用此技能。可防止:
- - 更新不存在的配置键
- 使用无效值
- 因错误配置导致网关故障
工作流程:原子化应用(默认)
适用于所有配置变更——通过一条命令处理所有操作:
bash
./scripts/atomic_apply.sh <配置路径> <新值>
示例:./scripts/atomic_apply.sh agents.defaults.model.primary minimax-portal/MiniMax-M2.5
功能说明:
- 1. 自动创建带时间戳的备份
- 通过 openclaw config set <路径> <值> 应用变更
- 使用 openclaw doctor --non-interactive 进行验证
- 验证失败时自动回滚
- 陷阱机制确保即使崩溃也能回滚
备份位置:
~/.openclaw/config-guardian-backups/
防护措施
- - 未经用户明确批准,切勿重启或应用配置
- 始终使用 atomic_apply.sh
- 若验证失败 -> 配置自动回滚,请勿强制操作
脚本
| 脚本 | 用途 |
|---|
| atomicapply.sh | 默认——一体化安全应用 |
| validateconfig.sh |
通过OpenClaw诊断进行验证 |
| restore_config.sh | 从备份手动恢复 |