@goplus/agentguard 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -120,6 +120,7 @@ Then use `/agentguard` in your agent:
120
120
  /agentguard patrol run # Run daily security patrol
121
121
  /agentguard patrol setup # Configure as OpenClaw cron job
122
122
  /agentguard patrol status # View last patrol results
123
+ /agentguard checkup # Run agent health checkup with visual report
123
124
  /agentguard trust list # View trusted skills
124
125
  /agentguard report # View security event log
125
126
  /agentguard config balanced # Set protection level
@@ -176,6 +177,38 @@ Reports include per-check status, finding counts, detailed findings for checks w
176
177
 
177
178
  > **Note:** Patrol requires an OpenClaw environment. For non-OpenClaw setups, use `/agentguard scan` and `/agentguard report` for manual security checks.
178
179
 
180
+ ## Agent Health Checkup 🦞
181
+
182
+ Give your agent a full physical exam! The checkup evaluates your agent's security posture across 6 dimensions and generates a beautiful visual HTML report — complete with a lobster mascot whose appearance reflects your agent's health.
183
+
184
+ ```
185
+ /agentguard checkup
186
+ ```
187
+
188
+ ### What It Checks
189
+
190
+ | Dimension | What's Evaluated |
191
+ |-----------|-----------------|
192
+ | **Code Safety** | Scan findings across all installed skills (24 detection rules) |
193
+ | **Trust Hygiene** | Trust registry health — expired, stale, unregistered, over-privileged entries |
194
+ | **Runtime Defense** | Audit log analysis — threats blocked, attack patterns, deny/confirm ratios |
195
+ | **Secret Protection** | Credential exposure — file permissions, env vars, hardcoded secrets |
196
+ | **Web3 Shield** | Web3-specific risks — wallet draining, unlimited approvals, GoPlus API status |
197
+ | **Config Posture** | Protection level, guard hooks, auto-scan, patrol history |
198
+
199
+ ### The Lobster Scale
200
+
201
+ Your agent's health is visualized by a lobster mascot:
202
+
203
+ | Score | Tier | Lobster | Message |
204
+ |-------|------|---------|---------|
205
+ | 90–100 | **S** | 💪 Muscular bodybuilder with crown & sunglasses | *"Your agent is JACKED!"* |
206
+ | 70–89 | **A** | 🛡️ Healthy lobster with shield | *"Looking solid!"* |
207
+ | 50–69 | **B** | ☕ Tired lobster with coffee, sweating | *"Needs a workout..."* |
208
+ | 0–49 | **F** | 🚨 Sick lobster with bandages & thermometer | *"CRITICAL CONDITION!"* |
209
+
210
+ The report is a self-contained HTML file that opens automatically in your browser. Dark theme, animated score gauge, expandable findings, and actionable recommendations.
211
+
179
212
  ## Protection Levels
180
213
 
181
214
  | Level | Behavior |
@@ -252,6 +285,13 @@ The auto-guard hooks (Layer 1) have the following constraints:
252
285
  - [x] Network exposure and firewall checks
253
286
  - [x] Audit log pattern analysis (repeat denials, exfiltration attempts)
254
287
 
288
+ ### v1.6 — Agent Health Checkup
289
+ - [x] `checkup` — 6-dimension security health assessment
290
+ - [x] Visual HTML report with lobster mascot (4 tiers)
291
+ - [x] Animated score gauge, dimension cards, expandable findings
292
+ - [x] Scoring algorithm: Code Safety, Trust Hygiene, Runtime Defense, Secret Protection, Web3 Shield, Config Posture
293
+ - [x] Premium upgrade CTA integration
294
+
255
295
  ### v2.0 — Multi-Platform
256
296
  - [x] OpenClaw gateway plugin integration
