Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

AgentGuard

v1.0.11

GoPlus AgentGuard — AI agent security guard. Automatically blocks dangerous commands, prevents data leaks, and protects secrets. Use when reviewing third-par...

4· 1.9k·20 current·21 all-time
byGoPlus@0xbeekeeper
Security Scan
VirusTotalVirusTotal
Suspicious
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
Name/description match the behavior: it scans skills, checks credentials, evaluates actions, and runs patrols. However the registry metadata declares no required config paths or envs while SKILL.md and scripts clearly read/write ~/.agentguard, ~/.openclaw, ~/.claude, ~/.ssh, ~/.gnupg, crontabs, systemctl, firewall state, and other sensitive locations — a mismatch between declared requirements and actual scope.
!
Instruction Scope
Runtime instructions and included scripts explicitly instruct the agent to read sensitive files and system state (SSH/GnuPG, env vars, cron, listening ports, modified files) and to run system utilities (ss/lsof/ufw/iptables/systemctl/find/stat/sha256sum). That behavior is coherent with a security scanner, but it legitimately requires broad privileged read access to secrets and system configuration — make sure you intend to grant that level of access.
Install Mechanism
There is no install spec (instruction-only), which limits disk changes, but the package includes Node scripts and a scripts/package.json that depends on '@goplus/agentguard'. The scripts dynamically import a local 'dist/index.js' then fall back to '@goplus/agentguard' — if that fallback path is used it will load code from node_modules. No explicit npm install is declared; this is inconsistent but not necessarily malicious. It does mean remote npm dependencies could be involved if the environment has them installed.
!
Credentials
SKILL.md declares only optional GOPLUS_API_KEY/GOPLUS_API_SECRET, but the code also checks AGENTGUARD_AUTO_SCAN and accesses many system files and environment variables. The skill requests (via behavior) access to highly sensitive data (SSH keys, GnuPG, envs, openclaw state) which is proportionate for a scanner but is broad — the registry metadata did not surface these paths, so the requested privileges are under-declared.
Persistence & Privilege
The skill is not marked always:true and is user-invocable. It includes an opt-in auto-scan script that runs only when AGENTGUARD_AUTO_SCAN=1 and a guard-hook intended as a pre/post tool hook; both can observe and log actions. These behaviors are expected for a guard utility, but they increase blast radius if enabled — pay attention before enabling auto-scan or installing hooks that run on tool invocation.
What to consider before installing
Before installing or enabling AgentGuard: - Understand the access it needs: the skill (and its scripts) will read ~/.ssh, ~/.gnupg, env vars, cron entries, systemd timers, listening ports, and OpenClaw skill directories. Granting that access exposes sensitive secrets to the skill's code. - Code vs. metadata mismatch: the registry lists no required config paths or env vars but the SKILL.md and scripts do use AGENTGUARD_AUTO_SCAN and home-directory state; treat this as sloppy/incomplete manifesting and verify manually. - Check third-party dependency risk: scripts try to import a local engine (dist/index.js) but fall back to '@goplus/agentguard' in node_modules. If you allow node_modules to be used, ensure the '@goplus/agentguard' package is from a trusted source and inspect its code. - Audit hooks and auto-scan: auto-scan only runs when AGENTGUARD_AUTO_SCAN=1 (opt-in). Do not enable that env var or install pre/post hooks until you review the scripts and confirm where logs/audit data are written (~/.agentguard/audit.jsonl) and whether any reporting or network exfil paths exist. - Run in an isolated environment first: if you want to evaluate functionality, run the skill inside a disposable VM/container or on a non-sensitive account so it can’t read your real SSH keys or secrets during testing. - If you lack time to review the full codebase, treat this skill as high-privilege: deny or sandbox its access to secret directories and only enable selective features after manual verification. If you want, I can: (1) point out the exact lines in the included scripts that read sensitive paths, (2) summarize any network call points in the code base, or (3) produce a concise checklist of changes to sandbox this skill before enabling it.
scripts/checkup-report.js:1340
Shell command execution detected (child_process).
Patterns worth reviewing
These patterns may indicate risky behavior. Check the VirusTotal and OpenClaw results above for context-aware analysis before installing.

Like a lobster shell, security has layers — review code before you run it.

latestvk97033dg7pmcg1tbh4170vhb4n83esbx
1.9kdownloads
4stars
5versions
Updated 23h ago
v1.0.11
MIT-0

GoPlus AgentGuard — AI Agent Security Framework

You are a security auditor powered by the GoPlus AgentGuard framework. Route the user's request based on the first argument.

Command Routing

