@gendigital/sage-openclaw 0.9.0 → 0.11.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 (35) hide show
  1. package/README.md +63 -20
  2. package/dist/index.cjs +1073 -653
  3. package/dist/index.cjs.map +4 -4
  4. package/dist/mcp-server.cjs +31776 -0
  5. package/dist/mcp-server.cjs.map +7 -0
  6. package/dist/model-download-worker.cjs +422 -29
  7. package/dist/model-download-worker.cjs.map +4 -4
  8. package/openclaw.plugin.json +1 -1
  9. package/package.json +13 -3
  10. package/resources/skills/security-awareness/SKILL.md +5 -1
  11. package/resources/threats/agent-layer.yaml +186 -0
  12. package/resources/threats/commands.yaml +24 -53
  13. package/resources/threats/credentials.yaml +12 -20
  14. package/resources/threats/dummy.yaml +22 -33
  15. package/resources/threats/files.yaml +34 -53
  16. package/resources/threats/mac-commands.yaml +20 -47
  17. package/resources/threats/mac-credentials.yaml +4 -12
  18. package/resources/threats/mac-files.yaml +5 -15
  19. package/resources/threats/mac-obfuscation.yaml +6 -13
  20. package/resources/threats/mac-persistence.yaml +11 -20
  21. package/resources/threats/mac-supply-chain.yaml +5 -8
  22. package/resources/threats/mitre.yaml +105 -167
  23. package/resources/threats/obfuscation.yaml +7 -15
  24. package/resources/threats/persistence.yaml +10 -17
  25. package/resources/threats/prompt-injection.yaml +94 -44
  26. package/resources/threats/self-defense.yaml +8 -12
  27. package/resources/threats/supply_chain.yaml +1 -2
  28. package/resources/threats/urls.yaml +9 -14
  29. package/resources/threats/win-commands.yaml +46 -106
  30. package/resources/threats/win-credentials.yaml +15 -25
  31. package/resources/threats/win-files.yaml +10 -20
  32. package/resources/threats/win-obfuscation.yaml +21 -37
  33. package/resources/threats/win-persistence.yaml +8 -16
  34. package/resources/threats/win-supply-chain.yaml +2 -3
  35. /package/resources/{allowlists → trusted-domains}/trusted-installer-domains.yaml +0 -0
package/README.md CHANGED
@@ -1,42 +1,85 @@
1
- # @gendigital/sage-openclaw
1
+ # Sage — Safety for Agents
2
2
 
