openclaw-inspector 1.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Taras Lukavyi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,136 @@
1
+ # OpenClaw Inspector 🔍
2
+
3
+ **Your AI agent has full access to your machine. Are you sure it's behaving?**
4
+
5
+ [OpenClaw](https://openclaw.ai) (and Clawdbot) can run shell commands, edit files, push to git, install packages, access your camera, take screenshots — essentially do *anything* on your system. It runs autonomously in background sessions, cron jobs, and sub-agents. Most of the time, you never see what it does.
6
+
7
+ **OpenClaw Inspector** lets you see everything. It's a local web app that reads your bot's session history and shows you exactly what happened — every command, every file edit, every tool call. It automatically flags dangerous actions so you can catch problems before they escalate.
8
+
9
+ ## When you need this
10
+
11
+ - 🤔 **"What did my bot do while I was away?"** — Browse all sessions including deleted ones
12
+ - 🚨 **"Did it run anything dangerous?"** — Auto-detects `rm -rf`, `git push --force`, `sudo`, config edits, secret exposure, and more
13
+ - 📱 **"Did it access my camera/screen?"** — Flags surveillance actions (screenshots, camera, location tracking)
14
+ - 📊 **"I have 100+ sessions, how do I review them all?"** — Track read progress, filter by status, mark sessions as reviewed
15
+ - 🔄 **"I want to monitor in real-time"** — Live updates via SSE, toast notifications for new messages
16
+
17
+ ## Quick start
18
+
19
+ ```bash
20
+ npx openclaw-inspector
21
+ ```
22
+
23
+ Opens at http://localhost:9100. That's it.
24
+
25
+ ### Custom port
26
+
27
+ ```bash
28
+ PORT=9101 npx openclaw-inspector
29
+ ```
30
+
31
+ ### Custom sessions directory
32
+
33
+ ```bash
34
+ SESSIONS_DIR=~/.openclaw/agents/main/sessions npx openclaw-inspector
35
+ ```
36
+
37
+ ## What it detects
38
+
39
+ | Category | Examples | Severity |
40
+ |----------|----------|----------|
41
+ | **Destructive filesystem** | `rm -rf`, `shred`, `find -delete` | 🔴 Critical |
42
+ | **Git destructive** | `git push --force`, `git reset --hard`, `git clean -f` | 🔴 Critical |
43
+ | **Repo/account actions** | `gh repo delete`, `gh repo edit --visibility public` | 🔴 Critical |
44
+ | **Config changes** | `sed -i`, writing to `.env`, `.ssh/`, `.zshrc` | 🟡 Warning |
45
+ | **Package/system** | `sudo`, `brew uninstall`, `chmod 777` | 🟡 Warning |
46
+ | **Process killing** | `kill -9`, `killall`, `pkill` | 🟡 Warning |
47
+ | **Secrets/network** | `curl -X POST`, exported tokens/passwords | 🟡 Warning |
48
+ | **Surveillance** | Screenshots, camera access, screen recording, location | 🟡 Warning |
49
+ | **Cron changes** | `crontab`, `launchctl`, `systemctl` | 🟡 Warning |
50
+
51
+ Rules are fully customizable — edit `~/.openclaw-inspector/danger-rules.json`.
52
+
53
+ ## Features
54
+
55
+ - **Multi-axis filtering** — filter by review status (unread/in progress/reviewed), session type (active/orphan/deleted), and danger level — all combinable
56
+ - **Read progress tracking** — click any message to mark everything up to that point as reviewed; a blue divider shows where you left off
57
+ - **Live updates** — new messages and sessions appear automatically with toast notifications
58
+ - **Tool call previews** — see URLs, file paths, search queries, and commands inline without expanding
59
+ - **Session renaming** — click the title to give any session a custom label
60
+ - **Message search** — full-text search within a session
61
+ - **Mobile responsive** — works on phones and tablets
62
+ - **State persistence** — all filters, sort order, and UI state saved in localStorage
63
+
64
+ ## Live monitoring
65
+
66
+ Inspector watches your sessions directory in real-time. When your bot starts a new conversation, receives a message, or runs a tool — it appears instantly in the UI. No need to refresh the page.
67
+
68
+ - New sessions appear in the sidebar automatically
69
+ - New messages stream into the currently open session
70
+ - Toast notifications show activity in other sessions
71
+ - Works for background sessions, cron jobs, and sub-agents too
72
+
73
+ ## Privacy & security
74
+
75
+ - 🔒 **100% local** — everything runs on your machine. No cloud, no telemetry, no external connections
76
+ - 📁 **Read-only** — Inspector never modifies, deletes, or interferes with your sessions. It only reads JSONL files from disk
77
+ - 🏠 **Localhost only** — server binds to `127.0.0.1` by default, inaccessible from the network
78
+ - 💾 **Your data stays yours** — progress and settings stored in `~/.openclaw-inspector/`, never sent anywhere
79
+
80
+ ## Configuration
81
+
82
+ ### Environment variables
83
+
84
+ | Variable | Default | Description |
85
+ |----------|---------|-------------|
86
+ | `PORT` | `9100` | Server port |
87
+ | `HOST` | `127.0.0.1` | Bind address (localhost only by default) |
88
+ | `SESSIONS_DIR` | auto-detect (`~/.openclaw/` or `~/.clawdbot/`) | Path to session JSONL files |
89
+ | `DATA_DIR` | `~/.openclaw-inspector` | User config and progress storage |
90
+
91
+ ### User data (`~/.openclaw-inspector/`)
92
+
93
+ Created automatically on first launch:
94
+
95
+ - `danger-rules.json` — danger detection rules (customize freely, won't be overwritten on updates)
96
+ - `progress.json` — read progress (persists across devices if you sync the folder)
97
+
98
+ ### Remote access via Tailscale
99
+
100
+ To access Inspector from your phone or another device:
101
+
102
+ ```bash
103
+ # Serve local port via Tailscale HTTPS
104
+ tailscale serve https:9100 / http://localhost:9100
105
+ ```
106
+
107
+ Then open `https://your-machine.tailnet.ts.net:9100` from any device on your tailnet.
108
+
109
+ ## Development
110
+
111
+ ```bash
112
+ git clone https://github.com/Lukavyi/openclaw-inspector.git
113
+ cd openclaw-inspector
114
+ npm install
115
+
116
+ # Terminal 1: Backend
117
+ node server.js
118
+
119
+ # Terminal 2: Vite dev server with HMR
120
+ npm run dev
121
+ ```
122
+
123
+ Open http://localhost:5173 (proxies API to backend).
124
+
125
+ ```bash
126
+ npm test # Unit tests (Vitest)
127
+ npm run build # Production build → dist/
128
+ ```
129
+
130
+ ## Built with OpenClaw 🤖
131
+
132
+ This entire project was vibe-coded through [OpenClaw](https://openclaw.ai) — from the first line of code to npm publish. No manual coding involved. The irony of an AI agent building its own inspector is not lost on us.
133
+
134
+ ## License
135
+
136
+ MIT
@@ -0,0 +1,110 @@
1
+ {
2
+ "rules": [
3
+ {
4
+ "category": "destructive-fs",
5
+ "severity": "critical",
6
+ "label": "Destructive filesystem",
7
+ "patterns": [
8
+ "rm\\s+(-[a-zA-Z]*r[a-zA-Z]*|--recursive)",
9
+ "rm\\s+(-[a-zA-Z]*f[a-zA-Z]*)",
10
+ "rmdir\\s",
11
+ "shred\\s",
12
+ "unlink\\s",
13
+ "find\\s.*-delete",
14
+ "find\\s.*-exec\\s+rm"
15
+ ]
16
+ },
17
+ {
18
+ "category": "git-destructive",
19
+ "severity": "critical",
20
+ "label": "Git destructive",
21
+ "patterns": [
22
+ "git\\s+push\\s+(-[a-zA-Z]*f|--force)",
23
+ "git\\s+reset\\s+--hard",
24
+ "git\\s+clean\\s+(-[a-zA-Z]*f)",
25
+ "git\\s+checkout\\s+--\\s+\\.",
26
+ "git\\s+branch\\s+(-[a-zA-Z]*[dD])"
27
+ ]
28
+ },
29
+ {
30
+ "category": "repo-actions",
31
+ "severity": "critical",
32
+ "label": "Repo/account actions",
33
+ "patterns": [
34
+ "gh\\s+repo\\s+delete",
35
+ "gh\\s+repo\\s+edit\\s+--visibility\\s+public",
36
+ "gh\\s+issue\\s+delete",
37
+ "gh\\s+pr\\s+close"
38
+ ]
39
+ },
40
+ {
41
+ "category": "config-changes",
42
+ "severity": "warning",
43
+ "label": "Config changes",
44
+ "patterns": [
45
+ "\\b(nano|vim|vi|code|edit)\\s+.*\\.(env|json|ya?ml|toml|conf|cfg|ini)\\b",
46
+ "\\bsed\\s+(-[a-zA-Z]*i)",
47
+ "\\b(cat|echo|printf)\\s.*>\\s*.*\\.(env|json|ya?ml|toml|conf|cfg)",
48
+ "\\.ssh/",
49
+ "\\.gitconfig",
50
+ "\\.zshrc",
51
+ "\\.zprofile",
52
+ "\\.bashrc"
53
+ ]
54
+ },
55
+ {
56
+ "category": "package-system",
57
+ "severity": "warning",
58
+ "label": "Package/system changes",
59
+ "patterns": [
60
+ "brew\\s+(uninstall|remove)",
61
+ "npm\\s+(uninstall|remove)\\s+-g",
62
+ "pip\\s+uninstall",
63
+ "chmod\\s+(777|666|000)",
64
+ "chown\\s",
65
+ "sudo\\s"
66
+ ]
67
+ },
68
+ {
69
+ "category": "process-kill",
70
+ "severity": "warning",
71
+ "label": "Process killing",
72
+ "patterns": [
73
+ "kill\\s+(-9|-SIGKILL)",
74
+ "killall\\s",
75
+ "pkill\\s"
76
+ ]
77
+ },
78
+ {
79
+ "category": "secrets-network",
80
+ "severity": "warning",
81
+ "label": "Secrets/network",
82
+ "patterns": [
83
+ "curl\\s.*(-X\\s*POST|-d\\s)",
84
+ "(token|secret|password|api.?key)=\\S+",
85
+ "\\bexport\\s+(TOKEN|SECRET|API_KEY|PASSWORD)"
86
+ ]
87
+ },
88
+ {
89
+ "category": "cron-changes",
90
+ "severity": "warning",
91
+ "label": "Cron changes",
92
+ "patterns": [
93
+ "crontab\\s",
94
+ "launchctl\\s+(load|unload|remove)",
95
+ "systemctl\\s+(enable|disable|stop)"
96
+ ]
97
+ },
98
+ {
99
+ "category": "surveillance",
100
+ "severity": "warning",
101
+ "label": "Surveillance/privacy",
102
+ "toolRules": [
103
+ { "toolName": "browser", "actions": ["screenshot", "snapshot"] },
104
+ { "toolName": "nodes", "actions": ["camera_snap", "camera_clip", "camera_list", "screen_record", "location_get"] },
105
+ { "toolName": "image", "actions": null },
106
+ { "toolName": "peekaboo", "actions": null }
107
+ ]
108
+ }
109
+ ]
110
+ }