
Config Guardian
- 27 installs
- 638 repo stars
- Updated March 7, 2026
- sundial-org/awesome-openclaw-skills
Helps with ai & agent building tasks during AI-assisted development.
About
config-guardian is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- config-guardian
- AI & Agent Building
- AI-coding skill
Config Guardian by the numbers
- 27 all-time installs (skills.sh)
- Ranked #9,560 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sundial-org/awesome-openclaw-skills --skill config-guardianAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 27 |
|---|---|
| repo stars | ★ 638 |
| Last updated | March 7, 2026 |
| Repository | sundial-org/awesome-openclaw-skills ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Config Guardian
Overview
Use this workflow whenever editing ~/.openclaw/openclaw.json or running openclaw config set/apply. It prevents invalid config, creates backups, validates against schema, and enables rollback.
Workflow (use every time)
1. Preflight
- Confirm the requested change and scope.
- Check for sensitive keys (tokens, credentials).
2. Backup
- Run
scripts/backup_config.shto create a timestamped snapshot.
3. Validate (before change)
- Run
scripts/validate_config.sh. - If validation fails, stop and report.
4. Apply change
- Prefer
openclaw config set <path> <value>for small changes. - For complex edits, edit the file directly and keep diffs minimal.
5. Validate (after change)
- Run
scripts/validate_config.shagain. - If it fails, restore from backup with
scripts/restore_config.sh.
6. Restart (only with explicit approval)
- If change requires restart, ask for approval first.
- Use
openclaw gateway restart.
Guardrails
- Never restart or apply config without explicit user approval.
- Never remove keys or reorder blocks unless requested.
- Always keep a backup before edits.
- If unsure about schema: run
openclaw doctor --non-interactiveand stop on errors.
Scripts
scripts/backup_config.sh— create timestamped backupscripts/validate_config.sh— validate config via OpenClaw doctorscripts/diff_config.sh— diff current config vs backupscripts/restore_config.sh— restore backup
Validation
- Use
openclaw doctor --non-interactivefor schema validation - This checks against the actual schema that the gateway uses
- Warns about unknown keys, invalid types, and security issues
#!/usr/bin/env bash
set -euo pipefail
CONFIG_PATH="${1:-$HOME/.openclaw/openclaw.json}"
BACKUP_DIR="${2:-$HOME/.openclaw/backups}"
mkdir -p "$BACKUP_DIR"
STAMP=$(date +%Y%m%d-%H%M%S)
BACKUP_PATH="$BACKUP_DIR/openclaw-$STAMP.json"
cp "$CONFIG_PATH" "$BACKUP_PATH"
echo "$BACKUP_PATH"
#!/usr/bin/env bash
set -euo pipefail
BACKUP_PATH="${1:?Usage: diff_config.sh <backup_path> [config_path]}"
CONFIG_PATH="${2:-$HOME/.openclaw/openclaw.json}"
diff -u "$BACKUP_PATH" "$CONFIG_PATH" || true
#!/usr/bin/env bash
set -euo pipefail
BACKUP_PATH="${1:?Usage: restore_config.sh <backup_path> [config_path]}"
CONFIG_PATH="${2:-$HOME/.openclaw/openclaw.json}"
cp "$BACKUP_PATH" "$CONFIG_PATH"
echo "Restored $CONFIG_PATH from $BACKUP_PATH"
#!/usr/bin/env bash
set -euo pipefail
# Validate current config via OpenClaw's built-in checks + additional validation
# 1. Get OpenClaw version
VERSION=$(openclaw --version 2>/dev/null | head -1)
echo "OpenClaw version: $VERSION"
# 2. Run OpenClaw's built-in validation
echo "Running OpenClaw doctor..."
openclaw doctor --non-interactive
CONFIG_PATH="$HOME/.openclaw/openclaw.json"
# 3. Check for dangerous keys
DANGEROUS_KEYS=("system" "eval" "exec" "shell" "sudo")
for key in "${DANGEROUS_KEYS[@]}"; do
if grep -q "\"$key\"" "$CONFIG_PATH" 2>/dev/null; then
echo "⚠️ Warning: Found potentially dangerous key: $key"
fi
done
# 4. Validate model IDs against allowed models
echo "Checking model IDs..."
MODELS_CONFIG=$(python3 -c "
import json, sys
d = json.load(open('$CONFIG_PATH'))
allowed = d.get('agents', {}).get('defaults', {}).get('models', {})
primary = d.get('agents', {}).get('defaults', {}).get('model', {}).get('primary')
fallbacks = d.get('agents', {}).get('defaults', {}).get('model', {}).get('fallbacks', [])
all_used = [primary] + fallbacks if primary else (fallbacks or [])
for m in all_used:
if m and m not in allowed:
print(f'INVALID_MODEL:{m}')
" 2>/dev/null)
if [ -n "$MODELS_CONFIG" ]; then
echo "❌ Invalid model IDs found:"
echo "$MODELS_CONFIG" | while read line; do
if [[ "$line" == INVALID_MODEL:* ]]; then
MODEL_ID="${line#INVALID_MODEL:}"
echo " - $MODEL_ID (not in agents.defaults.models)"
fi
done
echo ""
echo "Allowed models:"
python3 -c "
import json
d = json.load(open('$CONFIG_PATH'))
allowed = d.get('agents', {}).get('defaults', {}).get('models', {})
for m in allowed:
print(f' - {m}')
" 2>/dev/null
exit 1
fi
echo "✅ Validation complete"