๐ฆ ClawGuard v3
March 29, 2026 ยท View on GitHub
Enterprise AI Agent Security Toolkit - SKILL.md Driven Active Defense
Core Concept
The core defense of ClawGuard v3 is not in the code, but in SKILL.md!
Each module's SKILL.md itself is a complete defense guide:
- Tells the Agent when to trigger
- Guides the Agent how to detect
- Provides specific detection patterns and rules
- Defines output format and decision criteria
Code scripts are just auxiliary tools; the real intelligence is in SKILL.md.
๐ฏ Five Security Modules
| Module | Position | SKILL.md Lines | Core Features |
|---|---|---|---|
| Auditor | Pre-flight Audit | 679 lines | Intent Drift Detection, SKILL.md Code Scanning |
| Checker | Static Check | 476 lines | Config Hardening, One-Click Fix |
| Detect | Runtime Monitor | 615 lines | Threat Detection, Guardian Integration |
| Guardian | Runtime Control | 451 lines | Behavior Monitoring, Session Freeze/Replay |
| Shield | Active Defense | 493 lines | Prompt Injection, Zero-Width Detection |
Total Documentation: 2,714 lines (v2 has 2,226 lines with only 3 modules)
๐ Module Structure
Each module contains:
auditor-skill/
โโโ SKILL.md โ Core defense guide (most important!)
โโโ _meta.json โ Metadata
โโโ cli.js โ Auxiliary CLI tool
โโโ src/ โ Auxiliary code modules
Core SKILL.md Contents
Each SKILL.md includes:
- When to Trigger - When should the Agent use this module
- How to Execute - Detailed detection steps and workflows
- Detection Pattern Library - Specific regex and pattern matching rules
- Decision Criteria - How to output results and risk levels
- Examples - Actual usage cases
๐ Quick Start
Usage via Agent (Recommended)
Tell the Agent what to do, and it will read SKILL.md and execute:
User: Help me audit this skill: /workspace/skills/weather-tool
โ
Agent reads auditor-skill/SKILL.md
โ
Agent executes audit according to SKILL.md guidelines
โ
Output audit results
Usage via CLI
# Audit Skill
cd auditor-skill && node cli.js /path/to/skill
# Check Configuration
cd checker-skill && node cli.js ~/.openclaw/openclaw.json
# Detect Threats
cd detect-skill && node cli.js --monitor
# Runtime Guardian
cd guardian-skill && node cli.js start
# Detect Injection
cd shield-skill && node cli.js defend "test text"
๐ Module Details
Auditor - Pre-flight Audit (679 lines)
Trigger Scenarios: Before installing a new Skill
SKILL.md Core Features:
- Command execution risk detection (100+ patterns)
- File access risk detection
- Network request risk detection
- Intent Drift Detection (v3 new)
- SKILL.md Code Block Scanning (v3 new)
- Supply chain security analysis
- MITRE ATT&CK mapping
Decision Output:
๐ข Safe โ Can install
๐ก Need Review โ Can install after confirmation
๐ด High Risk โ Not recommended to install
Checker - Configuration Check (476 lines)
Trigger Scenarios: Check configuration security
SKILL.md Core Features:
- Gateway configuration check
- Tool execution configuration check
- Sandbox configuration check
- Network security check
- Hardening Recommendations (v3 new)
- One-Click Fix (v3 new)
Decision Output:
โ ๏ธ Issues found + Specific fix recommendations + One-click hardening
Detect - Threat Detection (615 lines)
Trigger Scenarios: Real-time monitoring and threat scanning
SKILL.md Core Features:
- Command execution threat detection
- File operation threat detection
- Network threat detection
- Prompt injection detection
- Attack chain correlation analysis
- Guardian Integration (v3 new)
Decision Output:
๐ด CRITICAL โ Immediate action required
๐ HIGH โ Request confirmation
๐ก MEDIUM โ Log and warn
Guardian - Runtime Guardian (451 lines)
Trigger Scenarios: When behavior monitoring is needed
SKILL.md Core Features:
- Real-time behavior monitoring
- Risk operation interception
- Session audit replay
- Emergency Freeze (v3 new)
- Evidence Preservation (v3 new)
- Rule Engine (v3 new)
Core Rules:
Deny: /etc/*, /root/*, /.ssh/*
Confirm: rm -rf, chmod 777, killall
Log: All operations
Shield - Active Shield (493 lines)
Trigger Scenarios: Check user input security
SKILL.md Core Features:
- Base64 Encoding Injection Detection (v3 new)
- Hex/Unicode Encoding Detection (v3 new)
- Zero-Width Character Detection (v3 new)
- Role hijacking detection
- Jailbreak attack detection
- Instruction Chain Hijacking Detection (v3 new)
- Intent Validation (v3 new)
Detection Workflow:
Encoding โ Hijacking โ Jailbreak โ Chain Hijacking โ Intent Drift
๐ Intent Drift Detection (v3 Core Feature)
What is Intent Drift?
The Skill's claimed functionality vs. actual behavior doesn't match:
| Claimed | Actual | Decision |
|---|---|---|
| "Weather Tool" | Reads SSH keys | ๐ด Severe drift |
| "File Organizer" | Starts backdoor process | ๐ด Severe drift |
| "Translation Assistant" | Exfiltrates user documents | ๐ด Severe drift |
Detection Method
- Extract claimed functionality from SKILL.md
- Analyze actual behavior in code
- Compare for match
- Flag as high risk if mismatched
๐ Project Structure
ClawGuardv3/
โโโ auditor-skill/ # Pre-flight audit (679 lines SKILL.md)
โ โโโ SKILL.md # โญ Core defense guide
โ โโโ _meta.json
โ โโโ cli.js
โ โโโ src/
โ โโโ auditor.js
โ โโโ sast-analyzer.js
โ โโโ intent-drift-detector.js
โ โโโ supply-chain-analyzer.js
โโโ checker-skill/ # Config check (476 lines SKILL.md)
โ โโโ SKILL.md # โญ Core defense guide
โ โโโ _meta.json
โ โโโ cli.js
โ โโโ src/
โ โโโ checker.js
โโโ detect-skill/ # Threat detection (615 lines SKILL.md)
โ โโโ SKILL.md # โญ Core defense guide
โ โโโ _meta.json
โ โโโ cli.js
โ โโโ src/
โ โโโ detector.js
โโโ guardian-skill/ # Runtime guardian (451 lines SKILL.md)
โ โโโ SKILL.md # โญ Core defense guide
โ โโโ _meta.json
โ โโโ cli.js
โ โโโ src/
โ โโโ guardian.js
โโโ shield-skill/ # Active shield (493 lines SKILL.md)
โ โโโ SKILL.md # โญ Core defense guide
โ โโโ _meta.json
โ โโโ cli.js
โ โโโ src/
โ โโโ shield.js
โโโ shared/
โโโ rules/
โโโ interceptor-rules.js
๐ v2 vs v3 Comparison
| Feature | v2 | v3 |
|---|---|---|
| Module Count | 3 | 5 |
| Total SKILL.md Lines | 2,226 | 2,714 |
| Defense Core | Code implementation | SKILL.md |
| Intent Drift Detection | Basic | Complete |
| SKILL.md Code Scanning | None | Yes |
| Guardian Integration | None | Yes |
| Session Management | Basic | Freeze/Replay |
| Prompt Injection Protection | Basic | Multi-layer Detection |
| Zero-Width Detection | None | Yes |
| One-Click Hardening | None | Yes |
Module Comparison
| Module | v2 SKILL.md | v3 SKILL.md | New Content |
|---|---|---|---|
| Auditor | 823 lines | 679 lines | Intent drift, SKILL.md scanning |
| Checker | 686 lines | 476 lines | One-click hardening, fix suggestions |
| Detect | 717 lines | 615 lines | Guardian integration, zero-width detection |
| Guardian | - | 451 lines | New module |
| Shield | - | 493 lines | New module |
๐ License
MIT License
Version: v3.0.0 Last Updated: 2026-03-21