@goplus/agentguard 1.1.26 → 1.1.28-beta.0

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.
Files changed (69) hide show
  1. package/dist/action/detectors/exec.d.ts.map +1 -1
  2. package/dist/action/detectors/exec.js +13 -23
  3. package/dist/action/detectors/exec.js.map +1 -1
  4. package/dist/action/index.d.ts +4 -0
  5. package/dist/action/index.d.ts.map +1 -1
  6. package/dist/action/index.js +44 -5
  7. package/dist/action/index.js.map +1 -1
  8. package/dist/adapters/claude-code.d.ts.map +1 -1
  9. package/dist/adapters/claude-code.js +7 -2
  10. package/dist/adapters/claude-code.js.map +1 -1
  11. package/dist/adapters/common.d.ts.map +1 -1
  12. package/dist/adapters/common.js +1 -0
  13. package/dist/adapters/common.js.map +1 -1
  14. package/dist/adapters/hermes.d.ts.map +1 -1
  15. package/dist/adapters/hermes.js +12 -2
  16. package/dist/adapters/hermes.js.map +1 -1
  17. package/dist/adapters/openclaw-plugin.d.ts.map +1 -1
  18. package/dist/adapters/openclaw-plugin.js +30 -10
  19. package/dist/adapters/openclaw-plugin.js.map +1 -1
  20. package/dist/adapters/openclaw.d.ts.map +1 -1
  21. package/dist/adapters/openclaw.js +6 -0
  22. package/dist/adapters/openclaw.js.map +1 -1
  23. package/dist/installers.js +33 -23
  24. package/dist/installers.js.map +1 -1
  25. package/dist/mcp-server.js +2 -2
  26. package/dist/mcp-server.js.map +1 -1
  27. package/dist/runtime/approvals.d.ts.map +1 -1
  28. package/dist/runtime/approvals.js +13 -2
  29. package/dist/runtime/approvals.js.map +1 -1
  30. package/dist/runtime/evaluator.d.ts.map +1 -1
  31. package/dist/runtime/evaluator.js +72 -4
  32. package/dist/runtime/evaluator.js.map +1 -1
  33. package/dist/runtime/protect.d.ts.map +1 -1
  34. package/dist/runtime/protect.js +38 -9
  35. package/dist/runtime/protect.js.map +1 -1
  36. package/dist/runtime/self-command.d.ts.map +1 -1
  37. package/dist/runtime/self-command.js +23 -1
  38. package/dist/runtime/self-command.js.map +1 -1
  39. package/dist/runtime/types.d.ts +1 -1
  40. package/dist/runtime/types.d.ts.map +1 -1
  41. package/dist/tests/action.test.js +8 -0
  42. package/dist/tests/action.test.js.map +1 -1
  43. package/dist/tests/adapter.test.js +21 -7
  44. package/dist/tests/adapter.test.js.map +1 -1
  45. package/dist/tests/cli-checkup.test.js +1 -1
  46. package/dist/tests/cli-checkup.test.js.map +1 -1
  47. package/dist/tests/cli-init.test.js +12 -2
  48. package/dist/tests/cli-init.test.js.map +1 -1
  49. package/dist/tests/installer.test.js +35 -0
  50. package/dist/tests/installer.test.js.map +1 -1
  51. package/dist/tests/integration.test.js +22 -0
  52. package/dist/tests/integration.test.js.map +1 -1
  53. package/dist/tests/runtime-cloud.test.js +241 -2
  54. package/dist/tests/runtime-cloud.test.js.map +1 -1
  55. package/dist/tests/smoke.test.js +8 -1
  56. package/dist/tests/smoke.test.js.map +1 -1
  57. package/dist/types/action.d.ts +8 -2
  58. package/dist/types/action.d.ts.map +1 -1
  59. package/docs/SECURITY-POLICY.md +1 -1
  60. package/docs/claude-code.md +2 -1
  61. package/docs/codex.md +3 -2
  62. package/docs/hermes.md +6 -2
  63. package/docs/openclaw.md +3 -2
  64. package/package.json +1 -1
  65. package/skills/agentguard/README.md +3 -2
  66. package/skills/agentguard/SKILL.md +3 -2
  67. package/skills/agentguard/hermes-hooks.yaml +4 -1
  68. package/skills/agentguard/scripts/action-cli.js +6 -0
  69. package/skills/agentguard/scripts/hermes-hook.js +1 -0
package/docs/codex.md CHANGED
@@ -44,7 +44,8 @@ approval and includes an approval command:
44
44
  agentguard approve --action-id act_local_... --once
