@goplus/agentguard 1.1.20 → 1.1.27
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 +6 -1
- package/dist/action/detectors/exec.d.ts.map +1 -1
- package/dist/action/detectors/exec.js +13 -23
- package/dist/action/detectors/exec.js.map +1 -1
- package/dist/adapters/openclaw-plugin.d.ts.map +1 -1
- package/dist/adapters/openclaw-plugin.js +41 -9
- package/dist/adapters/openclaw-plugin.js.map +1 -1
- package/dist/adapters/openclaw.d.ts.map +1 -1
- package/dist/adapters/openclaw.js +7 -2
- package/dist/adapters/openclaw.js.map +1 -1
- package/dist/cli.js +84 -45
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -0
- package/dist/config.js.map +1 -1
- package/dist/feed/selfcheck.d.ts.map +1 -1
- package/dist/feed/selfcheck.js +205 -54
- package/dist/feed/selfcheck.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/installers.js +17 -4
- package/dist/installers.js.map +1 -1
- package/dist/runtime/approvals.d.ts +38 -0
- package/dist/runtime/approvals.d.ts.map +1 -0
- package/dist/runtime/approvals.js +232 -0
- package/dist/runtime/approvals.js.map +1 -0
- package/dist/runtime/evaluator.d.ts.map +1 -1
- package/dist/runtime/evaluator.js +62 -3
- package/dist/runtime/evaluator.js.map +1 -1
- package/dist/runtime/protect.d.ts +2 -0
- package/dist/runtime/protect.d.ts.map +1 -1
- package/dist/runtime/protect.js +81 -9
- package/dist/runtime/protect.js.map +1 -1
- package/dist/runtime/self-command.d.ts.map +1 -1
- package/dist/runtime/self-command.js +45 -3
- package/dist/runtime/self-command.js.map +1 -1
- package/dist/tests/action.test.js +8 -0
- package/dist/tests/action.test.js.map +1 -1
- package/dist/tests/adapter.test.js +8 -0
- package/dist/tests/adapter.test.js.map +1 -1
- package/dist/tests/cli-init.test.js +10 -0
- package/dist/tests/cli-init.test.js.map +1 -1
- package/dist/tests/cli-subscribe.test.js +106 -1
- package/dist/tests/cli-subscribe.test.js.map +1 -1
- package/dist/tests/feed-selfcheck.test.js +81 -0
- package/dist/tests/feed-selfcheck.test.js.map +1 -1
- package/dist/tests/installer.test.js +9 -2
- package/dist/tests/installer.test.js.map +1 -1
- package/dist/tests/integration.test.js +86 -0
- package/dist/tests/integration.test.js.map +1 -1
- package/dist/tests/runtime-cloud.test.js +470 -0
- package/dist/tests/runtime-cloud.test.js.map +1 -1
- package/docs/claude-code.md +3 -2
- package/docs/cloud-connect.md +16 -3
- package/docs/cloud-native-api.md +26 -118
- package/docs/codex.md +14 -1
- package/docs/openclaw.md +33 -1
- package/docs/privacy-boundary.md +0 -1
- package/package.json +1 -1
- package/skills/agentguard/SKILL.md +4 -0
package/docs/cloud-connect.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Connect AgentGuard OSS to AgentGuard Cloud
|
|
2
2
|
|
|
3
|
-
AgentGuard is local-first. Cloud is optional and adds hosted policy, redacted audit sync, session timelines
|
|
3
|
+
AgentGuard is local-first. Cloud is optional and adds hosted policy, redacted audit sync, and session timelines.
|
|
4
4
|
|
|
5
5
|
## Install and initialize
|
|
6
6
|
|
|
@@ -13,12 +13,25 @@ This creates `~/.agentguard/config.json`, `~/.agentguard/audit.jsonl`, and local
|
|
|
13
13
|
|
|
14
14
|
## Connect Cloud
|
|
15
15
|
|
|
16
|
+
OpenClaw users can connect without an API key after initialization:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
agentguard init --agent openclaw
|
|
20
|
+
agentguard connect
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
In this mode, `connect` registers a local Agent JWT, prints an activation link,
|
|
24
|
+
and may send that link to the latest OpenClaw channel. Open the link to bind the
|
|
25
|
+
local agent to your AgentGuard account.
|
|
26
|
+
|
|
27
|
+
API-key auth is also supported:
|
|
28
|
+
|
|
16
29
|
```bash
|
|
17
30
|
AGENTGUARD_API_KEY=ag_live_xxxxx \
|
|
18
31
|
agentguard connect --url https://agentguard.gopluslabs.io
|
|
19
32
|
```
|
|
20
33
|
|
|
21
|
-
`connect` stores the API key locally, fetches `/api/v1/policies/effective`, and caches the policy. If Cloud is unavailable, AgentGuard keeps enforcing with cached policy or the bundled default policy.
|
|
34
|
+
With API-key auth, `connect` stores the API key locally, fetches `/api/v1/policies/effective`, and caches the policy. With Agent JWT auth, `connect` stores the local agent credential instead of an API key. If Cloud is unavailable, AgentGuard keeps enforcing with cached policy or the bundled default policy.
|
|
22
35
|
|
|
23
36
|
Prefer `AGENTGUARD_API_KEY` or an ignored `.env.local` file over passing secrets as CLI flags, because shell history can persist command-line arguments.
|
|
24
37
|
|
|
@@ -28,7 +41,7 @@ Prefer `AGENTGUARD_API_KEY` or an ignored `.env.local` file over passing secrets
|
|
|
28
41
|
2. AgentGuard evaluates locally by default.
|
|
29
42
|
3. Local audit is written to `~/.agentguard/audit.jsonl`.
|
|
30
43
|
4. Connected clients sync redacted audit events to `/api/v1/events/ingest`.
|
|
31
|
-
5. `require_approval`
|
|
44
|
+
5. `require_approval` is handled by the agent host's native permission channel when one is available. If the host cannot safely resume an approved call, AgentGuard blocks locally and asks the user to retry only after intentionally changing local policy.
|
|
32
45
|
|
|
33
46
|
Use `AGENTGUARD_DECISION_MODE=cloud` or `agentguard protect --decision-mode cloud` only when Cloud should be authoritative for a specific hook.
|
|
34
47
|
|
package/docs/cloud-native-api.md
CHANGED
|
@@ -25,7 +25,7 @@ X-API-Key: ag_live_xxxxx
|
|
|
25
25
|
3. Evaluate runtime actions locally using cached policy and the bundled local engine.
|
|
26
26
|
4. Write local audit JSONL before any Cloud sync.
|
|
27
27
|
5. Upload redacted audit events to `POST /api/v1/events/ingest`.
|
|
28
|
-
6. For `require_approval`,
|
|
28
|
+
6. For `require_approval`, use the local agent host's native permission channel when supported. If the host cannot safely resume a reviewed call, block locally and ask the user to retry only after intentionally changing local policy.
|
|
29
29
|
7. Use `GET /api/v1/sessions/:sessionId/timeline` for review/debug UI.
|
|
30
30
|
|
|
31
31
|
If Cloud is unavailable, continue local enforcement using cached policy, then bundled default policy.
|
|
@@ -91,10 +91,24 @@ The script installs `@goplus/agentguard`, writes a safe fallback local config, t
|
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
agentguard init --agent "$AGENTGUARD_AGENT" --cloud "$AGENTGUARD_CLOUD_URL"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
When the effective agent host is OpenClaw, the script should connect without an
|
|
97
|
+
API key:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
agentguard connect --cloud "$AGENTGUARD_CLOUD_URL"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The CLI registers a local Agent JWT and prints an activation link. For other
|
|
104
|
+
agent hosts, or when the user explicitly chooses API-key auth, the script should
|
|
105
|
+
call:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
94
108
|
agentguard connect --cloud "$AGENTGUARD_CLOUD_URL" --api-key "$AGENTGUARD_API_KEY"
|
|
95
109
|
```
|
|
96
110
|
|
|
97
|
-
Native CLI implementations should support `--cloud` as an alias for the Cloud URL and `--api-key` as an alias for the API key.
|
|
111
|
+
Native CLI implementations should support `--cloud` as an alias for the Cloud URL and `--api-key` as an alias for the API key. Installers that accept `agent=auto` should use the agent host persisted by `agentguard init --agent auto` when choosing between Agent JWT and API-key auth.
|
|
98
112
|
|
|
99
113
|
### Health check
|
|
100
114
|
|
|
@@ -262,126 +276,20 @@ Limits and behavior:
|
|
|
262
276
|
- `input` should be a redacted preview, not full file content or full prompt content.
|
|
263
277
|
- If upload fails, spool locally and retry later.
|
|
264
278
|
|
|
265
|
-
###
|
|
279
|
+
### Runtime approvals
|
|
266
280
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
Content-Type: application/json
|
|
270
|
-
X-API-Key: ag_live_xxxxx
|
|
271
|
-
```
|
|
281
|
+
There is no Cloud approval inbox in the current native runtime flow. Native
|
|
282
|
+
clients must not tell users to approve protected runtime actions in Cloud.
|
|
272
283
|
|
|
273
|
-
|
|
284
|
+
When a decision returns `require_approval`:
|
|
274
285
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
"agentHost": "claude-code",
|
|
280
|
-
"actionType": "file_read",
|
|
281
|
-
"toolName": "Read",
|
|
282
|
-
"input": "~/.ssh/id_rsa",
|
|
283
|
-
"riskScore": 55,
|
|
284
|
-
"riskLevel": "high",
|
|
285
|
-
"reasons": [],
|
|
286
|
-
"policyVersion": "runtime-v0.1",
|
|
287
|
-
"cwd": "/workspace/app",
|
|
288
|
-
"sourceSkill": "optional-skill-id",
|
|
289
|
-
"metadata": {
|
|
290
|
-
"evaluation": "local-oss"
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
Response:
|
|
296
|
-
|
|
297
|
-
```json
|
|
298
|
-
{
|
|
299
|
-
"success": true,
|
|
300
|
-
"data": {
|
|
301
|
-
"approvalId": "apr_abc123",
|
|
302
|
-
"actionId": "act_local_123",
|
|
303
|
-
"sessionId": "sess_local_123",
|
|
304
|
-
"status": "pending"
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
Native behavior:
|
|
310
|
-
|
|
311
|
-
- Create this only after local or Cloud decision returns `require_approval`.
|
|
312
|
-
- Block the action while approval is pending.
|
|
313
|
-
- Show the approval id to the user when available.
|
|
314
|
-
|
|
315
|
-
### List approvals
|
|
316
|
-
|
|
317
|
-
```http
|
|
318
|
-
GET /api/v1/approvals?status=pending
|
|
319
|
-
X-API-Key: ag_live_xxxxx
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
Response:
|
|
323
|
-
|
|
324
|
-
```json
|
|
325
|
-
{
|
|
326
|
-
"success": true,
|
|
327
|
-
"data": {
|
|
328
|
-
"approvals": [
|
|
329
|
-
{
|
|
330
|
-
"approvalId": "apr_abc123",
|
|
331
|
-
"actionId": "act_local_123",
|
|
332
|
-
"sessionId": "sess_local_123",
|
|
333
|
-
"agentHost": "claude-code",
|
|
334
|
-
"actionType": "file_read",
|
|
335
|
-
"toolName": "Read",
|
|
336
|
-
"inputPreview": "~/.ssh/id_rsa",
|
|
337
|
-
"status": "pending",
|
|
338
|
-
"riskScore": 55,
|
|
339
|
-
"riskLevel": "high",
|
|
340
|
-
"reasons": [],
|
|
341
|
-
"policyVersion": "runtime-v0.1",
|
|
342
|
-
"createdAt": "2026-05-11T00:00:00.000Z"
|
|
343
|
-
}
|
|
344
|
-
]
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
Native usage: optional inbox UI or debugging command.
|
|
350
|
-
|
|
351
|
-
### Review approval
|
|
352
|
-
|
|
353
|
-
```http
|
|
354
|
-
PATCH /api/v1/approvals/:approvalId
|
|
355
|
-
Content-Type: application/json
|
|
356
|
-
X-API-Key: ag_live_xxxxx
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
Request:
|
|
360
|
-
|
|
361
|
-
```json
|
|
362
|
-
{
|
|
363
|
-
"status": "approved",
|
|
364
|
-
"note": "Expected deploy"
|
|
365
|
-
}
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
`status` must be either `approved` or `denied`.
|
|
369
|
-
|
|
370
|
-
Response:
|
|
371
|
-
|
|
372
|
-
```json
|
|
373
|
-
{
|
|
374
|
-
"success": true,
|
|
375
|
-
"data": {
|
|
376
|
-
"approvalId": "apr_abc123",
|
|
377
|
-
"actionId": "act_local_123",
|
|
378
|
-
"sessionId": "sess_local_123",
|
|
379
|
-
"status": "approved"
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
```
|
|
286
|
+
- Claude Code should surface the native `PreToolUse` `ask` response.
|
|
287
|
+
- Codex-style hosts should surface the local `confirm` response.
|
|
288
|
+
- OpenClaw currently blocks locally because the runtime hook cannot safely pause
|
|
289
|
+
and resume the original tool call after an external review.
|
|
383
290
|
|
|
384
|
-
|
|
291
|
+
Cloud may still provide policy and session timeline visibility, but approval or
|
|
292
|
+
confirmation must happen in the local agent host.
|
|
385
293
|
|
|
386
294
|
### Session timeline
|
|
387
295
|
|
package/docs/codex.md
CHANGED
|
@@ -35,4 +35,17 @@ Use these mappings for Codex-style hooks or skills:
|
|
|
35
35
|
- browser/network fetches → `network`
|
|
36
36
|
- MCP tool calls → `mcp_tool`
|
|
37
37
|
|
|
38
|
-
When Cloud is connected, Codex events are synced as redacted previews
|
|
38
|
+
When Cloud is connected, Codex events are synced as redacted previews. Confirmation still happens through the local agent permission flow, not a Cloud approval page.
|
|
39
|
+
|
|
40
|
+
If a protected action returns `confirm`, AgentGuard stores a short-lived pending
|
|
41
|
+
approval and includes an approval command:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
agentguard approve --action-id act_local_... --once
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Show that command to the user before running it. Run it only after the user
|
|
48
|
+
explicitly approves that exact action; do not let the agent approve its own
|
|
49
|
+
blocked command proactively. Then retry the original action once. If the action id was not visible, inspect
|
|
50
|
+
`agentguard approvals list --json`; use `agentguard approve --last --once`
|
|
51
|
+
only when there is exactly one relevant unexpired pending approval.
|
package/docs/openclaw.md
CHANGED
|
@@ -10,7 +10,7 @@ To install and enable the AgentGuard OpenClaw plugin:
|
|
|
10
10
|
agentguard init --agent openclaw
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
This creates a local plugin under `~/.openclaw/plugins/agentguard
|
|
13
|
+
This creates a local plugin under `~/.openclaw/plugins/agentguard`, installs the AgentGuard skill under `~/.openclaw/skills/agentguard`, and enables the plugin in `~/.openclaw/openclaw.json`.
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
import { registerOpenClawPlugin } from '@goplus/agentguard';
|
|
@@ -23,6 +23,18 @@ export default function setup(api) {
|
|
|
23
23
|
}
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
## Cloud connect
|
|
27
|
+
|
|
28
|
+
After OpenClaw initialization, run:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
agentguard connect
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
No API key is required for the OpenClaw flow. AgentGuard registers a local Agent
|
|
35
|
+
JWT, prints an activation link, and may send the link to the latest OpenClaw
|
|
36
|
+
channel. Open that link to bind the local agent to your account.
|
|
37
|
+
|
|
26
38
|
## Runtime hook shape
|
|
27
39
|
|
|
28
40
|
For direct hook integration, send events to:
|
|
@@ -36,6 +48,26 @@ agentguard protect
|
|
|
36
48
|
|
|
37
49
|
AgentGuard accepts OpenClaw-style JSON with `toolName` and `params`, plus Claude-style `tool_name` and `tool_input`.
|
|
38
50
|
|
|
51
|
+
OpenClaw cannot safely pause and resume a protected tool call, so AgentGuard
|
|
52
|
+
blocks `require_approval` actions locally and stores a short-lived pending
|
|
53
|
+
approval. The block reason includes:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
agentguard approve --action-id act_local_... --once
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Show that command to the user before running it. Run it only after the user
|
|
60
|
+
explicitly approves that exact action; do not let the agent approve its own
|
|
61
|
+
blocked command proactively. Then retry the original action once. If the action id was not visible in the OpenClaw message,
|
|
62
|
+
inspect pending approvals first:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
agentguard approvals list --json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Use `agentguard approve --last --once` only when there is exactly one relevant
|
|
69
|
+
unexpired pending approval; otherwise approve the specific `actionId`.
|
|
70
|
+
|
|
39
71
|
## Docker demo
|
|
40
72
|
|
|
41
73
|
See `examples/openclaw-docker/` for a minimal Docker demo that installs `@goplus/agentguard`, runs `agentguard init --agent openclaw`, and provides a starter plugin.
|
package/docs/privacy-boundary.md
CHANGED
|
@@ -18,7 +18,6 @@ Only redacted runtime audit previews are uploaded by default:
|
|
|
18
18
|
- `sessionId`, `agentHost`, `actionType`, `toolName`
|
|
19
19
|
- Redacted `input` preview, capped at 2,000 characters
|
|
20
20
|
- Decision, risk score, risk level, reasons, and policy version
|
|
21
|
-
- Optional approval request metadata for `require_approval`
|
|
22
21
|
|
|
23
22
|
## Built-in redaction
|
|
24
23
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goplus/agentguard",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.27",
|
|
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",
|
|
@@ -103,6 +103,8 @@ Supported CLI commands and options:
|
|
|
103
103
|
| `agentguard status` | none | Shows local config, active Cloud auth method, policy cache, audit path |
|
|
104
104
|
| `agentguard policy pull` | `--json` | Pulls Cloud effective runtime policy into the local cache |
|
|
105
105
|
| `agentguard policy show` | `--json` | Shows the cached effective runtime policy, or the bundled default policy when no cache exists |
|
|
106
|
+
| `agentguard approve` | `--action-id <id>` or `--last`, `--once`, `--json` | Approves one existing pending runtime action; never approve without explicit user confirmation |
|
|
107
|
+
| `agentguard approvals list` | `--json` | Lists unexpired pending runtime approvals |
|
|
106
108
|
| `agentguard doctor` | none | Checks local setup and Cloud reachability when connected |
|
|
107
109
|
| `agentguard protect` | `--agent <agent>`, `--action-type <type>`, `--tool-name <name>`, `--session-id <id>`, `--decision-mode <local-first|cloud>`, `--json` | Evaluates one runtime action from stdin or hook environment |
|
|
108
110
|
| `agentguard subscribe` | `--since <iso>`, `--json`, `--quiet`, `--no-report`, `--cron <expr>`, `--cron-target <auto|openclaw|qclaw|hermes|system>`, `--cron-name <name>`, `--force`, `--cron-run`, `--cron-notify-run` | Pulls Cloud threat advisories and optionally self-checks local skills |
|
|
@@ -117,6 +119,8 @@ Connect behavior:
|
|
|
117
119
|
|
|
118
120
|
If the user writes `/agentguard cli <args...>`, execute `agentguard <args...>` directly.
|
|
119
121
|
|
|
122
|
+
When AgentGuard returns `confirm` or a block reason that includes `Approve once ... agentguard approve --action-id ... --once`, do not retry the protected action until the user explicitly approves. Show the exact approval command to the user before running it. Never run an approval command proactively, and never infer approval from context or from the agent's own plan. Treat user replies such as "yes", "approve", "approved", "confirm", "confirmed", "continue", "go ahead", "execute", "run it", "同意", "确认", "批准", "继续", or "执行" as explicit approval for the most recent protected action only after the user has seen the command and understands which action is being approved. After approval, run exactly the provided `agentguard approve --action-id ... --once` command, then retry the original action once. If the action id is unavailable, use `agentguard approvals list --json`; only use `agentguard approve --last --once` when there is exactly one relevant unexpired pending approval. If multiple pending approvals exist, ask the user to choose a specific action id.
|
|
123
|
+
|
|
120
124
|
Do **not** route plain `/agentguard scan`, `/agentguard action`, `/agentguard patrol`, `/agentguard trust`, `/agentguard report`, `/agentguard config`, `/agentguard checkup`, `/agentguard checkup --json`, or natural-language requests like "run agentguard checkup" through the packaged CLI. Those are this skill's higher-level workflows. Only use the packaged CLI checkup path when the user includes `--against-advisory <id>` or explicitly writes `/agentguard cli checkup ...`.
|
|
121
125
|
|
|
122
126
|
If the user writes `/agentguard checkup --against-advisory <id>`, use the CLI command `agentguard checkup --against-advisory <id>` instead of the comprehensive HTML health-report workflow.
|