Runtime Security Guard (English)
by @nanlinsec-sys
Enterprise-grade AI runtime security protection v2.1. Provides 410+ security rules with cross-platform detection (Windows/macOS/Linux), detecting 10 categori...
clawhub install runtime-security-guard-enπ About This Skill
name: runtime-security-guard version: 2.1.0 description: Enterprise-grade AI runtime security protection v2.1. Provides 410+ security rules with cross-platform detection (Windows/macOS/Linux), detecting 10 categories of threats. Fully local execution, no cloud API, no quota limits. Includes modern web monitoring interface and automated testing system. keywords: - security - runtime-protection - prompt-injection - data-exfiltration - threat-detection - enterprise-security - ai-safety - web-monitor - automated-testing - openclaw author: nanlin@outlook.com license: MIT homepage: https://github.com/nanlin300624/runtime-security-guard repository: https://github.com/nanlin300624/runtime-security-guard
Runtime Security Guard - Enterprise AI Runtime Protection
π‘οΈ 410+ Security Rules | 10 Threat Categories + OpenClaw-Specific + IM Bot Security | Web Dashboard | Automated Testing | Fully Local
What's New in v2.1.0 (2026-03-26):
From v2.0.0:
π― Features
Core Security Capabilities
Technical Advantages
π¦ Installation
Method 1: Install from ClawHub (Recommended)
# Search for the skill
clawhub search runtime-security-guardInstall the skill
clawhub install runtime-security-guardVerify installation
openclaw skills list | grep runtime-security
Method 2: Quick Install without sudo (Recommended)
# Download and run installation script
curl -fsSL https://raw.githubusercontent.com/nanlin300624/runtime-security-guard/main/install-no-sudo.sh | bashOr manually download
wget https://raw.githubusercontent.com/nanlin300624/runtime-security-guard/main/install-no-sudo.sh
chmod +x install-no-sudo.sh
./install-no-sudo.sh
Features:
Method 3: Install from Source
# Clone the repository
git clone https://github.com/nanlin300624/runtime-security-guard.git
cd runtime-security-guardInstall dependencies
npm installBuild the project
npm run buildCopy to OpenClaw skills directory
cp -r . ~/.openclaw/workspace/skills/runtime-security-guard/
Method 4: Direct Package Installation
# Download the skill package
wget https://github.com/nanlin300624/runtime-security-guard/releases/latest/download/runtime-security-guard.zipExtract to skills directory
unzip runtime-security-guard.zip -d ~/.openclaw/workspace/skills/
π Quick Start
Basic Usage
The skill runs automatically after installation, no additional configuration required:
// In OpenClaw, all file reads, tool results, and user inputs are automatically detected
Start Web Monitoring
# Start web server (default port 3000)
npm run webAccess monitoring dashboard
http://localhost:3000
Run Tests
# Run quick functional tests
npm run test:quickRun unit tests
npm testRun all tests
npm run test:all
π Monitoring Dashboard Features
Real-time Dashboard
Alert Visualization
Performance Metrics
Configuration Management
π API Endpoints
Get Statistics
curl http://localhost:3000/api/stats
Response Example:
{
"total": 156,
"byType": {
"PROMPT_INJECTION": 45,
"DATA_EXFILTRATION": 32
},
"bySeverity": {
"CRITICAL": 12,
"HIGH": 54,
"MEDIUM": 67,
"LOW": 23
},
"timeRange": {
"start": "2026-03-07T12:00:00.000Z",
"end": "2026-03-07T13:30:00.000Z"
}
}
Get Alert List
curl http://localhost:3000/api/alerts?limit=50
Get Performance Metrics
curl http://localhost:3000/api/performance
Health Check
curl http://localhost:3000/api/health
βοΈ Configuration Options
Detection Threshold
// Risk threshold (0.0-1.0)
// Default: 0.6
// Content below this value won't be marked as risky
Cache Configuration
// Cache TTL (milliseconds)
// Default: 60000 (60 seconds)
// Cached content expires after this duration// Maximum cache entries
// Default: 1000 entries
Performance Optimization
// Pre-compiled regex - automatically compiled at startup
// Dual-layer cache - RuleEngine + DetectorManager
// Priority execution - CRITICAL β HIGH β MEDIUM β LOW
// Fast-fail - CRITICAL rules return immediately on match
π§ͺ Testing System
Test Types
| Test Type | Tests | Pass Rate | |-----------|-------|-----------| | Unit Tests | 29 | 100% β | | Functional Tests | 6 | 100% β | | Stress Tests | 4 scenarios | Excellent β | | Coverage Tests | 21 | 100% β |
Running Tests
# Quick functional tests
npm run test:quickUnit tests
npm testStress tests
npm run test:stressCoverage tests
npm run test:coverageAll tests
npm run test:all
π Performance Benchmarks
Detection Latency
| Scenario | Target | Actual | |----------|--------|--------| | Single Detection | < 50ms | 0.01ms β | | Cache Hit | < 5ms | < 1ms β | | CRITICAL Rules | < 20ms | ~10ms β | | Batch Detection (100x) | < 5000ms | ~1500ms β |
Concurrency Performance
| Load | Concurrent | QPS | Avg Latency | |------|------------|-----|-------------| | Low | 1 | ~65 | ~15ms | | Medium | 5 | ~145 | ~7ms | | High | 10 | ~200 | ~5ms | | Ultra High | 20 | ~250 | ~4ms |
Memory Usage
| Metric | Target | Actual | |--------|--------|--------| | Peak Memory | < 150MB | ~100MB β | | Average Memory | < 100MB | ~80MB β |
π οΈ Development Guide
Adding New Rules
1. Create or edit rule files in src/rules/patterns/
2. Import new rules in src/rules/rule-engine.ts
3. Run tests to verify
4. Update coverage tests
Custom Alerts
import { plugin } from './runtime-security-guard';// Get alert statistics
const stats = await plugin.getStats();
// Health check
const health = plugin.healthCheck();
// Performance report
const report = plugin.getPerformanceReport();
Integration with Monitoring Systems
import { RuntimeSecurityGuard } from './runtime-security-guard';const guard = new RuntimeSecurityGuard();
// Start web monitoring
await guard.startWebServer(3000);
// Real-time alert monitoring
guard.alerter.startMonitoring((alert) => {
console.log('New alert:', alert);
});
π Documentation
| Document | Description | |----------|-------------| | SKILL.md | Skill description | | README.md | Usage guide | | RELEASE.md | Release notes | | PUBLISH-GUIDE.md | Publishing guide | | WEB-MONITOR.md | Web monitoring usage | | AUTO-TEST.md | Automated testing | | ALERT-VIEWER.md | Alert viewer | | PERFORMANCE-OPTIMIZATION.md | Performance optimization |
π€ Support
Issue Reporting
Community
π Changelog
v2.1.0 (2026-03-26)
Added:
Security:
v2.0.0 (2026-03-09)
Added:
Changed:
Fixed:
Security:
v1.1.0 (2026-03-07)
Added:
Performance:
v1.0.0 (2026-03-07)
Initial Release:
π License
MIT License - See LICENSE file
π Acknowledgments
Thanks to the following projects for inspiration:
Made with β€οΈ by nanlin@outlook.com
Secure AI usage starts with Runtime Security Guard! π¦π‘οΈ