45
45
  ```
46
46
 
47
- Run that command only after the user explicitly approves, then retry the
48
- original action once. If the action id was not visible, inspect
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
49
50
  `agentguard approvals list --json`; use `agentguard approve --last --once`
50
51
  only when there is exactly one relevant unexpired pending approval.
package/docs/hermes.md CHANGED
@@ -29,7 +29,10 @@ hooks:
29
29
  - matcher: "write_file|patch|skill_manage"
30
30
  command: "node \"/path/to/agentguard/skills/agentguard/scripts/hermes-hook.js\""
31
31
  timeout: 10
32
- - matcher: "web_search|web_extract|browser_navigate"
32
+ - matcher: "web_search"
33
+ command: "node \"/path/to/agentguard/skills/agentguard/scripts/hermes-hook.js\""
34
+ timeout: 10
35
+ - matcher: "web_extract|browser_navigate"
33
36
  command: "node \"/path/to/agentguard/skills/agentguard/scripts/hermes-hook.js\""
34
37
  timeout: 10
35
38
 
@@ -55,7 +58,8 @@ or set `hooks_auto_accept: true` in `~/.hermes/config.yaml`.
55
58
  | `terminal`, `execute_code` | `exec_command` |
56
59
  | `write_file`, `patch`, `skill_manage` | `write_file` |
57
60
  | `read_file` | `read_file` |
58
- | `web_search`, `web_extract`, `browser_navigate` | `network_request` |
61
+ | `web_search` | `web_search` |
62
+ | `web_extract`, `browser_navigate` | `network_request` |
59
63
 
60
64
  ## Decisions
61
65
 
package/docs/openclaw.md CHANGED
@@ -56,8 +56,9 @@ approval. The block reason includes:
56
56
  agentguard approve --action-id act_local_... --once
57
57
  ```
58
58
 
59
- Run that command only after the user explicitly approves, then retry the
60
- original action once. If the action id was not visible in the OpenClaw message,
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,
61
62
  inspect pending approvals first:
62
63
 
63
64
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goplus/agentguard",
3
- "version": "1.1.26",
3
+ "version": "1.1.28-beta.0",
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",
@@ -28,8 +28,9 @@ AI Agent Security Guard — protect your AI agents from dangerous commands, data
28
28
 
29
29
  When installed from SkillHub, Hermes sees the contents of this
30
30
  `skills/agentguard` directory first. Runtime hooks are not loaded from
31
- `SKILL.md` automatically; copy `hermes-hooks.yaml` into `~/.hermes/config.yaml`
32
- and replace `AGENTGUARD_SKILL_DIR` with this skill's absolute path.
31
+ `SKILL.md` automatically. Run `agentguard init --agent hermes` to install this
32
+ skill into `HERMES_HOME` or `~/.hermes` and merge the hook entries into
33
+ `config.yaml`. The `hermes-hooks.yaml` file remains available for manual setups.
33
34
 
34
35
  The hook runner is `scripts/hermes-hook.js`. It uses the published
35
36
  `@goplus/agentguard` package, so run `npm install` inside this skill directory
@@ -119,7 +119,7 @@ Connect behavior:
119
119
 
120
120
  If the user writes `/agentguard cli <args...>`, execute `agentguard <args...>` directly.
121
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. 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. 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.
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
123
 
124
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 ...`.
125
125
 
@@ -142,7 +142,8 @@ template at `hermes-hooks.yaml`.
142
142
  | `pre_tool_call` | `terminal`, `execute_code` | `exec_command` |
143
143
  | `pre_tool_call` | `write_file`, `patch`, `skill_manage` | `write_file` |
144
144
  | `pre_tool_call` | `read_file` | `read_file` |
145
- | `pre_tool_call` | `web_search`, `web_extract`, `browser_navigate`, `browser_open`, `web_open`, `open_url`, `visit_url`, `open` | `network_request` |
145
+ | `pre_tool_call` | `web_search` | `web_search` |
146
+ | `pre_tool_call` | `web_extract`, `browser_navigate`, `browser_open`, `web_open`, `open_url`, `visit_url`, `open` | `network_request` |
146
147
  | `post_tool_call` | Same tools | Audit-only |
147
148
 
148
149
  Hermes `pre_tool_call` supports allow/block only. If AgentGuard returns `ask`,
@@ -19,7 +19,10 @@ hooks:
19
19
  - matcher: "read_file"
20
20
  command: "node \"AGENTGUARD_SKILL_DIR/scripts/hermes-hook.js\""
21
21
  timeout: 10
22
- - matcher: "web_search|web_extract|browser_navigate|browser_open|web_open|open_url|visit_url|open"
22
+ - matcher: "web_search"
23
+ command: "node \"AGENTGUARD_SKILL_DIR/scripts/hermes-hook.js\""
24
+ timeout: 10
25
+ - matcher: "web_extract|browser_navigate|browser_open|web_open|open_url|visit_url|open"
23
26
  command: "node \"AGENTGUARD_SKILL_DIR/scripts/hermes-hook.js\""
24
27
  timeout: 10
25
28
 
@@ -150,6 +150,12 @@ function buildEnvelope() {
150
150
  };
151
151
  break;
152
152
 
153
+ case 'web_search':
154
+ data = {
155
+ query: getArg('query') || getArg('q') || '',
156
+ };
157
+ break;
158
+
153
159
  case 'secret_access':
154
160
  data = {
155
161
  secret_name: getArg('secret-name') || '',
@@ -182,6 +182,7 @@ function runtimeActionTypeFrom(toolName) {
182
182
  case 'read_file':
183
183
  return 'file_read';
184
184
  case 'web_search':
185
+ return 'web_search';
185
186
  case 'web_extract':
186
187
  case 'browser_navigate':
187
188
  case 'browser_open':