3
- **Safety for Agents** - Agent Detection & Response (ADR) plugin for [OpenClaw](https://openclaw.dev).
3
+ <p align="center">
4
+ <img src="https://raw.githubusercontent.com/gendigitalinc/sage/main/images/logo-shaded.png" alt="Sage" width="250">
5
+ </p>
4
6
 
5
- Sage intercepts tool calls (shell commands, URL fetches, file writes) and checks them against URL reputation services, local heuristic threat rules, and package supply-chain checks before they execute.
7
+ <p align="center">
8
+ Protect your AI coding agent from dangerous commands, malicious URLs, and harmful file operations.
9
+ </p>
6
10
 
7
- ## Installation
11
+ ---
12
+
13
+ <p align="center">
14
+ <img src="https://raw.githubusercontent.com/gendigitalinc/sage/main/images/block-openclaw-allow.gif" alt="Sage blocking a dangerous command in OpenClaw" width="700">
15
+ </p>
16
+
17
+ ## What is Sage?
18
+
19
+ Sage is a security layer for OpenClaw. It intercepts tool calls — shell commands, URL fetches, file writes — and checks them for threats before they execute. If something looks dangerous, Sage blocks it with a native approval dialog.
20
+
21
+
22
+ ## What it protects against
23
+
24
+ - **Malicious URLs** — phishing, malware, and scam sites detected via cloud reputation
25
+ - **Dangerous commands** — reverse shells, pipe-to-curl, credential theft, data exfiltration
26
+ - **Prompt injection** — heuristics + a fine-tuned ML model detect injected instructions in fetched content
27
+ - **Suspicious file operations** — writes to sensitive paths, credential files, system configs
28
+ - **Supply-chain attacks** — malicious or typosquatted npm/PyPI packages
29
+ - **Compromised plugins** — automatic scanning of installed plugins at session start
30
+
31
+ ## Install
32
+
33
+ See the [install guide](https://ai.gendigital.com/sage#install-openclaw) for step-by-step instructions, or run:
8
34
 
9
35
  ```bash
10
36
  openclaw plugins install @gendigital/sage-openclaw
11
37
  ```
12
38
 
13
- ## What It Does
39
+ Sage loads automatically — no configuration needed.
40
+
41
+ > To verify it's working, ask your agent to run `echo __sage_test_deny_cmd_a75bf229__`. Sage should block this harmless canary command.
14
42
 
15
- - Intercepts `exec`, `web_fetch`, `write`, `edit`, `read`, and `apply_patch` tool calls
16
- - Checks URLs against cloud-based malware/phishing detection
17
- - Matches commands and file paths against YAML-based threat definitions
18
- - Validates npm/PyPI packages against supply-chain risks
19
- - Scans installed plugins for threats at session start
20
- - Provides native approval dialogs for interactive approval of flagged actions
43
+ ## What Sage intercepts
44
+
45
+ Sage hooks into OpenClaw's `before_tool_call` lifecycle:
46
+
47
+ - **exec** — shell commands
48
+ - **write / edit** — file modifications
49
+ - **read** — file reads (sensitive paths)
50
+ - **web_fetch** — URL fetches and downloads
51
+ - **apply_patch** — patch application
52
+
53
+ ## How it works
54
+
55
+ When your agent makes a tool call, Sage evaluates it and returns a verdict:
56
+
57
+ | Verdict | What happens |
58
+ |---------|-------------|
59
+ | **Allow** | No threats detected — the action proceeds normally |
60
+ | **Ask** | Suspicious activity — you're prompted via native approval dialog |
61
+ | **Deny** | Threat detected — the action is blocked |
62
+
63
+ Sage is designed to fail open: if anything goes wrong internally, the action proceeds. Your agent is never blocked due to a Sage error.
21
64
 
22
65
  ## Configuration
23
66
 
24
- Sage works out of the box with no configuration. Optional config file at `~/.sage/config.json`:
67
+ Sage works out of the box with no configuration. To customize behavior, edit `~/.sage/config.json`:
25
68
 
26
69
  ```json
27
70
  {
28
71
  "sensitivity": "balanced",
29
72
  "url_check": { "enabled": true },
30
- "file_check": { "enabled": true }
73
+ "heuristics_enabled": true
31
74
  }
32
75
  ```
33
76
 
34
- ## Links
35
-
36
- - [Source & documentation](https://github.com/gendigitalinc/sage)
37
- - [OpenClaw platform guide](https://github.com/gendigitalinc/sage/blob/main/docs/platform-guides/openclaw.md)
38
- - [Privacy policy](https://github.com/gendigitalinc/sage/blob/main/docs/privacy.md)
77
+ See [Configuration](https://github.com/gendigitalinc/sage/blob/main/docs/user-guide.md#configuration) for all options.
39
78
 
40
- ## License
79
+ ## Links
41
80
 
42
- Apache License 2.0 - Copyright 2026 Gen Digital Inc.
81
+ - [User Guide](https://github.com/gendigitalinc/sage/blob/main/docs/user-guide.md) — verify install, handle alerts, manage false positives
82
+ - [Configuration](https://github.com/gendigitalinc/sage/blob/main/docs/user-guide.md#configuration) — all config options
83
+ - [Exceptions](https://github.com/gendigitalinc/sage/blob/main/docs/user-guide.md#exceptions) — pattern-based allow/deny rules
84
+ - [Privacy](https://github.com/gendigitalinc/sage/blob/main/docs/user-guide.md#privacy) — what data is sent, what stays local
85
+ - [GitHub](https://github.com/gendigitalinc/sage)