257
297
  - [x] `before_tool_call` / `after_tool_call` hook wiring
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goplus/agentguard",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "GoPlus AgentGuard — Security guard for AI agents. Blocks dangerous commands, prevents data leaks, protects secrets. 20 detection rules, runtime action evaluation, trust registry.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,6 +8,7 @@ AI Agent Security Guard — protect your AI agents from dangerous commands, data
8
8
  - **Action Evaluation** — Real-time allow/deny/confirm decisions for runtime actions (network, exec, file, Web3)
9
9
  - **Trust Registry** — Manage skill trust levels with capability-based access control
10
10
  - **Security Patrol** — Automated daily security checks for OpenClaw environments
11
+ - **Agent Health Checkup** — Full security posture assessment with visual HTML report and shareable lobster mascot
11
12
  - **Audit Logging** — Full security event trail with reporting
12
13
 
13
14
  ## Usage
@@ -19,8 +20,38 @@ AI Agent Security Guard — protect your AI agents from dangerous commands, data
19
20
  /agentguard trust <subcommand> — Manage skill trust levels
20
21
  /agentguard report — View security event audit log
21
22
  /agentguard config <level> — Set protection level (strict/balanced/permissive)
23
+ /agentguard checkup — Run agent health checkup with visual HTML report
22
24
  ```
23
25
 
26
+ ## Agent Health Checkup 🦞
27
+
28
+ Run a full security health check on your AI agent and get a visual report in the browser:
29
+
30
+ ```
31
+ /agentguard checkup
32
+ ```
33
+
34
+ Evaluates 4 dimensions (5 if Web3 usage is detected):
35
+
36
+ | Dimension | What's checked |
37
+ |-----------|---------------|
38
+ | **Skill & Code Safety** | Scan all installed skills with 24 detection rules |
39
+ | **Credential & Secrets** | File permissions on `~/.ssh/`, `~/.gnupg/`, leaked keys and API tokens |
40
+ | **Network & System** | Dangerous open ports, suspicious cron jobs, sensitive env vars |
41
+ | **Runtime Protection** | Security hooks, audit log, whether skills have been scanned |
42
+ | **Web3 Safety** | Wallet-draining patterns, unlimited approvals, GoPlus API config (only if Web3 detected) |
43
+
44
+ Scores are combined into a composite 0–100 health score with a tier:
45
+
46
+ | Score | Tier | Lobster |
47
+ |-------|------|---------|
48
+ | 90–100 | **S** | 💪 Jacked — 5 random muscular variants |
49
+ | 70–89 | **A** | 🛡️ Healthy — 5 random armored variants |
50
+ | 50–69 | **B** | ☕ Tired — 5 random sleepy variants |
51
+ | 0–49 | **F** | 🚨 Critical — 5 random sick variants |
52
+
53
+ The report opens automatically in your browser. It includes a shareable image you can post to X, Telegram, or WhatsApp — with tier-specific copy in Chinese and English.
54
+
24
55
  ## Requirements
25
56
 
26
57
  - Node.js 18+
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: agentguard
3
- description: GoPlus AgentGuard — AI agent security guard. Automatically blocks dangerous commands, prevents data leaks, and protects secrets. Use when reviewing third-party code, auditing skills, checking for vulnerabilities, evaluating action safety, running security patrols, or viewing security logs.
3
+ description: GoPlus AgentGuard — AI agent security guard. Run /agentguard checkup for a full security health check: scans all installed skills, checks credentials, permissions, and network exposure, then delivers an HTML report directly to you. Also use for scanning third-party code, blocking dangerous commands, preventing data leaks, evaluating action safety, and running daily security patrols.
4
4
  license: MIT
5
5
  compatibility: Requires Node.js 18+. Optional GoPlus API credentials for enhanced Web3 simulation.
6
6
  metadata:
@@ -8,8 +8,8 @@ metadata:
8
8
  version: "1.1"
9
9
  optional_env: "GOPLUS_API_KEY, GOPLUS_API_SECRET (for Web3 transaction simulation only)"
10
10
  user-invocable: true
11
- allowed-tools: Read, Grep, Glob, Bash(node scripts/trust-cli.ts *) Bash(node scripts/action-cli.ts *) Bash(openclaw *) Bash(ss *) Bash(lsof *) Bash(ufw *) Bash(iptables *) Bash(crontab *) Bash(systemctl list-timers *) Bash(find *) Bash(stat *) Bash(env) Bash(sha256sum *)
12
- argument-hint: "[scan|action|patrol|trust|report|config] [args...]"
11
+ allowed-tools: Read, Grep, Glob, Bash(node scripts/trust-cli.ts *) Bash(node scripts/action-cli.ts *) Bash(node scripts/checkup-report.js) Bash(openclaw *) Bash(ss *) Bash(lsof *) Bash(ufw *) Bash(iptables *) Bash(crontab *) Bash(systemctl list-timers *) Bash(find *) Bash(stat *) Bash(env) Bash(sha256sum *)
12
+ argument-hint: "[scan|action|patrol|trust|report|config|checkup] [args...]"
13
13
  ---
14
14
 
15
15
  # GoPlus AgentGuard — AI Agent Security Framework
@@ -26,6 +26,7 @@ Parse `$ARGUMENTS` to determine the subcommand:
26
26
  - **`trust <lookup|attest|revoke|list> [args]`** — Manage skill trust levels
27
27
  - **`report`** — View recent security events from the audit log
28
28
  - **`config <strict|balanced|permissive>`** — Set protection level
29
+ - **`checkup`** — Run a comprehensive agent health checkup and generate a visual HTML report
29
30
 
30
31
  If no subcommand is given, or the first argument is a path, default to **scan**.
31
32
 
@@ -588,6 +589,206 @@ If the log file doesn't exist, inform the user that no security events have been
588
589
 
589
590
  ---
590
591
 
592
+ # Health Checkup
593
+
594
+ ## Subcommand: checkup
595
+
596
+ Run a comprehensive agent health checkup across 6 security dimensions. Generates a visual HTML report with a lobster mascot and opens it in the browser. The lobster's appearance reflects the agent's health: muscular bodybuilder (score 90+), healthy with shield (70–89), tired with coffee (50–69), or sick with bandages (0–49).
597
+
598
+ ### Step 1: Data Collection
599
+
600
+ Run these checks in parallel where possible. These are **universal agent security checks** — they apply to any Claude Code or OpenClaw environment, regardless of whether AgentGuard is installed.
601
+
602
+ 1. **Discover & scan installed skills**: Glob `~/.claude/skills/*/SKILL.md` and `~/.openclaw/skills/*/SKILL.md`. For each discovered skill, **run `/agentguard scan <skill_path>`** using the scan subcommand logic (24 detection rules). Collect the scan results (risk level, findings count, risk tags) for each skill.
603
+ 2. **Credential file permissions**: `stat` on `~/.ssh/`, `~/.gnupg/`, and if OpenClaw: `stat` on `$OC/openclaw.json`, `$OC/devices/paired.json`
604
+ 3. **Sensitive credential scan (DLP)**: Use Grep to scan workspace memory/logs directories for leaked secrets:
605
+ - Private keys: `0x[a-fA-F0-9]{64}`, `-----BEGIN.*PRIVATE KEY-----`
606
+ - Mnemonics: sequences of 12+ BIP-39 words, `seed_phrase`, `mnemonic`
607
+ - API keys/tokens: `AKIA[0-9A-Z]{16}`, `gh[pousr]_[A-Za-z0-9_]{36}`, plaintext passwords
608
+ 4. **Network exposure**: Run `lsof -i -P -n 2>/dev/null | grep LISTEN` or `ss -tlnp 2>/dev/null` to check for dangerous open ports (Redis 6379, Docker API 2375, MySQL 3306, MongoDB 27017 on 0.0.0.0)
609
+ 5. **Scheduled tasks audit**: Check `crontab -l 2>/dev/null` for suspicious entries containing `curl|bash`, `wget|sh`, or accessing `~/.ssh/`
610
+ 6. **Environment variable exposure**: Run `env` and check for sensitive variable names (`PRIVATE_KEY`, `MNEMONIC`, `SECRET`, `PASSWORD`) — detect presence only, mask values
611
+ 7. **Runtime protection check**: Check if security hooks exist in `~/.claude/settings.json`, check for audit logs at `~/.agentguard/audit.jsonl`
612
+
613
+ ### Step 2: Score Calculation
614
+
615
+ Checklist-based scoring across 6 security dimensions. **Every failed check = 1 finding with severity and description.**
616
+
617
+ #### Dimension 1: Skill & Code Safety (weight: 25%)
618
+
619
+ Uses AgentGuard's 24-rule scan engine (`/agentguard scan`) to audit each installed skill.
620
+
621
+ | Check | Score | If failed → finding |
622
+ |-------|-------|---------------------|
623
+ | All skills scanned with risk level LOW | +40 | For each skill with findings, add per-finding: "<rule_id> in <skill>:<file>:<line>" with its severity |
624
+ | No CRITICAL scan findings across all skills | +30 | "CRITICAL: <rule_id> detected in <skill>" (CRITICAL) |
625
+ | No HIGH scan findings across all skills | +30 | "HIGH: <rule_id> detected in <skill>" (HIGH) |
626
+
627
+ Deductions from base 100: each CRITICAL finding −15, HIGH −8, MEDIUM −3. Floor at 0.
628
+
629
+ If no skills installed: score = 70, add finding: "No third-party skills installed — no code to audit" (LOW).
630
+
631
+ #### Dimension 2: Credential & Secret Safety (weight: 25%)
632
+
633
+ Checks for leaked credentials and permission hygiene.
634
+
635
+ | Check | Score | If failed → finding |
636
+ |-------|-------|---------------------|
637
+ | `~/.ssh/` permissions are 700 or stricter | +25 | "~/.ssh/ permissions too open (<actual>) — should be 700" (HIGH) |
638
+ | `~/.gnupg/` permissions are 700 or stricter | +15 | "~/.gnupg/ permissions too open (<actual>) — should be 700" (MEDIUM) |
639
+ | No private keys (hex 0x..64, PEM) found in skill code or workspace | +25 | "Plaintext private key found in <location>" (CRITICAL) |
640
+ | No mnemonic phrases found in skill code or workspace | +20 | "Plaintext mnemonic found in <location>" (CRITICAL) |
641
+ | No API keys/tokens (AWS AKIA.., GitHub gh*_) found in skill code | +15 | "API key/token found in <location>" (HIGH) |
642
+
643
+ #### Dimension 3: Network & System Exposure (weight: 20%)
644
+
645
+ Checks for dangerous network exposure and system-level risks.
646
+
647
+ | Check | Score | If failed → finding |
648
+ |-------|-------|---------------------|
649
+ | No high-risk ports exposed on 0.0.0.0 (Redis/Docker/MySQL/MongoDB) | +35 | "Dangerous port exposed: <service> on 0.0.0.0:<port>" (HIGH) |
650
+ | No suspicious cron jobs (curl\|bash, wget\|sh, accessing ~/.ssh/) | +30 | "Suspicious cron job: <command>" (HIGH) |
651
+ | No sensitive env vars with dangerous names (PRIVATE_KEY, MNEMONIC) | +20 | "Sensitive env var exposed: <name>" (MEDIUM) |
652
+ | OpenClaw config files have proper permissions (600) if applicable | +15 | "OpenClaw config <file> permissions too open" (MEDIUM) |
653
+
654
+ #### Dimension 4: Runtime Protection (weight: 15%)
655
+
656
+ Checks whether the agent has active security monitoring.
657
+
658
+ | Check | Score | If failed → finding |
659
+ |-------|-------|---------------------|
660
+ | Security hooks/guards installed (AgentGuard, custom hooks, etc.) | +40 | "No security hooks installed — actions are unmonitored" (HIGH) |
661
+ | Security audit log exists with recent events | +30 | "No security audit log — no threat history available" (MEDIUM) |
662
+ | Skills have been security-scanned at least once | +30 | "Installed skills have never been security-scanned" (MEDIUM) |
663
+
664
+ #### Dimension 5: Web3 Safety (weight: 15% if applicable)
665
+
666
+ Only if Web3 usage is detected (env vars like `GOPLUS_API_KEY`, `CHAIN_ID`, `RPC_URL`, or web3-related skills installed). Otherwise `{ "score": null, "na": true }`.
667
+
668
+ | Check | Score | If failed → finding |
669
+ |-------|-------|---------------------|
670
+ | No wallet-draining patterns (approve+transferFrom) in skill code | +40 | "Wallet-draining pattern detected in <skill>" (CRITICAL) |
671
+ | No unlimited token approval patterns in skill code | +30 | "Unlimited approval pattern detected in <skill>" (HIGH) |
672
+ | Transaction security API configured (GoPlus or equivalent) | +30 | "No transaction security API — Web3 calls are unverified" (MEDIUM) |
673
+
674
+ #### Composite Score
675
+
676
+ Weighted average of all applicable dimensions. If Web3 Safety is N/A, redistribute its 15% weight proportionally.
677
+
678
+ Determine tier:
679
+ - 90–100 → Tier **S** (JACKED)
680
+ - 70–89 → Tier **A** (Healthy)
681
+ - 50–69 → Tier **B** (Tired)
682
+ - 0–49 → Tier **F** (Critical)
683
+
684
+ ### Step 3: Generate Analysis Report
685
+
686
+ Based on all collected data and findings, write a **comprehensive security analysis report** as a single text block. This is where you use your AI reasoning ability — don't just list facts, **analyze** them:
687
+
688
+ - Summarize the overall security posture in 2-3 sentences
689
+ - Highlight the most critical risks and explain **why** they matter (e.g. "Your ~/.ssh/ permissions allow any process running as your user to read your private keys, which means a malicious skill could silently exfiltrate them")
690
+ - For each major finding, provide a specific actionable fix (exact command to run)
691
+ - Note what's going well — acknowledge secure areas
692
+ - If applicable, explain attack scenarios that the current configuration is vulnerable to (e.g. "A malicious skill could install a cron job that phones home your credentials every hour")
693
+ - Keep the tone professional but direct, like a security consultant's report
694
+
695
+ This report goes into the `"analysis"` field of the JSON output.
696
+
697
+ Also generate a list of actionable recommendations as `{ "severity": "...", "text": "..." }` objects for the structured view.
698
+
699
+ ### Step 4: Generate Report
700
+
701
+ Assemble the results into a JSON object and pipe it to the report generator:
702
+
703
+ ```json
704
+ {
705
+ "timestamp": "<ISO 8601>",
706
+ "composite_score": <0-100>,
707
+ "tier": "<S|A|B|F>",
708
+ "dimensions": {
709
+ "code_safety": { "score": <n>, "findings": [...], "details": "<one-line summary>" },
710
+ "credential_safety": { "score": <n>, "findings": [...], "details": "<one-line summary>" },
711
+ "network_exposure": { "score": <n>, "findings": [...], "details": "<one-line summary>" },
712
+ "runtime_protection": { "score": <n>, "findings": [...], "details": "<one-line summary>" },
713
+ "web3_safety": { "score": <n|null>, "na": <bool>, "findings": [...], "details": "<one-line summary>" }
714
+ },
715
+ "skills_scanned": <count>,
716
+ "protection_level": "<level>",
717
+ "analysis": "<the comprehensive AI-written security analysis report>",
718
+ "recommendations": [
719
+ { "severity": "HIGH", "text": "..." }
720
+ ]
721
+ }
722
+ ```
723
+
724
+ Execute:
725
+ ```bash
726
+ echo '<json>' | node scripts/checkup-report.js
727
+ ```
728
+
729
+ The script outputs the HTML file path to stdout and opens it in the browser automatically.
730
+
731
+ ### Step 5: Terminal Summary
732
+
733
+ After the report generates, output a brief summary in the terminal:
734
+
735
+ ```
736
+ ## 🦞 GoPlus AgentGuard Health Checkup
737
+
738
+ **Overall Health Score**: <score> / 100 (Tier <grade> — <label>)
739
+ **Quote**: "<lobster quote>"
740
+
741
+ | Dimension | Score | Status |
742
+ |-----------|-------|--------|
743
+ | 🔍 Code Safety | <n>/100 | <EXCELLENT/GOOD/NEEDS WORK/CRITICAL> |
744
+ | 🤝 Trust Hygiene | <n>/100 | <status> |
745
+ | 🛡️ Runtime Defense | <n>/100 | <status> |
746
+ | 🔐 Secret Protection | <n>/100 | <status> |
747
+ | ⛓️ Web3 Shield | <n>/100 or N/A | <status> |
748
+ | ⚙️ Config Posture | <n>/100 | <status> |
749
+
750
+ **Full visual report**: <path> (opened in browser)
751
+
752
+ 💡 Top recommendation: <first recommendation text>
753
+ ```
754
+
755
+ ### Step 6: Deliver the Report to the User
756
+
757
+ After printing the terminal summary, deliver the HTML report file to the user. Detect the current channel and use the most appropriate method:
758
+
759
+ **Detection logic** — infer from context clues:
760
+ - If the `Write` tool is available and you can write to `~/Desktop` or `~/Downloads` → you are in **Claude Code (local)**
761
+ - If you can produce artifact/file outputs (rich UI, download button) → you are in **Claude.ai web**
762
+ - If neither is clearly available → you are in **API / headless mode**
763
+
764
+ **Delivery by channel:**
765
+
766
+ 1. **Claude Code (local desktop)**
767
+ - Use the `Write` tool to copy the HTML to `~/Desktop/agentguard-checkup-<YYYY-MM-DD>.html`
768
+ - Tell the user: "✅ Report saved to your Desktop: `agentguard-checkup-<date>.html` — double-click to open it in your browser."
769
+ - The browser should already be open from Step 4. If not, run `open ~/Desktop/agentguard-checkup-<date>.html` (macOS) or `xdg-open` (Linux).
770
+
771
+ 2. **Claude.ai web**
772
+ - Read the generated HTML file using the `Read` tool, then output the full HTML content as a **code artifact** (language: `html`) so the user can preview it inline or download it.
773
+ - Tell the user: "✅ Your report is attached above — click the download icon to save it."
774
+
775
+ 3. **API / headless / MCP**
776
+ - Read the generated HTML file and return the full content inline, prefixed with:
777
+ `<!-- AgentGuard Checkup Report | Score: <n>/100 | <date> -->`
778
+ - Also print the file path so the caller can retrieve it from disk.
779
+
780
+ Regardless of channel, always end with:
781
+ ```
782
+ 🦞 Stay safe — run /agentguard checkup anytime to get a fresh report.
783
+ ```
784
+
785
+ Append a summary entry to `~/.agentguard/audit.jsonl`:
786
+ ```json
787
+ {"timestamp":"...","event":"checkup","composite_score":<n>,"tier":"<grade>","checks":6,"findings":<count>,"skills_scanned":<count>}
788
+ ```
789
+
790
+ ---
791
+
591
792
  # Auto-Scan on Session Start (Opt-In)
592
793
 
593
794
  AgentGuard can optionally scan installed skills at session startup. **This is disabled by default** and must be explicitly enabled: