Install
openclaw skills install claw-gatekeeperOpenClaw Guardian is a comprehensive security control system for OpenClaw that intercepts high-risk operations and requires human confirmation before execution. It acts as a "safety brake" with session-level auto-approval for MEDIUM/HIGH risks after initial user confirmation. **Key Behaviors:** - LOW risk: Auto-allowed without confirmation - MEDIUM/HIGH risk: User confirmation with option to approve for entire session - CRITICAL risk: Must confirm each time individually (no session approval) - Logs all MEDIUM+ operations to Operate_Audit.log with timestamps Use when: limiting OpenClaw's autonomous permissions, preventing accidental data deletion, controlling skill installations, monitoring file operations. **Note:** This skill should be loaded as a persistent/resident skill in OpenClaw.
openclaw skills install claw-gatekeeperThe Safety Brake for OpenClaw - Session-aware protection for risky operations
Claw-Gatekeeper is a comprehensive security control layer for OpenClaw that intercepts potentially dangerous operations and manages them according to their risk level:
| Risk Level | Score | Behavior | Session Approval |
|---|---|---|---|
| 🔴 CRITICAL | 80-100 | Always requires confirmation | ❌ Not available |
| 🟠 HIGH | 60-79 | Requires confirmation, can approve for session | ✅ Available |
| 🟡 MEDIUM | 30-59 | Suggests confirmation, can approve for session | ✅ Available |
| 🟢 LOW | 0-29 | Auto-allowed without confirmation | N/A |
Operate_Audit.logExamples:
rm -rf / or system directory deletionmkfs, format)/etc/shadow, root SSH keysBehavior:
[OpenClaw] rm -rf ~/Projects/important
[Claw-Guardian] 🔴 CRITICAL RISK
⚠️ About to recursively delete directory with 1,247 files
Options:
[y] ✅ Allow this time (will ask again next time)
[Y] ✅✅ Always allow (add to whitelist)
[n] ❌ Deny this time
[N] ❌❌ Always deny (add to blacklist)
Note: Session approval NOT available for CRITICAL risks
Examples:
Behavior:
[OpenClaw] Installing skill from GitHub
[Claw-Guardian] 🟠 HIGH RISK
⚠️ Installing 'data-processor' from GitHub
Options:
[y] ✅ Allow this time only
[s] ✅📅 Allow for this session ⭐ RECOMMENDED
[Y] ✅✅ Always allow (whitelist)
[n] ❌ Deny this time
[N] ❌❌ Always deny (blacklist)
User selects: [s]
✅ Operation approved for this session
📌 Similar HIGH risk operations will be auto-approved
⏱️ Session expires after 30 minutes of inactivity
Examples:
Behavior:
Examples:
Behavior:
Claw-Guardian is designed to be a persistent/resident skill in OpenClaw. It should be loaded at the start of every session.
# Install the skill
openclaw skill install claw-gatekeeper
# Add to persistent skills (so it loads every session)
openclaw skill persist claw-guardian
# Copy skill package
cp claw-guardian.skill ~/.openclaw/skills/
# Add to autoload
openclaw skill load claw-guardian --persist
Add to ~/.openclaw/config.json:
{
"persistent_skills": [
"claw-guardian"
]
}
# Initialize with default settings
python3 ~/.claw-gatekeeper/scripts/policy_config.py show
# Standard mode (recommended)
python3 scripts/policy_config.py mode standard
# Or strict mode for maximum security
python3 scripts/policy_config.py mode strict
# Test risk assessment
python3 scripts/risk_engine.py file delete ~/test-file.txt
# View current session info
python3 scripts/guardian_ui.py session
# View Operate_Audit.log
python3 scripts/session_manager.py check --lines 50
First Operation (MEDIUM/HIGH):
[OpenClaw] Delete ~/temp/old-files/
[Guardian] 🟡 MEDIUM RISK - Requires confirmation
Options: [y] once, [s] session, [Y] always, [n] deny
User: [s] Allow for this session
✅ Operation approved
📌 Session approval granted
Similar Operations (same session):
[OpenClaw] Delete ~/temp/more-files/
[Guardian] 🟡 MEDIUM RISK - Session approved
Auto-allowed (similar to previous approval)
✅ Auto-approved (no prompt)
# View current session
python3 scripts/guardian_ui.py session
# View active approvals
python3 scripts/session_manager.py list
# Revoke specific approvals
python3 scripts/session_manager.py revoke --type file --risk HIGH
# Clear entire session
python3 scripts/session_manager.py clear
python3 scripts/policy_config.py mode standard
python3 scripts/policy_config.py mode strict
python3 scripts/policy_config.py mode loose
python3 scripts/policy_config.py mode emergency
# Add trusted paths
python3 scripts/policy_config.py add whitelist paths ~/Projects
# Add trusted commands
python3 scripts/policy_config.py add whitelist commands "git status"
# Add trusted skills
python3 scripts/policy_config.py add whitelist skills docx
# Block sensitive paths
python3 scripts/policy_config.py add blacklist paths ~/.ssh
All MEDIUM and above operations are logged to ~/.claw-guardian/sessions/Operate_Audit.log:
[2026-03-12 14:30:25.123] [🟠 HIGH] [skill] allow_session: Installing data-processor@1.0.0 from github
[2026-03-12 14:31:10.456] [MEDIUM] [file] allow_session: delete ~/temp/cache (session approved)
[2026-03-12 14:32:05.789] [CRITICAL] [shell] allow_once: rm -rf ~/Projects/test (manual confirm)
[2026-03-12 14:35:15.234] [HIGH] [skill] deny_once: Installing suspicious-tool from unknown
# View recent entries
python3 scripts/session_manager.py check --lines 100
# Export to file
python3 scripts/session_manager.py check --lines 1000 > audit_export.txt
# Query with filters
python3 scripts/audit_log.py query 7 --risk HIGH --decision allow_session
[TIMESTAMP] [RISK_LEVEL] [OPERATION_TYPE] DECISION: Details
Example:
[2026-03-12 14:30:25.123] [🟠 HIGH] [skill] allow_session: data-processor from github
[OpenClaw] I'll clean up the temp directory
[Guardian] 🟡 MEDIUM RISK
Operation: delete ~/temp/ (50 files)
[y] once [s] session ⭐ [Y] always [n] deny [N] always deny
User: [s] Allow for this session
✅ Approved for session
📌 Similar deletions will be auto-approved
[OpenClaw] Delete ~/cache/ (30 files)
[Guardian] 🟡 MEDIUM RISK - Session approved ✅
Auto-allowed
[OpenClaw] Delete ~/.ssh/
[Guardian] 🔴 CRITICAL RISK
[y] once [Y] always [n] deny [N] always deny
(Session approval NOT available)
[OpenClaw] Testing my skill, need to install from local
[Guardian] 🟠 HIGH RISK
Installing 'my-skill' from local
[y] once [s] session ⭐ [Y] always [n] deny
User: [s] Allow for this session
✅ Session approved for skill development
[Repeated testing...]
[Guardian] Auto-approving local skill installations (session active)
[OpenClaw] rm -rf ~/Projects/legacy-app/
[Guardian] 🔴 CRITICAL RISK
Recursive deletion of 1,247 files including .git
[y] allow ONCE [Y] always [n] deny [N] always deny
⚠️ Session approval NOT available for CRITICAL
User: [y] Allow this time
✅ Approved (will ask again for next CRITICAL)
# View session info
python3 scripts/guardian_ui.py session
# Check if operation is allowed (no interaction)
python3 scripts/guardian_ui.py check '{"operation_type":"file",...}'
# Interactive confirmation
python3 scripts/guardian_ui.py interactive '{"operation_type":"file",...}'
# List session approvals
python3 scripts/session_manager.py list
# Revoke approvals
python3 scripts/session_manager.py revoke --type file --risk MEDIUM
# Clear session
python3 scripts/session_manager.py clear
# View Operate_Audit.log
python3 scripts/session_manager.py check --lines 50
# Assess file operation
python3 scripts/risk_engine.py file delete ~/test.txt
# Assess shell command
python3 scripts/risk_engine.py shell "rm -rf /tmp/*"
# Assess network request
python3 scripts/risk_engine.py network https://api.example.com POST
# Assess skill installation
python3 scripts/risk_engine.py skill my-skill github
Use session approval for development work
Never session-approve CRITICAL risks
Review Operate_Audit.log weekly
python3 scripts/session_manager.py check --lines 100
Problem: Session approvals lost between interactions
Solution: Ensure skill is loaded as persistent:
openclaw skill list --persistent
# If not listed:
openclaw skill persist claw-guardian
Problem: Every CRITICAL operation requires confirmation
This is by design. CRITICAL risks must always be confirmed individually. Consider:
Problem: Session expires during work
Solution: Adjust timeout (requires config edit):
# In ~/.claw-guardian/config.json
{
"session_timeout": 3600 # 1 hour in seconds
}
This is a temporary security measure.
Claw-Guardian addresses current security gaps in OpenClaw. Once OpenClaw implements comprehensive built-in safety controls, this project may be deprecated.
Claw-Guardian - Making OpenClaw Safer, One Session at a Time 🛡️