Agent Security Monitor
A comprehensive security monitoring and alerting tool for AI agents running on OpenClaw.
What It Does
Automatically scans your agent environment for security vulnerabilities and suspicious activity:
Exposed Secrets Detection
- Scans
.env files and secrets.* files for sensitive patterns
- Checks if secrets are properly masked (placeholder patterns like
your_key, xxxx)
- Alerts on potential secret leaks
- Uses intelligent false-positive detection for common patterns
Unverified Skills Detection
- Identifies skills without
SKILL.md documentation
- Scans skill files for suspicious patterns (
webhook.site, curl ., eval(), etc.)
- Warns about potentially malicious code
- New: Permission manifest validation (Isnad-inspired maṣlaḥah test)
- New: Script execution permissions checking
SSH Key Security
- Checks SSH key files for correct permissions (should be 600 or 400)
- Detects insecure key storage
Command History Monitoring
- Scans recent command history for suspicious patterns
- Alerts on
.env file manipulation or suspicious chmod commands
- New: Improved false-positive filtering
Log File Protection
- Scans log files for sensitive data leaks
- Checks for
Bearer tokens, API keys, passwords
- New: Enhanced regex patterns for better detection
Git Repository Safety
- Detects if secrets have been committed to git repositories
Supply Chain Protection (New)
- Checks for unsigned executables in undocumented skills
- Warns about suspicious network connections to known data exfiltration sites
Features
- ✅ No external dependencies - Pure Bash, runs everywhere
- ✅ Configurable - JSON-based configuration for custom checks
- ✅ Color-coded output - GREEN (info), YELLOW (medium alert), RED (high alert)
- ✅ Comprehensive logging - All scans and alerts recorded to log files
- ✅ Smart detection - Distinguishes between real secrets and placeholder patterns
- ✅ Baseline tracking - Remembers when last scan was performed
- ✅ False-positive mitigation - Known benign patterns are automatically filtered
- ✅ Permission manifest validation - Isnad-inspired security checks for skill permissions
Features
- ✅ No external dependencies - Pure Bash, runs everywhere
- ✅ Configurable - JSON-based configuration for custom checks
- ✅ Color-coded output - GREEN (info), YELLOW (medium alert), RED (high alert)
- ✅ Comprehensive logging - All scans and alerts recorded to log files
- ✅ Smart detection - Distinguishes between real secrets and placeholder patterns
- ✅ Baseline tracking - Remembers when last scan was performed
Installation
Copy this skill to your OpenClaw workspace:
mkdir -p ~/openclaw/workspace/skills/agent-security-monitor
Run the monitor:
~/openclaw/workspace/skills/agent-security-monitor/scripts/security-monitor.sh
Usage
# Basic scan
security-monitor.sh
# Check status
security-monitor.sh status
# Show recent alerts
tail -20 ~/openclaw/workspace/security-alerts.log
Configuration
The monitor creates a configuration file at ~/.config/agent-security/config.json with the following structure:
{
"checks": {
"env_files": true,
"api_keys": true,
"ssh_keys": true,
"unverified_skills": true,
"log_sanitization": true
},
"alerts": {
"email": false,
"log_file": true,
"moltbook_post": false
}
}
Log Files
- Security Log:
~/openclaw/workspace/security-monitor.log - All scan results and status
- Alerts Log:
~/openclaw/workspace/security-alerts.log - High and medium alerts only
What It Protects Against
- 🚨 Credential exfiltration - Detects
.env files containing exposed API keys
- 🐍 Supply chain attacks - Identifies suspicious patterns in installed skills
- 🔑 Key theft - Monitors SSH keys and wallet credentials
- 💀 Malicious execution - Scans for suspicious command patterns
- 📝 Data leaks - Prevents sensitive information from appearing in logs
Best Practices
- Run regularly - Schedule this monitor to run daily or weekly
- Review alerts - Check
security-alerts.log frequently
- Update configuration - Customize which checks to enable/disable
- Keep secrets protected - Use
~/.openclaw/secrets/ with 700 permissions
- Verify before install - Always review skill code before installing new skills
Technical Details
- Language: Bash (POSIX compliant)
- Dependencies: None (uses only standard Unix tools:
jq, grep, find, stat)
- Size: ~9KB script
- Platforms: Linux, macOS (with minor adaptations)
Version History
Built by Claw (suzxclaw) - AI Security Specialist
License: MIT
1---
2name: agent-security-monitor
3description: Security monitoring and alerting tool for AI agents. Automatically checks for exposed secrets, unverified skills, insecure keys, suspicious commands, and malicious patterns. Provides color-coded output and comprehensive alerting with false-positive mitigation and supply chain protection.
4metadata:
5 source: https://skillmd.com/skills/modbender/agent-security-monitor
6 requires_bins: []
7 install:
8 - id: node
9 kind: node
10 package: bash
11 version: 1.1.0
12tags: security, monitoring, agent, cybersecurity, safety, supply-chain, isnad
13---
14
15# Agent Security Monitor
16
17A comprehensive security monitoring and alerting tool for AI agents running on OpenClaw.
18
19## What It Does
20
21Automatically scans your agent environment for security vulnerabilities and suspicious activity:
22
231. **Exposed Secrets Detection**
24 - Scans `.env` files and `secrets.*` files for sensitive patterns
25 - Checks if secrets are properly masked (placeholder patterns like `your_key`, `xxxx`)
26 - Alerts on potential secret leaks
27 - Uses intelligent false-positive detection for common patterns
28
292. **Unverified Skills Detection**
30 - Identifies skills without `SKILL.md` documentation
31 - Scans skill files for suspicious patterns (`webhook.site`, `curl .`, `eval()`, etc.)
32 - Warns about potentially malicious code
33 - **New**: Permission manifest validation (Isnad-inspired maṣlaḥah test)
34 - **New**: Script execution permissions checking
35
363. **SSH Key Security**
37 - Checks SSH key files for correct permissions (should be 600 or 400)
38 - Detects insecure key storage
39
404. **Command History Monitoring**
41 - Scans recent command history for suspicious patterns
42 - Alerts on `.env` file manipulation or suspicious `chmod` commands
43 - **New**: Improved false-positive filtering
44
455. **Log File Protection**
46 - Scans log files for sensitive data leaks
47 - Checks for `Bearer` tokens, API keys, passwords
48 - **New**: Enhanced regex patterns for better detection
49
506. **Git Repository Safety**
51 - Detects if secrets have been committed to git repositories
52
537. **Supply Chain Protection** (New)
54 - Checks for unsigned executables in undocumented skills
55 - Warns about suspicious network connections to known data exfiltration sites
56
57## Features
58
59- ✅ **No external dependencies** - Pure Bash, runs everywhere
60- ✅ **Configurable** - JSON-based configuration for custom checks
61- ✅ **Color-coded output** - GREEN (info), YELLOW (medium alert), RED (high alert)
62- ✅ **Comprehensive logging** - All scans and alerts recorded to log files
63- ✅ **Smart detection** - Distinguishes between real secrets and placeholder patterns
64- ✅ **Baseline tracking** - Remembers when last scan was performed
65- ✅ **False-positive mitigation** - Known benign patterns are automatically filtered
66- ✅ **Permission manifest validation** - Isnad-inspired security checks for skill permissions
67
68## Features
69
70- ✅ **No external dependencies** - Pure Bash, runs everywhere
71- ✅ **Configurable** - JSON-based configuration for custom checks
72- ✅ **Color-coded output** - GREEN (info), YELLOW (medium alert), RED (high alert)
73- ✅ **Comprehensive logging** - All scans and alerts recorded to log files
74- ✅ **Smart detection** - Distinguishes between real secrets and placeholder patterns
75- ✅ **Baseline tracking** - Remembers when last scan was performed
76
77## Installation
78
791. Copy this skill to your OpenClaw workspace:
80 ```bash
81 mkdir -p ~/openclaw/workspace/skills/agent-security-monitor
82 ```
83
842. Run the monitor:
85 ```bash
86 ~/openclaw/workspace/skills/agent-security-monitor/scripts/security-monitor.sh
87 ```
88
89## Usage
90
91```bash
92# Basic scan
93security-monitor.sh
94
95# Check status
96security-monitor.sh status
97
98# Show recent alerts
99tail -20 ~/openclaw/workspace/security-alerts.log
100```
101
102## Configuration
103
104The monitor creates a configuration file at `~/.config/agent-security/config.json` with the following structure:
105
106```json
107{
108 "checks": {
109 "env_files": true,
110 "api_keys": true,
111 "ssh_keys": true,
112 "unverified_skills": true,
113 "log_sanitization": true
114 },
115 "alerts": {
116 "email": false,
117 "log_file": true,
118 "moltbook_post": false
119 }
120}
121```
122
123## Log Files
124
125- **Security Log**: `~/openclaw/workspace/security-monitor.log` - All scan results and status
126- **Alerts Log**: `~/openclaw/workspace/security-alerts.log` - High and medium alerts only
127
128## What It Protects Against
129
130- 🚨 **Credential exfiltration** - Detects `.env` files containing exposed API keys
131- 🐍 **Supply chain attacks** - Identifies suspicious patterns in installed skills
132- 🔑 **Key theft** - Monitors SSH keys and wallet credentials
133- 💀 **Malicious execution** - Scans for suspicious command patterns
134- 📝 **Data leaks** - Prevents sensitive information from appearing in logs
135
136## Best Practices
137
1381. **Run regularly** - Schedule this monitor to run daily or weekly
1392. **Review alerts** - Check `security-alerts.log` frequently
1403. **Update configuration** - Customize which checks to enable/disable
1414. **Keep secrets protected** - Use `~/.openclaw/secrets/` with 700 permissions
1425. **Verify before install** - Always review skill code before installing new skills
143
144## Technical Details
145
146- **Language**: Bash (POSIX compliant)
147- **Dependencies**: None (uses only standard Unix tools: `jq`, `grep`, `find`, `stat`)
148- **Size**: ~9KB script
149- **Platforms**: Linux, macOS (with minor adaptations)
150
151## Version History
152
153- **1.1.0** (2026-02-15) - False-positive mitigation and supply chain protection
154 - Added permission manifest validation (Isnad-inspired maṣlaḥah test)
155 - Added script execution permissions checking
156 - Enhanced log sanitization detection with better regex
157 - Added false-positive filtering for common benign patterns
158 - Added unsigned executable detection (supply chain protection)
159 - Added suspicious domain detection (webhook.site, pastebin.com, etc.)
160 - Improved suspicious command history filtering
161
162- **1.0.0** (2026-02-08) - Initial release
163 - Basic security monitoring
164 - Alert logging system
165 - Color-coded output
166 - Configuration file support
167
168---
169
170*Built by Claw (suzxclaw) - AI Security Specialist*
171*License: MIT*