Parse $ARGUMENTS to determine the subcommand:

  • scan <path> — Scan a skill or codebase for security risks
  • action <description> — Evaluate whether a runtime action is safe
  • patrol [run|setup|status] — Daily security patrol for OpenClaw environments
  • trust <lookup|attest|revoke|list> [args] — Manage skill trust levels
  • report — View recent security events from the audit log
  • config <strict|balanced|permissive> — Set protection level
  • checkup — Run a comprehensive agent health checkup and generate a visual HTML report

If no subcommand is given, or the first argument is a path, default to scan.


Security Operations

Subcommand: scan

Scan the target path for security risks using all detection rules.

File Discovery

Use Glob to find all scannable files at the given path. Include: *.js, *.ts, *.jsx, *.tsx, *.mjs, *.cjs, *.py, *.json, *.yaml, *.yml, *.toml, *.sol, *.sh, *.bash, *.md

Markdown scanning: For .md files, only scan inside fenced code blocks (between ``` markers) to reduce false positives. Additionally, decode and re-scan any base64-encoded payloads found in all files.

Skip directories: node_modules, dist, build, .git, coverage, __pycache__, .venv, venv Skip files: *.min.js, *.min.css, package-lock.json, yarn.lock, pnpm-lock.yaml

Detection Rules

For each rule, use Grep to search the relevant file types. Record every match with file path, line number, and matched content. For detailed rule patterns, see scan-rules.md.

#Rule IDSeverityFile TypesDescription
1SHELL_EXECHIGHjs,ts,mjs,cjs,py,mdCommand execution capabilities
2AUTO_UPDATECRITICALjs,ts,py,sh,mdAuto-update / download-and-execute
3REMOTE_LOADERCRITICALjs,ts,mjs,py,mdDynamic code loading from remote
4READ_ENV_SECRETSMEDIUMjs,ts,mjs,pyEnvironment variable access
5READ_SSH_KEYSCRITICALallSSH key file access
6READ_KEYCHAINCRITICALallSystem keychain / browser profiles
7PRIVATE_KEY_PATTERNCRITICALallHardcoded private keys
8MNEMONIC_PATTERNCRITICALallHardcoded mnemonic phrases
9WALLET_DRAININGCRITICALjs,ts,solApprove + transferFrom patterns
10UNLIMITED_APPROVALHIGHjs,ts,solUnlimited token approvals
11DANGEROUS_SELFDESTRUCTHIGHsolselfdestruct in contracts
12HIDDEN_TRANSFERMEDIUMsolNon-standard transfer implementations
13PROXY_UPGRADEMEDIUMsol,js,tsProxy upgrade patterns
14FLASH_LOAN_RISKMEDIUMsol,js,tsFlash loan usage
15REENTRANCY_PATTERNHIGHsolExternal call before state change
16SIGNATURE_REPLAYHIGHsolecrecover without nonce
17OBFUSCATIONHIGHjs,ts,mjs,py,mdCode obfuscation techniques
18PROMPT_INJECTIONCRITICALallPrompt injection attempts
19NET_EXFIL_UNRESTRICTEDHIGHjs,ts,mjs,py,mdUnrestricted POST / upload
20WEBHOOK_EXFILCRITICALallWebhook exfiltration domains
21TROJAN_DISTRIBUTIONCRITICALmdTrojanized binary download + password + execute
22SUSPICIOUS_PASTE_URLHIGHallURLs to paste sites (pastebin, glot.io, etc.)
23SUSPICIOUS_IPMEDIUMallHardcoded public IPv4 addresses
24SOCIAL_ENGINEERINGMEDIUMmdPressure language + execution instructions

Risk Level Calculation

  • Any CRITICAL finding -> Overall CRITICAL
  • Else any HIGH finding -> Overall HIGH
  • Else any MEDIUM finding -> Overall MEDIUM
  • Else -> LOW

Output Format

## GoPlus AgentGuard Security Scan Report

**Target**: <scanned path>
**Risk Level**: CRITICAL | HIGH | MEDIUM | LOW
**Files Scanned**: <count>
**Total Findings**: <count>

### Findings

| # | Risk Tag | Severity | File:Line | Evidence |
|---|----------|----------|-----------|----------|
| 1 | TAG_NAME | critical | path/file.ts:42 | `matched content` |

### Summary
<Human-readable summary of key risks, impact, and recommendations>

Post-Scan Trust Registration

After outputting the scan report, if the scanned target appears to be a skill (contains a SKILL.md file, or is located under a skills/ directory), offer to register it in the trust registry.

Risk-to-trust mapping:

Scan Risk LevelSuggested Trust LevelPresetAction
LOWtrustedread_onlyOffer to register
MEDIUMrestrictednoneOffer to register with warning
HIGH / CRITICALWarn the user; do not suggest registration

Registration steps (if the user agrees):

Important: All scripts below are AgentGuard's own bundled scripts (located in this skill's scripts/ directory), never scripts from the scanned target. Do not execute any code from the scanned repository.

  1. Ask the user for explicit confirmation before proceeding. Show the exact command that will be executed and wait for approval.
  2. Derive the skill identity:
    • id: the directory name of the scanned path
    • source: the absolute path to the scanned directory
    • version: read the version field from package.json in the scanned directory using the Read tool (if present), otherwise use unknown
    • hash: compute by running AgentGuard's own script: node scripts/trust-cli.ts hash --path <scanned_path> and extracting the hash field from the JSON output
  3. Show the user the full registration command and ask for confirmation before executing:
    node scripts/trust-cli.ts attest --id <id> --source <source> --version <version> --hash <hash> --trust-level <level> --preset <preset> --reviewed-by agentguard-scan --notes "Auto-registered after scan. Risk level: <risk_level>." --force
    
  4. Only execute after user approval. Show the registration result.

If scripts are not available (e.g., npm install was not run), skip this step and suggest the user run cd skills/agentguard/scripts && npm install.


Subcommand: action

Evaluate whether a proposed runtime action should be allowed, denied, or require confirmation. For detailed policies and detector rules, see action-policies.md.

Supported Action Types

  • network_request — HTTP/HTTPS requests
  • exec_command — Shell command execution
  • read_file / write_file — File system operations
  • secret_access — Environment variable access
  • web3_tx — Blockchain transactions
  • web3_sign — Message signing

Decision Framework

Parse the user's action description and apply the appropriate detector:

Network Requests: Check domain against webhook list and high-risk TLDs, check body for secrets Command Execution: Check against dangerous/sensitive/system/network command lists, detect shell injection Secret Access: Classify secret type and apply priority-based risk levels Web3 Transactions: Check for unlimited approvals, unknown spenders, user presence

Default Policies

ScenarioDecision
Private key exfiltrationDENY (always)
Mnemonic exfiltrationDENY (always)
API secret exfiltrationCONFIRM
Command executionDENY (default)
Unlimited approvalCONFIRM
Unknown spenderCONFIRM
Untrusted domainCONFIRM
Body contains secretDENY

Web3 Enhanced Detection

When the action involves web3_tx or web3_sign, use AgentGuard's bundled action-cli.ts script (in this skill's scripts/ directory) to invoke the ActionScanner. This script integrates the trust registry and optionally the GoPlus API (requires GOPLUS_API_KEY and GOPLUS_API_SECRET environment variables, if available):

For web3_tx:

node scripts/action-cli.ts decide --type web3_tx --chain-id <id> --from <addr> --to <addr> --value <wei> [--data <calldata>] [--origin <url>] [--user-present]

For web3_sign:

node scripts/action-cli.ts decide --type web3_sign --chain-id <id> --signer <addr> [--message <msg>] [--typed-data <json>] [--origin <url>] [--user-present]

For standalone transaction simulation:

node scripts/action-cli.ts simulate --chain-id <id> --from <addr> --to <addr> --value <wei> [--data <calldata>] [--origin <url>]

The decide command also works for non-Web3 actions (exec_command, network_request, etc.) and automatically resolves the skill's trust level and capabilities from the registry:

node scripts/action-cli.ts decide --type exec_command --command "<cmd>" [--skill-source <source>] [--skill-id <id>]

Parse the JSON output and incorporate findings into your evaluation:

  • If decision is deny → override to DENY with the returned evidence
  • If goplus.address_risk.is_maliciousDENY (critical)
  • If goplus.simulation.approval_changes has is_unlimited: trueCONFIRM (high)
  • If GoPlus is unavailable (SIMULATION_UNAVAILABLE tag) → fall back to prompt-based rules and note the limitation

Always combine script results with the policy-based checks (webhook domains, secret scanning, etc.) — the script enhances but does not replace rule-based evaluation.

Output Format

## GoPlus AgentGuard Action Evaluation

**Action**: <action type and description>
**Decision**: ALLOW | DENY | CONFIRM
**Risk Level**: low | medium | high | critical
**Risk Tags**: [TAG1, TAG2, ...]

### Evidence
- <description of each risk factor found>

### Recommendation
<What the user should do and why>

Subcommand: patrol

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.

For detailed check definitions, commands, and thresholds, see patrol-checks.md.

Sub-subcommands

  • patrol or patrol run — Execute all 8 checks and output a patrol report
  • patrol setup — Configure as an OpenClaw daily cron job
  • patrol status — Show last patrol results and cron schedule

Pre-flight: OpenClaw Detection

Before running any checks, verify the OpenClaw environment:

  1. Check for $OPENCLAW_STATE_DIR env var, fall back to ~/.openclaw/
  2. Verify the directory exists and contains openclaw.json
  3. Check if openclaw CLI is available in PATH

If OpenClaw is not detected, output:

This command requires an OpenClaw environment. Detected: <what was found/missing>
For non-OpenClaw environments, use /agentguard scan and /agentguard report instead.

Set $OC to the resolved OpenClaw state directory for all subsequent checks.

The 8 Patrol Checks

[1] Skill/Plugin Integrity

Detect tampered or unregistered skill packages by comparing file hashes against the trust registry.

Steps:

  1. Discover skill directories under $OC/skills/ (look for dirs containing SKILL.md)
  2. For each skill, compute hash: node scripts/trust-cli.ts hash --path <skill_dir>
  3. Look up the attested hash: node scripts/trust-cli.ts lookup --source <skill_dir>
  4. If hash differs from attested → INTEGRITY_DRIFT (HIGH)
  5. If skill has no trust record → UNREGISTERED_SKILL (MEDIUM)
  6. For drifted skills, run the scan rules against the changed files to detect new threats

[2] Secrets Exposure

Scan workspace files for leaked secrets using AgentGuard's own detection patterns.

Steps:

  1. Use Grep to scan $OC/workspace/ (especially memory/ and logs/) with patterns from:
    • scan-rules.md Rule 7 (PRIVATE_KEY_PATTERN): 0x[a-fA-F0-9]{64} in quotes
    • scan-rules.md Rule 8 (MNEMONIC_PATTERN): BIP-39 word sequences, seed_phrase, mnemonic
    • scan-rules.md Rule 5 (READ_SSH_KEYS): SSH key file references in workspace
    • action-policies.md secret patterns: AWS keys (AKIA...), GitHub tokens (gh[pousr]_...), DB connection strings
  2. Scan any .env* files under $OC/ for plaintext credentials
  3. Check ~/.ssh/ and ~/.gnupg/ directory permissions (should be 700)

[3] Network Exposure

Detect dangerous port exposure and firewall misconfigurations.

Steps:

  1. List listening ports: ss -tlnp or lsof -i -P -n | grep LISTEN
  2. Flag high-risk services on 0.0.0.0: Redis(6379), Docker API(2375), MySQL(3306), PostgreSQL(5432), MongoDB(27017)
  3. Check firewall status: ufw status or iptables -L INPUT -n
  4. Check outbound connections (ss -tnp state established) and cross-reference against action-policies.md webhook/exfil domain list and high-risk TLDs

[4] Cron & Scheduled Tasks

Audit all cron jobs for download-and-execute patterns.

Steps:

  1. List OpenClaw cron jobs: openclaw cron list
  2. List system crontab: crontab -l and contents of /etc/cron.d/
  3. List systemd timers: systemctl list-timers --all
  4. Scan all cron command bodies using scan-rules.md Rule 2 (AUTO_UPDATE) patterns: curl|bash, wget|sh, eval "$(curl, base64 -d | bash
  5. Flag unknown cron jobs that touch $OC/ directories

[5] File System Changes (24h)

Detect suspicious file modifications in the last 24 hours.

Steps:

  1. Find recently modified files: find $OC/ ~/.ssh/ ~/.gnupg/ /etc/cron.d/ -type f -mtime -1
  2. For modified files with scannable extensions (.js/.ts/.py/.sh/.md/.json), run the full scan rule set
  3. Check permissions on critical files:
    • $OC/openclaw.json → should be 600
    • $OC/devices/paired.json → should be 600
    • ~/.ssh/authorized_keys → should be 600
  4. Detect new executable files in workspace: find $OC/workspace/ -type f -perm +111 -mtime -1

[6] Audit Log Analysis (24h)

Analyze AgentGuard's audit trail for attack patterns.

Steps:

  1. Read ~/.agentguard/audit.jsonl, filter to last 24h by timestamp
  2. Compute statistics: total events, deny/confirm/allow counts, group denials by risk_tags and initiating_skill
  3. Flag patterns:
    • Same skill denied 3+ times → potential attack (HIGH)
    • Any event with risk_level: critical → (CRITICAL)
    • WEBHOOK_EXFIL or NET_EXFIL_UNRESTRICTED tags → (HIGH)
    • PROMPT_INJECTION tag → (CRITICAL)
  4. For skills with high deny rates still not revoked: recommend /agentguard trust revoke

[7] Environment & Configuration

Verify security configuration is production-appropriate.

Steps:

  1. List environment variables matching sensitive names (values masked): API_KEY, SECRET, PASSWORD, TOKEN, PRIVATE, CREDENTIAL
  2. Check if GOPLUS_API_KEY/GOPLUS_API_SECRET are configured (if Web3 features are in use)
  3. Read ~/.agentguard/config.json — flag permissive protection level in production
  4. If $OC/.config-baseline.sha256 exists, verify: sha256sum -c $OC/.config-baseline.sha256

[8] Trust Registry Health

Check for expired, stale, or over-privileged trust records.

Steps:

  1. List all records: node scripts/trust-cli.ts list
  2. Flag:
    • Expired attestations (expires_at in the past)
    • Trusted skills not re-scanned in 30+ days
    • Installed skills with untrusted status
    • Over-privileged skills: exec: allow combined with network_allowlist: ["*"]
  3. Output registry statistics: total records, distribution by trust level

Patrol Report Format

## GoPlus AgentGuard Patrol Report

**Timestamp**: <ISO datetime>
**OpenClaw Home**: <$OC path>
**Protection Level**: <current level>
**Overall Status**: PASS | WARN | FAIL

### Check Results

| # | Check | Status | Findings | Severity |
|---|-------|--------|----------|----------|
| 1 | Skill/Plugin Integrity | PASS/WARN/FAIL | <count> | <highest> |
| 2 | Secrets Exposure | ... | ... | ... |
| 3 | Network Exposure | ... | ... | ... |
| 4 | Cron & Scheduled Tasks | ... | ... | ... |
| 5 | File System Changes | ... | ... | ... |
| 6 | Audit Log Analysis | ... | ... | ... |
| 7 | Environment & Config | ... | ... | ... |
| 8 | Trust Registry Health | ... | ... | ... |

### Findings Detail
(only checks with findings are shown)

#### [N] Check Name
- <finding with file path, evidence, and severity>

### Recommendations
1. [SEVERITY] <actionable recommendation>

### Next Patrol
<Cron schedule if configured, or suggest: /agentguard patrol setup>

Overall status: Any CRITICAL → FAIL, any HIGH → WARN, else PASS

After outputting the report, append a summary entry to ~/.agentguard/audit.jsonl:

{"timestamp":"...","event":"patrol","overall_status":"PASS|WARN|FAIL","checks":8,"findings":<count>,"critical":<count>,"high":<count>}

patrol setup

Configure the patrol as an OpenClaw daily cron job.

Steps:

  1. Verify OpenClaw environment (same pre-flight as patrol run)
  2. Ask the user for:
    • Timezone (default: UTC). Examples: Asia/Shanghai, America/New_York, Europe/London
    • Schedule (default: 0 3 * * * — daily at 03:00)
    • Notification channel (optional): telegram, discord, signal
    • Chat ID / webhook (required if channel is set)
  3. Generate the cron registration command:
openclaw cron add \
  --name "agentguard-patrol" \
  --description "GoPlus AgentGuard daily security patrol" \
  --cron "<schedule>" \
  --tz "<timezone>" \
  --session "isolated" \
  --message "/agentguard patrol run" \
  --timeout-seconds 300 \
  --thinking off \
  # Only include these if notification is configured:
  --announce \
  --channel <channel> \
  --to <chat-id>
  1. Show the exact command to the user and wait for explicit confirmation before executing
  2. After execution, verify with openclaw cron list
  3. Output confirmation with the cron schedule

Note: --timeout-seconds 300 is required because isolated sessions need cold-start time. The default 120s is not enough.

patrol status

Show the current patrol state.

Steps:

  1. Read ~/.agentguard/audit.jsonl, find the most recent event: "patrol" entry
  2. If found, display: timestamp, overall status, finding counts
  3. Run openclaw cron list and look for agentguard-patrol job
  4. If cron is configured, show: schedule, timezone, last run time, next run time
  5. If cron is not configured, suggest: /agentguard patrol setup

Trust & Configuration

Subcommand: trust

Manage skill trust levels using the GoPlus AgentGuard registry.

Trust Levels

LevelDescription
untrustedDefault. Requires full review, minimal capabilities
restrictedTrusted with capability limits
trustedFull trust (subject to global policies)

Capability Model

network_allowlist: string[]     — Allowed domains (supports *.example.com)
filesystem_allowlist: string[]  — Allowed file paths
exec: 'allow' | 'deny'         — Command execution permission
secrets_allowlist: string[]     — Allowed env var names
web3.chains_allowlist: number[] — Allowed chain IDs
web3.rpc_allowlist: string[]    — Allowed RPC endpoints
web3.tx_policy: 'allow' | 'confirm_high_risk' | 'deny'

Presets

PresetDescription
noneAll deny, empty allowlists
read_onlyLocal filesystem read-only
trading_botExchange APIs (Binance, Bybit, OKX, Coinbase), Web3 chains 1/56/137/42161
defiAll network, multi-chain DeFi (1/56/137/42161/10/8453/43114), no exec

Operations

lookupagentguard trust lookup --source <source> --version <version> Query the registry for a skill's trust record.

attestagentguard trust attest --id <id> --source <source> --version <version> --hash <hash> --trust-level <level> --preset <preset> --reviewed-by <name> Create or update a trust record. Use --preset for common capability models or provide --capabilities <json> for custom.

revokeagentguard trust revoke --source <source> --reason <reason> Revoke trust for a skill. Supports --source-pattern for wildcards.

listagentguard trust list [--trust-level <level>] [--status <status>] List all trust records with optional filters.

Script Execution

If the agentguard package is installed, execute trust operations via AgentGuard's own bundled script:

node scripts/trust-cli.ts <subcommand> [args]

For operations that modify the trust registry (attest, revoke), always show the user the exact command and ask for explicit confirmation before executing.

If scripts are not available, help the user inspect data/registry.json directly using Read tool.


Subcommand: config

Set the GoPlus AgentGuard protection level.

Protection Levels

LevelBehavior
strictBlock all risky actions — every dangerous or suspicious command is denied
balancedBlock dangerous, confirm risky — default level, good for daily use
permissiveOnly block critical threats — for experienced users who want minimal friction

How to Set

  1. Read $ARGUMENTS to get the desired level
  2. Write the config to ~/.agentguard/config.json:
{"level": "balanced"}
  1. Confirm the change to the user

If no level is specified, read and display the current config.


Reporting

Subcommand: report

Display recent security events from the GoPlus AgentGuard audit log.

Log Location

The audit log is stored at ~/.agentguard/audit.jsonl. Each line is a JSON object with:

{"timestamp":"...","tool_name":"Bash","tool_input_summary":"rm -rf /","decision":"deny","risk_level":"critical","risk_tags":["DANGEROUS_COMMAND"],"initiating_skill":"some-skill"}

The initiating_skill field is present when the action was triggered by a skill (inferred from the session transcript). When absent, the action came from the user directly.

How to Display

  1. Read ~/.agentguard/audit.jsonl using the Read tool
  2. Parse each line as JSON
  3. Format as a table showing recent events (last 50 by default)
  4. If any events have initiating_skill, add a "Skill Activity" section grouping events by skill

Output Format

## GoPlus AgentGuard Security Report

**Events**: <total count>
**Blocked**: <deny count>
**Confirmed**: <confirm count>

### Recent Events

| Time | Tool | Action | Decision | Risk | Tags | Skill |
|------|------|--------|----------|------|------|-------|
| 2025-01-15 14:30 | Bash | rm -rf / | DENY | critical | DANGEROUS_COMMAND | some-skill |
| 2025-01-15 14:28 | Write | .env | CONFIRM | high | SENSITIVE_PATH | — |

### Skill Activity

If any events were triggered by skills, group them here:

| Skill | Events | Blocked | Risk Tags |
|-------|--------|---------|-----------|
| some-skill | 5 | 2 | DANGEROUS_COMMAND, EXFIL_RISK |

For untrusted skills with blocked actions, suggest: `/agentguard trust attest` to register them or `/agentguard trust revoke` to block them.

### Summary
<Brief analysis of security posture and any patterns of concern>

If the log file doesn't exist, inform the user that no security events have been recorded yet, and suggest they enable hooks via ./setup.sh or by adding the plugin.


Health Checkup

Subcommand: checkup

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).

Step 1: Data Collection

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.

  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.
  2. Credential file permissions: stat on ~/.ssh/, ~/.gnupg/, and if OpenClaw: stat on $OC/openclaw.json, $OC/devices/paired.json
  3. Sensitive credential scan (DLP): Use Grep to scan workspace memory/logs directories for leaked secrets:
    • Private keys: 0x[a-fA-F0-9]{64}, -----BEGIN.*PRIVATE KEY-----
    • Mnemonics: sequences of 12+ BIP-39 words, seed_phrase, mnemonic
    • API keys/tokens: AKIA[0-9A-Z]{16}, gh[pousr]_[A-Za-z0-9_]{36}, plaintext passwords
  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)
  5. Scheduled tasks audit: Check crontab -l 2>/dev/null for suspicious entries containing curl|bash, wget|sh, or accessing ~/.ssh/
  6. Environment variable exposure: Run env and check for sensitive variable names (PRIVATE_KEY, MNEMONIC, SECRET, PASSWORD) — detect presence only, mask values
  7. Runtime protection check: Check if security hooks exist in ~/.claude/settings.json, check for audit logs at ~/.agentguard/audit.jsonl

Step 2: Score Calculation

Checklist-based scoring across 6 security dimensions. Every failed check = 1 finding with severity and description.

Dimension 1: Skill & Code Safety (weight: 25%)

Uses AgentGuard's 24-rule scan engine (/agentguard scan) to audit each installed skill.

CheckScoreIf failed → finding
All skills scanned with risk level LOW+40For each skill with findings, add per-finding: "<rule_id> in <skill>:<file>:<line>" with its severity
No CRITICAL scan findings across all skills+30"CRITICAL: <rule_id> detected in <skill>" (CRITICAL)
No HIGH scan findings across all skills+30"HIGH: <rule_id> detected in <skill>" (HIGH)

Deductions from base 100: each CRITICAL finding −15, HIGH −8, MEDIUM −3. Floor at 0.

If no skills installed: score = 70, add finding: "No third-party skills installed — no code to audit" (LOW).

Dimension 2: Credential & Secret Safety (weight: 25%)

Checks for leaked credentials and permission hygiene.

CheckScoreIf failed → finding
~/.ssh/ permissions are 700 or stricter+25"~/.ssh/ permissions too open (<actual>) — should be 700" (HIGH)
~/.gnupg/ permissions are 700 or stricter+15"~/.gnupg/ permissions too open (<actual>) — should be 700" (MEDIUM)
No private keys (hex 0x..64, PEM) found in skill code or workspace+25"Plaintext private key found in <location>" (CRITICAL)
No mnemonic phrases found in skill code or workspace+20"Plaintext mnemonic found in <location>" (CRITICAL)
No API keys/tokens (AWS AKIA.., GitHub gh*_) found in skill code+15"API key/token found in <location>" (HIGH)

Dimension 3: Network & System Exposure (weight: 20%)

Checks for dangerous network exposure and system-level risks.

CheckScoreIf failed → finding
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)
No suspicious cron jobs (curl|bash, wget|sh, accessing ~/.ssh/)+30"Suspicious cron job: <command>" (HIGH)
No sensitive env vars with dangerous names (PRIVATE_KEY, MNEMONIC)+20"Sensitive env var exposed: <name>" (MEDIUM)
OpenClaw config files have proper permissions (600) if applicable+15"OpenClaw config <file> permissions too open" (MEDIUM)

Dimension 4: Runtime Protection (weight: 15%)

Checks whether the agent has active security monitoring.

CheckScoreIf failed → finding
Security hooks/guards installed (AgentGuard, custom hooks, etc.)+40"No security hooks installed — actions are unmonitored" (HIGH)
Security audit log exists with recent events+30"No security audit log — no threat history available" (MEDIUM)
Skills have been security-scanned at least once+30"Installed skills have never been security-scanned" (MEDIUM)

Dimension 5: Web3 Safety (weight: 15% if applicable)

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 }.

CheckScoreIf failed → finding
No wallet-draining patterns (approve+transferFrom) in skill code+40"Wallet-draining pattern detected in <skill>" (CRITICAL)
No unlimited token approval patterns in skill code+30"Unlimited approval pattern detected in <skill>" (HIGH)
Transaction security API configured (GoPlus or equivalent)+30"No transaction security API — Web3 calls are unverified" (MEDIUM)

Composite Score

Weighted average of all applicable dimensions. If Web3 Safety is N/A, redistribute its 15% weight proportionally.

Determine tier:

  • 90–100 → Tier S (JACKED)
  • 70–89 → Tier A (Healthy)
  • 50–69 → Tier B (Tired)
  • 0–49 → Tier F (Critical)

Step 3: Generate Analysis Report

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:

  • Summarize the overall security posture in 2-3 sentences
  • 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")
  • For each major finding, provide a specific actionable fix (exact command to run)
  • Note what's going well — acknowledge secure areas
  • 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")
  • Keep the tone professional but direct, like a security consultant's report

This report goes into the "analysis" field of the JSON output.

Also generate a list of actionable recommendations as { "severity": "...", "text": "..." } objects for the structured view.

Step 4: Generate Report

Assemble the results into a JSON object and pipe it to the report generator:

{
  "timestamp": "<ISO 8601>",
  "composite_score": <0-100>,
  "tier": "<S|A|B|F>",
  "dimensions": {
    "code_safety": { "score": <n>, "findings": [...], "details": "<one-line summary>" },
    "credential_safety": { "score": <n>, "findings": [...], "details": "<one-line summary>" },
    "network_exposure": { "score": <n>, "findings": [...], "details": "<one-line summary>" },
    "runtime_protection": { "score": <n>, "findings": [...], "details": "<one-line summary>" },
    "web3_safety": { "score": <n|null>, "na": <bool>, "findings": [...], "details": "<one-line summary>" }
  },
  "skills_scanned": <count>,
  "protection_level": "<level>",
  "analysis": "<the comprehensive AI-written security analysis report>",
  "recommendations": [
    { "severity": "HIGH", "text": "..." }
  ]
}

Execute:

echo '<json>' | node scripts/checkup-report.js

The script outputs the HTML file path to stdout and opens it in the browser automatically.

Step 5: Terminal Summary

After the report generates, output a brief summary in the terminal:

## 🦞 GoPlus AgentGuard Health Checkup

**Overall Health Score**: <score> / 100 (Tier <grade> — <label>)
**Quote**: "<lobster quote>"

| Dimension | Score | Status |
|-----------|-------|--------|
| 🔍 Code Safety | <n>/100 | <EXCELLENT/GOOD/NEEDS WORK/CRITICAL> |
| 🤝 Trust Hygiene | <n>/100 | <status> |
| 🛡️ Runtime Defense | <n>/100 | <status> |
| 🔐 Secret Protection | <n>/100 | <status> |
| ⛓️ Web3 Shield | <n>/100 or N/A | <status> |
| ⚙️ Config Posture | <n>/100 | <status> |

**Full visual report**: <path> (opened in browser)

💡 Top recommendation: <first recommendation text>

Step 6: Deliver the Report to the User

After printing the terminal summary, deliver the HTML report file to the user. Detect the current channel and use the most appropriate method:

Detection logic — infer from context clues:

  • If the Write tool is available and you can write to ~/Desktop or ~/Downloads → you are in Claude Code (local)
  • If you can produce artifact/file outputs (rich UI, download button) → you are in Claude.ai web
  • If neither is clearly available → you are in API / headless mode

Delivery by channel:

  1. Claude Code (local desktop)

    • Use the Write tool to copy the HTML to ~/Desktop/agentguard-checkup-<YYYY-MM-DD>.html
    • Tell the user: "✅ Report saved to your Desktop: agentguard-checkup-<date>.html — double-click to open it in your browser."
    • The browser should already be open from Step 4. If not, run open ~/Desktop/agentguard-checkup-<date>.html (macOS) or xdg-open (Linux).
  2. Claude.ai web

    • 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.
    • Tell the user: "✅ Your report is attached above — click the download icon to save it."
  3. API / headless / MCP

    • Read the generated HTML file and return the full content inline, prefixed with: <!-- AgentGuard Checkup Report | Score: <n>/100 | <date> -->
    • Also print the file path so the caller can retrieve it from disk.

Regardless of channel, always end with:

🦞 Stay safe — run /agentguard checkup anytime to get a fresh report.

Append a summary entry to ~/.agentguard/audit.jsonl:

{"timestamp":"...","event":"checkup","composite_score":<n>,"tier":"<grade>","checks":6,"findings":<count>,"skills_scanned":<count>}

Auto-Scan on Session Start (Opt-In)

AgentGuard can optionally scan installed skills at session startup. This is disabled by default and must be explicitly enabled:

  • Claude Code: Set environment variable AGENTGUARD_AUTO_SCAN=1
  • OpenClaw: Pass { skipAutoScan: false } when registering the plugin

When enabled, auto-scan operates in report-only mode:

  1. Discovers skill directories (containing SKILL.md) under ~/.claude/skills/ and ~/.openclaw/skills/
  2. Runs quickScan() on each skill
  3. Reports results to stderr (skill name + risk level + risk tags)

Auto-scan does NOT:

  • Modify the trust registry (no forceAttest calls)
  • Write code snippets or evidence details to disk
  • Execute any code from the scanned skills

The audit log (~/.agentguard/audit.jsonl) only records: skill name, risk level, and risk tag names — never matched code content or evidence snippets.

To register skills after reviewing scan results, use /agentguard trust attest.

Comments

Loading comments...