@goplus/agentguard 1.0.7 → 1.0.10
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 +122 -4
- package/dist/adapters/openclaw-plugin.d.ts +2 -0
- package/dist/adapters/openclaw-plugin.d.ts.map +1 -1
- package/dist/adapters/openclaw-plugin.js +16 -8
- package/dist/adapters/openclaw-plugin.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/agentguard/.clawignore +6 -0
- package/skills/agentguard/README.md +62 -0
- package/skills/agentguard/SKILL.md +416 -19
- package/skills/agentguard/patrol-checks.md +334 -0
- package/skills/agentguard/scripts/checkup-report.js +1344 -0
|
@@ -1,15 +1,15 @@
|
|
|
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, or viewing security logs.
|
|
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.
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Requires Node.js 18+. Optional GoPlus API credentials for enhanced Web3 simulation.
|
|
6
6
|
metadata:
|
|
7
7
|
author: GoPlusSecurity
|
|
8
|
-
version: "1.
|
|
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 *)
|
|
12
|
-
argument-hint: "[scan|action|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
|
|
@@ -22,14 +22,18 @@ Parse `$ARGUMENTS` to determine the subcommand:
|
|
|
22
22
|
|
|
23
23
|
- **`scan <path>`** — Scan a skill or codebase for security risks
|
|
24
24
|
- **`action <description>`** — Evaluate whether a runtime action is safe
|
|
25
|
+
- **`patrol [run|setup|status]`** — Daily security patrol for OpenClaw environments
|
|
25
26
|
- **`trust <lookup|attest|revoke|list> [args]`** — Manage skill trust levels
|
|
26
27
|
- **`report`** — View recent security events from the audit log
|
|
27
28
|
- **`config <strict|balanced|permissive>`** — Set protection level
|
|
29
|
+
- **`checkup`** — Run a comprehensive agent health checkup and generate a visual HTML report
|
|
28
30
|
|
|
29
31
|
If no subcommand is given, or the first argument is a path, default to **scan**.
|
|
30
32
|
|
|
31
33
|
---
|
|
32
34
|
|
|
35
|
+
# Security Operations
|
|
36
|
+
|
|
33
37
|
## Subcommand: scan
|
|
34
38
|
|
|
35
39
|
Scan the target path for security risks using all detection rules.
|
|
@@ -220,6 +224,227 @@ Always combine script results with the policy-based checks (webhook domains, sec
|
|
|
220
224
|
|
|
221
225
|
---
|
|
222
226
|
|
|
227
|
+
## Subcommand: patrol
|
|
228
|
+
|
|
229
|
+
**OpenClaw-specific daily security patrol.** Runs 8 automated checks that leverage AgentGuard's scan engine, trust registry, and audit log to assess the security posture of an OpenClaw deployment.
|
|
230
|
+
|
|
231
|
+
For detailed check definitions, commands, and thresholds, see [patrol-checks.md](patrol-checks.md).
|
|
232
|
+
|
|
233
|
+
### Sub-subcommands
|
|
234
|
+
|
|
235
|
+
- **`patrol`** or **`patrol run`** — Execute all 8 checks and output a patrol report
|
|
236
|
+
- **`patrol setup`** — Configure as an OpenClaw daily cron job
|
|
237
|
+
- **`patrol status`** — Show last patrol results and cron schedule
|
|
238
|
+
|
|
239
|
+
### Pre-flight: OpenClaw Detection
|
|
240
|
+
|
|
241
|
+
Before running any checks, verify the OpenClaw environment:
|
|
242
|
+
|
|
243
|
+
1. Check for `$OPENCLAW_STATE_DIR` env var, fall back to `~/.openclaw/`
|
|
244
|
+
2. Verify the directory exists and contains `openclaw.json`
|
|
245
|
+
3. Check if `openclaw` CLI is available in PATH
|
|
246
|
+
|
|
247
|
+
If OpenClaw is not detected, output:
|
|
248
|
+
```
|
|
249
|
+
This command requires an OpenClaw environment. Detected: <what was found/missing>
|
|
250
|
+
For non-OpenClaw environments, use /agentguard scan and /agentguard report instead.
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Set `$OC` to the resolved OpenClaw state directory for all subsequent checks.
|
|
254
|
+
|
|
255
|
+
### The 8 Patrol Checks
|
|
256
|
+
|
|
257
|
+
#### [1] Skill/Plugin Integrity
|
|
258
|
+
|
|
259
|
+
Detect tampered or unregistered skill packages by comparing file hashes against the trust registry.
|
|
260
|
+
|
|
261
|
+
**Steps**:
|
|
262
|
+
1. Discover skill directories under `$OC/skills/` (look for dirs containing `SKILL.md`)
|
|
263
|
+
2. For each skill, compute hash: `node scripts/trust-cli.ts hash --path <skill_dir>`
|
|
264
|
+
3. Look up the attested hash: `node scripts/trust-cli.ts lookup --source <skill_dir>`
|
|
265
|
+
4. If hash differs from attested → **INTEGRITY_DRIFT** (HIGH)
|
|
266
|
+
5. If skill has no trust record → **UNREGISTERED_SKILL** (MEDIUM)
|
|
267
|
+
6. For drifted skills, run the scan rules against the changed files to detect new threats
|
|
268
|
+
|
|
269
|
+
#### [2] Secrets Exposure
|
|
270
|
+
|
|
271
|
+
Scan workspace files for leaked secrets using AgentGuard's own detection patterns.
|
|
272
|
+
|
|
273
|
+
**Steps**:
|
|
274
|
+
1. Use Grep to scan `$OC/workspace/` (especially `memory/` and `logs/`) with patterns from:
|
|
275
|
+
- scan-rules.md Rule 7 (PRIVATE_KEY_PATTERN): `0x[a-fA-F0-9]{64}` in quotes
|
|
276
|
+
- scan-rules.md Rule 8 (MNEMONIC_PATTERN): BIP-39 word sequences, `seed_phrase`, `mnemonic`
|
|
277
|
+
- scan-rules.md Rule 5 (READ_SSH_KEYS): SSH key file references in workspace
|
|
278
|
+
- action-policies.md secret patterns: AWS keys (`AKIA...`), GitHub tokens (`gh[pousr]_...`), DB connection strings
|
|
279
|
+
2. Scan any `.env*` files under `$OC/` for plaintext credentials
|
|
280
|
+
3. Check `~/.ssh/` and `~/.gnupg/` directory permissions (should be 700)
|
|
281
|
+
|
|
282
|
+
#### [3] Network Exposure
|
|
283
|
+
|
|
284
|
+
Detect dangerous port exposure and firewall misconfigurations.
|
|
285
|
+
|
|
286
|
+
**Steps**:
|
|
287
|
+
1. List listening ports: `ss -tlnp` or `lsof -i -P -n | grep LISTEN`
|
|
288
|
+
2. Flag high-risk services on 0.0.0.0: Redis(6379), Docker API(2375), MySQL(3306), PostgreSQL(5432), MongoDB(27017)
|
|
289
|
+
3. Check firewall status: `ufw status` or `iptables -L INPUT -n`
|
|
290
|
+
4. Check outbound connections (`ss -tnp state established`) and cross-reference against action-policies.md webhook/exfil domain list and high-risk TLDs
|
|
291
|
+
|
|
292
|
+
#### [4] Cron & Scheduled Tasks
|
|
293
|
+
|
|
294
|
+
Audit all cron jobs for download-and-execute patterns.
|
|
295
|
+
|
|
296
|
+
**Steps**:
|
|
297
|
+
1. List OpenClaw cron jobs: `openclaw cron list`
|
|
298
|
+
2. List system crontab: `crontab -l` and contents of `/etc/cron.d/`
|
|
299
|
+
3. List systemd timers: `systemctl list-timers --all`
|
|
300
|
+
4. Scan all cron command bodies using scan-rules.md Rule 2 (AUTO_UPDATE) patterns: `curl|bash`, `wget|sh`, `eval "$(curl`, `base64 -d | bash`
|
|
301
|
+
5. Flag unknown cron jobs that touch `$OC/` directories
|
|
302
|
+
|
|
303
|
+
#### [5] File System Changes (24h)
|
|
304
|
+
|
|
305
|
+
Detect suspicious file modifications in the last 24 hours.
|
|
306
|
+
|
|
307
|
+
**Steps**:
|
|
308
|
+
1. Find recently modified files: `find $OC/ ~/.ssh/ ~/.gnupg/ /etc/cron.d/ -type f -mtime -1`
|
|
309
|
+
2. For modified files with scannable extensions (.js/.ts/.py/.sh/.md/.json), run the full scan rule set
|
|
310
|
+
3. Check permissions on critical files:
|
|
311
|
+
- `$OC/openclaw.json` → should be 600
|
|
312
|
+
- `$OC/devices/paired.json` → should be 600
|
|
313
|
+
- `~/.ssh/authorized_keys` → should be 600
|
|
314
|
+
4. Detect new executable files in workspace: `find $OC/workspace/ -type f -perm +111 -mtime -1`
|
|
315
|
+
|
|
316
|
+
#### [6] Audit Log Analysis (24h)
|
|
317
|
+
|
|
318
|
+
Analyze AgentGuard's audit trail for attack patterns.
|
|
319
|
+
|
|
320
|
+
**Steps**:
|
|
321
|
+
1. Read `~/.agentguard/audit.jsonl`, filter to last 24h by timestamp
|
|
322
|
+
2. Compute statistics: total events, deny/confirm/allow counts, group denials by `risk_tags` and `initiating_skill`
|
|
323
|
+
3. Flag patterns:
|
|
324
|
+
- Same skill denied 3+ times → potential attack (HIGH)
|
|
325
|
+
- Any event with `risk_level: critical` → (CRITICAL)
|
|
326
|
+
- `WEBHOOK_EXFIL` or `NET_EXFIL_UNRESTRICTED` tags → (HIGH)
|
|
327
|
+
- `PROMPT_INJECTION` tag → (CRITICAL)
|
|
328
|
+
4. For skills with high deny rates still not revoked: recommend `/agentguard trust revoke`
|
|
329
|
+
|
|
330
|
+
#### [7] Environment & Configuration
|
|
331
|
+
|
|
332
|
+
Verify security configuration is production-appropriate.
|
|
333
|
+
|
|
334
|
+
**Steps**:
|
|
335
|
+
1. List environment variables matching sensitive names (values masked): `API_KEY`, `SECRET`, `PASSWORD`, `TOKEN`, `PRIVATE`, `CREDENTIAL`
|
|
336
|
+
2. Check if `GOPLUS_API_KEY`/`GOPLUS_API_SECRET` are configured (if Web3 features are in use)
|
|
337
|
+
3. Read `~/.agentguard/config.json` — flag `permissive` protection level in production
|
|
338
|
+
4. If `$OC/.config-baseline.sha256` exists, verify: `sha256sum -c $OC/.config-baseline.sha256`
|
|
339
|
+
|
|
340
|
+
#### [8] Trust Registry Health
|
|
341
|
+
|
|
342
|
+
Check for expired, stale, or over-privileged trust records.
|
|
343
|
+
|
|
344
|
+
**Steps**:
|
|
345
|
+
1. List all records: `node scripts/trust-cli.ts list`
|
|
346
|
+
2. Flag:
|
|
347
|
+
- Expired attestations (`expires_at` in the past)
|
|
348
|
+
- Trusted skills not re-scanned in 30+ days
|
|
349
|
+
- Installed skills with `untrusted` status
|
|
350
|
+
- Over-privileged skills: `exec: allow` combined with `network_allowlist: ["*"]`
|
|
351
|
+
3. Output registry statistics: total records, distribution by trust level
|
|
352
|
+
|
|
353
|
+
### Patrol Report Format
|
|
354
|
+
|
|
355
|
+
```
|
|
356
|
+
## GoPlus AgentGuard Patrol Report
|
|
357
|
+
|
|
358
|
+
**Timestamp**: <ISO datetime>
|
|
359
|
+
**OpenClaw Home**: <$OC path>
|
|
360
|
+
**Protection Level**: <current level>
|
|
361
|
+
**Overall Status**: PASS | WARN | FAIL
|
|
362
|
+
|
|
363
|
+
### Check Results
|
|
364
|
+
|
|
365
|
+
| # | Check | Status | Findings | Severity |
|
|
366
|
+
|---|-------|--------|----------|----------|
|
|
367
|
+
| 1 | Skill/Plugin Integrity | PASS/WARN/FAIL | <count> | <highest> |
|
|
368
|
+
| 2 | Secrets Exposure | ... | ... | ... |
|
|
369
|
+
| 3 | Network Exposure | ... | ... | ... |
|
|
370
|
+
| 4 | Cron & Scheduled Tasks | ... | ... | ... |
|
|
371
|
+
| 5 | File System Changes | ... | ... | ... |
|
|
372
|
+
| 6 | Audit Log Analysis | ... | ... | ... |
|
|
373
|
+
| 7 | Environment & Config | ... | ... | ... |
|
|
374
|
+
| 8 | Trust Registry Health | ... | ... | ... |
|
|
375
|
+
|
|
376
|
+
### Findings Detail
|
|
377
|
+
(only checks with findings are shown)
|
|
378
|
+
|
|
379
|
+
#### [N] Check Name
|
|
380
|
+
- <finding with file path, evidence, and severity>
|
|
381
|
+
|
|
382
|
+
### Recommendations
|
|
383
|
+
1. [SEVERITY] <actionable recommendation>
|
|
384
|
+
|
|
385
|
+
### Next Patrol
|
|
386
|
+
<Cron schedule if configured, or suggest: /agentguard patrol setup>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**Overall status**: Any CRITICAL → **FAIL**, any HIGH → **WARN**, else **PASS**
|
|
390
|
+
|
|
391
|
+
After outputting the report, append a summary entry to `~/.agentguard/audit.jsonl`:
|
|
392
|
+
```json
|
|
393
|
+
{"timestamp":"...","event":"patrol","overall_status":"PASS|WARN|FAIL","checks":8,"findings":<count>,"critical":<count>,"high":<count>}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### patrol setup
|
|
397
|
+
|
|
398
|
+
Configure the patrol as an OpenClaw daily cron job.
|
|
399
|
+
|
|
400
|
+
**Steps**:
|
|
401
|
+
|
|
402
|
+
1. Verify OpenClaw environment (same pre-flight as `patrol run`)
|
|
403
|
+
2. Ask the user for:
|
|
404
|
+
- **Timezone** (default: UTC). Examples: `Asia/Shanghai`, `America/New_York`, `Europe/London`
|
|
405
|
+
- **Schedule** (default: `0 3 * * *` — daily at 03:00)
|
|
406
|
+
- **Notification channel** (optional): `telegram`, `discord`, `signal`
|
|
407
|
+
- **Chat ID / webhook** (required if channel is set)
|
|
408
|
+
3. Generate the cron registration command:
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
openclaw cron add \
|
|
412
|
+
--name "agentguard-patrol" \
|
|
413
|
+
--description "GoPlus AgentGuard daily security patrol" \
|
|
414
|
+
--cron "<schedule>" \
|
|
415
|
+
--tz "<timezone>" \
|
|
416
|
+
--session "isolated" \
|
|
417
|
+
--message "/agentguard patrol run" \
|
|
418
|
+
--timeout-seconds 300 \
|
|
419
|
+
--thinking off \
|
|
420
|
+
# Only include these if notification is configured:
|
|
421
|
+
--announce \
|
|
422
|
+
--channel <channel> \
|
|
423
|
+
--to <chat-id>
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
4. **Show the exact command to the user and wait for explicit confirmation** before executing
|
|
427
|
+
5. After execution, verify with `openclaw cron list`
|
|
428
|
+
6. Output confirmation with the cron schedule
|
|
429
|
+
|
|
430
|
+
> **Note**: `--timeout-seconds 300` is required because isolated sessions need cold-start time. The default 120s is not enough.
|
|
431
|
+
|
|
432
|
+
### patrol status
|
|
433
|
+
|
|
434
|
+
Show the current patrol state.
|
|
435
|
+
|
|
436
|
+
**Steps**:
|
|
437
|
+
|
|
438
|
+
1. Read `~/.agentguard/audit.jsonl`, find the most recent `event: "patrol"` entry
|
|
439
|
+
2. If found, display: timestamp, overall status, finding counts
|
|
440
|
+
3. Run `openclaw cron list` and look for `agentguard-patrol` job
|
|
441
|
+
4. If cron is configured, show: schedule, timezone, last run time, next run time
|
|
442
|
+
5. If cron is not configured, suggest: `/agentguard patrol setup`
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
# Trust & Configuration
|
|
447
|
+
|
|
223
448
|
## Subcommand: trust
|
|
224
449
|
|
|
225
450
|
Manage skill trust levels using the GoPlus AgentGuard registry.
|
|
@@ -280,6 +505,35 @@ If scripts are not available, help the user inspect `data/registry.json` directl
|
|
|
280
505
|
|
|
281
506
|
---
|
|
282
507
|
|
|
508
|
+
## Subcommand: config
|
|
509
|
+
|
|
510
|
+
Set the GoPlus AgentGuard protection level.
|
|
511
|
+
|
|
512
|
+
### Protection Levels
|
|
513
|
+
|
|
514
|
+
| Level | Behavior |
|
|
515
|
+
|-------|----------|
|
|
516
|
+
| `strict` | Block all risky actions — every dangerous or suspicious command is denied |
|
|
517
|
+
| `balanced` | Block dangerous, confirm risky — default level, good for daily use |
|
|
518
|
+
| `permissive` | Only block critical threats — for experienced users who want minimal friction |
|
|
519
|
+
|
|
520
|
+
### How to Set
|
|
521
|
+
|
|
522
|
+
1. Read `$ARGUMENTS` to get the desired level
|
|
523
|
+
2. Write the config to `~/.agentguard/config.json`:
|
|
524
|
+
|
|
525
|
+
```json
|
|
526
|
+
{"level": "balanced"}
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
3. Confirm the change to the user
|
|
530
|
+
|
|
531
|
+
If no level is specified, read and display the current config.
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
# Reporting
|
|
536
|
+
|
|
283
537
|
## Subcommand: report
|
|
284
538
|
|
|
285
539
|
Display recent security events from the GoPlus AgentGuard audit log.
|
|
@@ -335,34 +589,177 @@ If the log file doesn't exist, inform the user that no security events have been
|
|
|
335
589
|
|
|
336
590
|
---
|
|
337
591
|
|
|
338
|
-
|
|
592
|
+
# Health Checkup
|
|
339
593
|
|
|
340
|
-
|
|
594
|
+
## Subcommand: checkup
|
|
341
595
|
|
|
342
|
-
|
|
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).
|
|
343
597
|
|
|
344
|
-
|
|
345
|
-
|-------|----------|
|
|
346
|
-
| `strict` | Block all risky actions — every dangerous or suspicious command is denied |
|
|
347
|
-
| `balanced` | Block dangerous, confirm risky — default level, good for daily use |
|
|
348
|
-
| `permissive` | Only block critical threats — for experienced users who want minimal friction |
|
|
598
|
+
### Step 1: Data Collection
|
|
349
599
|
|
|
350
|
-
|
|
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.
|
|
351
601
|
|
|
352
|
-
1.
|
|
353
|
-
2.
|
|
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:
|
|
354
702
|
|
|
355
703
|
```json
|
|
356
|
-
{
|
|
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
|
+
}
|
|
357
722
|
```
|
|
358
723
|
|
|
359
|
-
|
|
724
|
+
Execute:
|
|
725
|
+
```bash
|
|
726
|
+
echo '<json>' | node scripts/checkup-report.js
|
|
727
|
+
```
|
|
360
728
|
|
|
361
|
-
|
|
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
|
+
Append a summary entry to `~/.agentguard/audit.jsonl`:
|
|
756
|
+
```json
|
|
757
|
+
{"timestamp":"...","event":"checkup","composite_score":<n>,"tier":"<grade>","checks":6,"findings":<count>,"skills_scanned":<count>}
|
|
758
|
+
```
|
|
362
759
|
|
|
363
760
|
---
|
|
364
761
|
|
|
365
|
-
|
|
762
|
+
# Auto-Scan on Session Start (Opt-In)
|
|
366
763
|
|
|
367
764
|
AgentGuard can optionally scan installed skills at session startup. **This is disabled by default** and must be explicitly enabled:
|
|
368
765
|
|