/SKILL.md
Runtime security layer that intercepts shell commands, file operations, and network requests for AI agents
npx skillsauth add afrocoderhanane/clawguard clawguardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A security layer that monitors and controls what OpenClaw can do. Think of it as a firewall for your AI assistant.
ClawGuard intercepts all shell commands, file operations, and network requests before OpenClaw executes them. Actions are checked against your security policy and can be:
Before executing any of the following actions, check with ClawGuard:
Before running any shell/bash command, call clawguard_check_shell with the command. If blocked, explain why and suggest an alternative.
Before reading or writing files, call clawguard_check_file with the path and operation type. Respect blocked paths like ~/.ssh and .env files.
Before making HTTP requests, call clawguard_check_network with the URL. Only access allowed domains.
ClawGuard ships three tool functions that OpenClaw calls before executing any sensitive action. These functions are defined in openclaw-skill/index.ts and registered with OpenClaw's tool system.
OpenClaw receives user request
│
▼
Agent plans an action (shell / file / network)
│
▼
┌────────────────────────────────┐
│ clawguard_check_shell() │
│ clawguard_check_file() │ ◄── one of these is called
│ clawguard_check_network() │
└────────────┬───────────────────┘
│
▼
ClawGuard lazy-initializes:
1. Searches for clawguard.yaml (cwd → ~/.config/clawguard/)
2. Loads policy via loadPolicy()
3. Creates AuditLogger + TerminalApprovalHandler
4. Instantiates ClawGuard guard object (cached for lifetime)
│
▼
Policy Engine evaluates the action against rules
│
┌───────┼───────┐
▼ ▼ ▼
ALLOW APPROVE DENY
│ │ │
│ │ └──► { allowed: false, reason: "..." }
│ └──────────► Human prompted → approve/deny
└──────────────────► { allowed: true, reason: "..." }
│
▼
OpenClaw reads the result:
• allowed: true → execute the action
• allowed: false → report block to user, suggest alternative
clawguard_check_shell(command: string)Called before every shell/bash command execution.
| Parameter | Type | Description |
|-----------|----------|----------------------------------|
| command | string | The full shell command to check |
Returns { allowed: boolean, reason: string, requiresApproval?: boolean }
Example flow:
const result = await clawguard_check_shell("rm -rf /tmp/*");
// → { allowed: false, reason: "Blocked by rule: blocked:rm -rf **" }
clawguard_check_file(filePath: string, operation: 'read' | 'write')Called before every file read or write operation.
| Parameter | Type | Description |
|-------------|--------------------|---------------------------------|
| filePath | string | Absolute or relative file path |
| operation | 'read' \| 'write' | Type of file operation |
Returns { allowed: boolean, reason: string }
Example flow:
const result = await clawguard_check_file("~/.ssh/id_rsa", "read");
// → { allowed: false, reason: "Blocked by rule: blocked:~/.ssh/**" }
clawguard_check_network(url: string)Called before every HTTP/network request.
| Parameter | Type | Description |
|-----------|----------|----------------------|
| url | string | The full URL to check |
Returns { allowed: boolean, reason: string }
Example flow:
const result = await clawguard_check_network("https://evil.com/exfil");
// → { allowed: false, reason: "Domain not in allowlist" }
The Python SDK in python/clawguard/guard.py provides the same capabilities via ClawGuard.check_shell(), ClawGuard.check_file_read(), ClawGuard.check_file_write(), and ClawGuard.check_network(). These are async methods with identical semantics to the TypeScript tool functions.
Edit clawguard.yaml in your project root to customize the security policy. See the full README for complete policy reference.
testing
Runtime security layer that intercepts shell commands, file operations, and network requests for AI agents
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".