openhack 0.1.0a1__tar.gz → 0.1.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 (139) hide show
  1. openhack-0.1.1/.env.example +11 -0
  2. openhack-0.1.1/.github/workflows/tests.yml +29 -0
  3. openhack-0.1.1/.gitignore +36 -0
  4. openhack-0.1.1/LICENSE +21 -0
  5. openhack-0.1.1/PKG-INFO +216 -0
  6. openhack-0.1.1/README.md +175 -0
  7. openhack-0.1.1/openhack/__init__.py +2 -0
  8. openhack-0.1.1/openhack/__main__.py +226 -0
  9. openhack-0.1.1/openhack/agents/__init__.py +30 -0
  10. openhack-0.1.1/openhack/agents/base.py +230 -0
  11. openhack-0.1.1/openhack/agents/browser_verifier.py +679 -0
  12. openhack-0.1.1/openhack/agents/browser_verifier_swarm.py +256 -0
  13. openhack-0.1.1/openhack/agents/checkpoint.py +89 -0
  14. openhack-0.1.1/openhack/agents/context_manager.py +356 -0
  15. openhack-0.1.1/openhack/agents/coordinator.py +1105 -0
  16. openhack-0.1.1/openhack/agents/endpoint_analyst.py +307 -0
  17. openhack-0.1.1/openhack/agents/feature_hunter.py +93 -0
  18. openhack-0.1.1/openhack/agents/hunter.py +481 -0
  19. openhack-0.1.1/openhack/agents/hunter_swarm.py +385 -0
  20. openhack-0.1.1/openhack/agents/llm.py +357 -0
  21. openhack-0.1.1/openhack/agents/recon.py +19 -0
  22. openhack-0.1.1/openhack/agents/sandbox_verifier.py +396 -0
  23. openhack-0.1.1/openhack/agents/sandbox_verifier_swarm.py +250 -0
  24. openhack-0.1.1/openhack/agents/session.py +286 -0
  25. openhack-0.1.1/openhack/agents/validator.py +217 -0
  26. openhack-0.1.1/openhack/agents/validator_swarm.py +106 -0
  27. openhack-0.1.1/openhack/auth.py +175 -0
  28. openhack-0.1.1/openhack/browser/__init__.py +12 -0
  29. openhack-0.1.1/openhack/browser/runner.py +385 -0
  30. openhack-0.1.1/openhack/categories.py +130 -0
  31. openhack-0.1.1/openhack/config.py +205 -0
  32. openhack-0.1.1/openhack/deterministic_recon.py +464 -0
  33. openhack-0.1.1/openhack/entry_points.py +745 -0
  34. openhack-0.1.1/openhack/framework_classifier.py +515 -0
  35. openhack-0.1.1/openhack/framework_detection.py +269 -0
  36. openhack-0.1.1/openhack/headless_scan.py +179 -0
  37. openhack-0.1.1/openhack/prompts/__init__.py +108 -0
  38. openhack-0.1.1/openhack/prompts/browser_verifier.py +171 -0
  39. openhack-0.1.1/openhack/prompts/coordinator.py +31 -0
  40. openhack-0.1.1/openhack/prompts/django/__init__.py +32 -0
  41. openhack-0.1.1/openhack/prompts/django/auth_bypass.py +76 -0
  42. openhack-0.1.1/openhack/prompts/django/csrf.py +62 -0
  43. openhack-0.1.1/openhack/prompts/django/data_exposure.py +67 -0
  44. openhack-0.1.1/openhack/prompts/django/idor.py +74 -0
  45. openhack-0.1.1/openhack/prompts/django/injection.py +67 -0
  46. openhack-0.1.1/openhack/prompts/django/misconfiguration.py +70 -0
  47. openhack-0.1.1/openhack/prompts/django/ssrf.py +64 -0
  48. openhack-0.1.1/openhack/prompts/endpoint_analyst.py +122 -0
  49. openhack-0.1.1/openhack/prompts/express/__init__.py +29 -0
  50. openhack-0.1.1/openhack/prompts/express/auth_bypass.py +71 -0
  51. openhack-0.1.1/openhack/prompts/express/data_exposure.py +77 -0
  52. openhack-0.1.1/openhack/prompts/express/idor.py +69 -0
  53. openhack-0.1.1/openhack/prompts/express/injection.py +75 -0
  54. openhack-0.1.1/openhack/prompts/express/misconfiguration.py +72 -0
  55. openhack-0.1.1/openhack/prompts/express/ssrf.py +63 -0
  56. openhack-0.1.1/openhack/prompts/feature_hunter.py +140 -0
  57. openhack-0.1.1/openhack/prompts/flask/__init__.py +29 -0
  58. openhack-0.1.1/openhack/prompts/flask/auth_bypass.py +86 -0
  59. openhack-0.1.1/openhack/prompts/flask/data_exposure.py +78 -0
  60. openhack-0.1.1/openhack/prompts/flask/idor.py +83 -0
  61. openhack-0.1.1/openhack/prompts/flask/injection.py +77 -0
  62. openhack-0.1.1/openhack/prompts/flask/misconfiguration.py +73 -0
  63. openhack-0.1.1/openhack/prompts/flask/ssrf.py +65 -0
  64. openhack-0.1.1/openhack/prompts/hunter.py +362 -0
  65. openhack-0.1.1/openhack/prompts/hunter_continuation_loop.py +12 -0
  66. openhack-0.1.1/openhack/prompts/hunter_continuation_no_findings.py +19 -0
  67. openhack-0.1.1/openhack/prompts/hunter_continuation_no_progress.py +22 -0
  68. openhack-0.1.1/openhack/prompts/hunter_tool_instructions.py +55 -0
  69. openhack-0.1.1/openhack/prompts/nextjs/__init__.py +42 -0
  70. openhack-0.1.1/openhack/prompts/nextjs/auth_bypass.py +80 -0
  71. openhack-0.1.1/openhack/prompts/nextjs/csrf.py +71 -0
  72. openhack-0.1.1/openhack/prompts/nextjs/data_exposure.py +88 -0
  73. openhack-0.1.1/openhack/prompts/nextjs/idor.py +64 -0
  74. openhack-0.1.1/openhack/prompts/nextjs/injection.py +65 -0
  75. openhack-0.1.1/openhack/prompts/nextjs/middleware_bypass.py +75 -0
  76. openhack-0.1.1/openhack/prompts/nextjs/misconfiguration.py +92 -0
  77. openhack-0.1.1/openhack/prompts/nextjs/server_actions.py +97 -0
  78. openhack-0.1.1/openhack/prompts/nextjs/ssrf.py +66 -0
  79. openhack-0.1.1/openhack/prompts/nextjs/xss.py +69 -0
  80. openhack-0.1.1/openhack/prompts/pr_analysis_system.py +80 -0
  81. openhack-0.1.1/openhack/prompts/pr_analysis_user.py +11 -0
  82. openhack-0.1.1/openhack/prompts/project_context.py +89 -0
  83. openhack-0.1.1/openhack/prompts/recon.py +199 -0
  84. openhack-0.1.1/openhack/prompts/reporter.py +88 -0
  85. openhack-0.1.1/openhack/prompts/researchers.py +434 -0
  86. openhack-0.1.1/openhack/prompts/sandbox_verifier.py +128 -0
  87. openhack-0.1.1/openhack/prompts/supabase/__init__.py +39 -0
  88. openhack-0.1.1/openhack/prompts/supabase/auth_tokens.py +131 -0
  89. openhack-0.1.1/openhack/prompts/supabase/edge_functions.py +150 -0
  90. openhack-0.1.1/openhack/prompts/supabase/graphql.py +102 -0
  91. openhack-0.1.1/openhack/prompts/supabase/postgrest.py +99 -0
  92. openhack-0.1.1/openhack/prompts/supabase/realtime.py +93 -0
  93. openhack-0.1.1/openhack/prompts/supabase/rls.py +110 -0
  94. openhack-0.1.1/openhack/prompts/supabase/rpc_functions.py +127 -0
  95. openhack-0.1.1/openhack/prompts/supabase/storage.py +110 -0
  96. openhack-0.1.1/openhack/prompts/supabase/tenant_isolation.py +118 -0
  97. openhack-0.1.1/openhack/prompts/validator.py +319 -0
  98. openhack-0.1.1/openhack/prompts/validator_continuation_incomplete.py +12 -0
  99. openhack-0.1.1/openhack/prompts/validator_tool_instructions.py +29 -0
  100. openhack-0.1.1/openhack/quality.py +231 -0
  101. openhack-0.1.1/openhack/sandbox/__init__.py +12 -0
  102. openhack-0.1.1/openhack/sandbox/orchestrator.py +517 -0
  103. openhack-0.1.1/openhack/sandbox/runner.py +177 -0
  104. openhack-0.1.1/openhack/scan_session.py +245 -0
  105. openhack-0.1.1/openhack/setup.py +461 -0
  106. openhack-0.1.1/openhack/static_validator.py +612 -0
  107. openhack-0.1.1/openhack/tools/__init__.py +1 -0
  108. openhack-0.1.1/openhack/tools/ast_tools.py +307 -0
  109. openhack-0.1.1/openhack/tools/coverage.py +1078 -0
  110. openhack-0.1.1/openhack/tools/filesystem.py +404 -0
  111. openhack-0.1.1/openhack/tools/nextjs.py +258 -0
  112. openhack-0.1.1/openhack/tools/registry.py +52 -0
  113. openhack-0.1.1/openhack/tui.py +3451 -0
  114. openhack-0.1.1/openhack/updates.py +170 -0
  115. openhack-0.1.1/pyproject.toml +76 -0
  116. openhack-0.1.1/scripts/run_browser_verify.py +124 -0
  117. openhack-0.1.1/scripts/run_browser_verify_live.py +167 -0
  118. openhack-0.1.1/scripts/run_feature_hunt.py +295 -0
  119. openhack-0.1.1/scripts/run_sandbox_verify.py +108 -0
  120. openhack-0.1.1/scripts/run_sandbox_verify_live.py +155 -0
  121. openhack-0.1.1/tests/conftest.py +28 -0
  122. openhack-0.1.1/tests/test_categories.py +64 -0
  123. openhack-0.1.1/tests/test_checkpoint.py +126 -0
  124. openhack-0.1.1/tests/test_config.py +53 -0
  125. openhack-0.1.1/tests/test_coverage.py +84 -0
  126. openhack-0.1.1/tests/test_deterministic_recon.py +55 -0
  127. openhack-0.1.1/tests/test_entry_points.py +86 -0
  128. openhack-0.1.1/tests/test_filesystem_tools.py +87 -0
  129. openhack-0.1.1/tests/test_framework_classifier.py +84 -0
  130. openhack-0.1.1/tests/test_quality.py +84 -0
  131. openhack-0.1.1/tests/test_scan_session.py +79 -0
  132. openhack-0.1.1/uv.lock +1937 -0
  133. openhack-0.1.0a1/.gitignore +0 -10
  134. openhack-0.1.0a1/.python-version +0 -1
  135. openhack-0.1.0a1/PKG-INFO +0 -13
  136. openhack-0.1.0a1/README.md +0 -1
  137. openhack-0.1.0a1/pyproject.toml +0 -22
  138. openhack-0.1.0a1/src/openhack/__init__.py +0 -2
  139. /openhack-0.1.0a1/src/openhack/py.typed → /openhack-0.1.1/tests/__init__.py +0 -0
@@ -0,0 +1,11 @@
1
+ # OpenHack API token (long-lived bearer; CLI device-login flow writes this for you).
2
+ # Get one from /settings/api-keys on the dashboard, or run `openhack /login`.
3
+ OPENHACK_API_KEY=
4
+
5
+ # Dev mode: when set to 1, point the CLI at local dev servers
6
+ # app: http://localhost:9080 (Next.js dev)
7
+ # inference: http://localhost:8787 (wrangler dev)
8
+ # Unset (or 0) for production:
9
+ # app: https://app.openhack.com
10
+ # inference: https://api.openhack.com/v1
11
+ # OPENHACK_DEV=0
@@ -0,0 +1,29 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v4
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ run: uv python install ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: uv sync --dev
27
+
28
+ - name: Run tests
29
+ run: uv run python -m pytest tests/ -v
@@ -0,0 +1,36 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ venv/
8
+ env/
9
+ ENV/
10
+ .venv/
11
+ *.egg-info/
12
+ dist/
13
+ build/
14
+ .pytest_cache/
15
+ .coverage
16
+ htmlcov/
17
+ .mypy_cache/
18
+ .dmypy.json
19
+ dmypy.json
20
+
21
+ # Env files
22
+ .env*
23
+ !.env.example
24
+
25
+ # OS
26
+ .DS_Store
27
+
28
+ # IDEs
29
+ .vscode/
30
+ .idea/
31
+ *.swp
32
+ *.swo
33
+ *~
34
+
35
+ # CodeQL databases
36
+ .codeql-dbs/
openhack-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OpenHack
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,216 @@
1
+ Metadata-Version: 2.4
2
+ Name: openhack
3
+ Version: 0.1.1
4
+ Summary: AI-powered security scanner for your codebase. Find SQL injection, XSS, IDOR, auth bypass, and more — straight from your terminal.
5
+ Project-URL: Homepage, https://openhack.com
6
+ Project-URL: Documentation, https://github.com/openhackai/openhack
7
+ Project-URL: Repository, https://github.com/openhackai/openhack
8
+ Project-URL: Issues, https://github.com/openhackai/openhack/issues
9
+ Author: OpenHack
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: ai-security,appsec,code-review,llm,sast,security,static-analysis,vulnerability-scanner
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Security
23
+ Classifier: Topic :: Software Development :: Bug Tracking
24
+ Classifier: Topic :: Software Development :: Quality Assurance
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: aiohttp>=3.9.0
27
+ Requires-Dist: httpx>=0.25.0
28
+ Requires-Dist: openai>=1.0.0
29
+ Requires-Dist: prompt-toolkit>=3.0.0
30
+ Requires-Dist: pydantic-settings>=2.6.0
31
+ Requires-Dist: pydantic>=2.10.0
32
+ Requires-Dist: pygments>=2.19.0
33
+ Requires-Dist: rich>=13.0.0
34
+ Requires-Dist: tree-sitter-javascript>=0.25.0
35
+ Requires-Dist: tree-sitter-python>=0.25.0
36
+ Requires-Dist: tree-sitter-typescript>=0.23.2
37
+ Requires-Dist: tree-sitter>=0.25.2
38
+ Provides-Extra: browser
39
+ Requires-Dist: playwright>=1.40.0; extra == 'browser'
40
+ Description-Content-Type: text/markdown
41
+
42
+ # ⏚ [OpenHack](https://openhack.com)
43
+
44
+ **Open Source Agentic Security Scanner & Verifier for your codebase.**
45
+
46
+ Like Claude Code Security / Codex Security but open source and **exclusively uses open source models**.
47
+
48
+ <p align="center">
49
+ <a href="https://openhack.com"><img src="https://img.shields.io/badge/Website-openhack.com-0969da?style=for-the-badge" alt="Website"></a>
50
+ &nbsp;
51
+ <a href="https://openhack.com/discord"><img src="https://img.shields.io/badge/Discord-Join_Server-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord"></a>
52
+ &nbsp;
53
+ <a href="https://x.com/openhackai"><img src="https://img.shields.io/badge/X-@openhackai-000000?style=for-the-badge&logo=x&logoColor=white" alt="Follow on X"></a>
54
+ </p>
55
+
56
+ <p align="center">
57
+ <a href="https://pypi.org/project/openhack/"><img src="https://img.shields.io/pypi/v/openhack?style=for-the-badge&label=pypi&color=3775A9" alt="PyPI"></a>
58
+ &nbsp;
59
+ <a href="https://github.com/openhackai/openhack/blob/main/LICENSE"><img src="https://img.shields.io/github/license/openhackai/openhack?style=for-the-badge" alt="License"></a>
60
+ </p>
61
+
62
+ ## Get started
63
+
64
+ ```bash
65
+ pipx install openhack
66
+ ```
67
+
68
+ Or with pip:
69
+
70
+ ```bash
71
+ pip install openhack
72
+ ```
73
+
74
+ ## How it works
75
+ OpenHack does `recon` -> `hunting` -> `validation` -> `verification` all in one pipeline to find high quality verified vulnerabilities.
76
+
77
+ **Recon**: Does a deep dive and fully understands your application along with any custom context you give it. Builds a full project model before hunting begins.
78
+
79
+ **Hunter**: Specialized category based hunters get to finding vulnerabilities initially, along with feature based hunters divind deep to find vulnerabilities in risky code areas.
80
+
81
+ **Validation**: Validation agent performs a review of the finding and it's impact and whether it's even valid.
82
+
83
+ **Verification**: Verification agent performs a full browser + sandbox based attack to find verify vulnerabilities in a real docker / DOM environment.
84
+
85
+
86
+ ## Quick start
87
+
88
+ ```bash
89
+ openhack
90
+ ```
91
+
92
+ On first run you'll go through a one-time setup:
93
+
94
+ 1. Pick **Login with OpenHack account** (recommended) — opens a browser, you log in, get **$20 in free credits**, and the CLI gets a token automatically.
95
+ 2. Type `/scan .` to scan the current directory, or `/scan path/to/repo` for somewhere else.
96
+ 3. While scanning, the **Trace tab** shows live agent activity (recon → hunters → validators). When the scan finishes, the **Findings tab** shows everything that was found.
97
+
98
+ ## What it does
99
+
100
+ OpenHack runs a multi-agent pipeline against your codebase:
101
+
102
+ - **Recon** — reads the code, builds a project model
103
+ - **Hunters** — multiple specialized agents look for different vulnerability classes (input validation, access control, data handling, …)
104
+ - **Feature hunters** — deeper passes on specific risk categories (XSS rendering, raw SQL, command exec, etc.)
105
+ - **Validators** — re-read the suspect code to confirm or reject each candidate finding
106
+ - **Sandbox verification** (`/verify sandbox`) *(Beta — requires Docker)* — spins up your app in a Docker container and attempts to exploit each finding with live HTTP requests. Findings that are successfully exploited get a ✓ mark.
107
+ - **Browser verification** (`/verify browser`) *(Beta — requires Docker when combined with sandbox)* — launches a headless browser against the sandboxed app to verify client-side vulnerabilities (XSS, CSRF, DOM-based issues) with real browser execution.
108
+
109
+ > **Docker prerequisite.** Sandbox verification requires Docker Desktop (or any working Docker daemon) installed and running on the machine where the scan runs. Browser verification inherits this when used with sandbox. If Docker isn't running, `/verify sandbox` will fail with a clear error before the scan starts.
110
+
111
+ For every confirmed finding you get: severity, CVSS score, file location, full description, the vulnerable code snippet, and a recommended fix — all rendered with syntax highlighting in the TUI.
112
+
113
+ ## Slash commands
114
+
115
+
116
+ | Command | Description |
117
+ | -------------------------- | -------------------------------------------------------------------------------------------------- |
118
+ | `/scan <path>` | Full scan on a directory (defaults to current dir) |
119
+ | `/pause` · `/resume` | Pause and resume a running scan (Ctrl+C also pauses) |
120
+ | `/cancel` | Permanently cancel a running scan |
121
+ | `/sessions` | Browse and re-load past scans (also supports re-running an aborted scan with `r`) |
122
+ | `/findings` | Re-display findings from last scan |
123
+ | `/copy` | Copy the selected finding (description + vulnerable code + fix) for Codex / Claude Code / OpenCode |
124
+ | `/verify sandbox` *(Beta)* | Spin up a Docker sandbox and exploit-test each finding with live requests |
125
+ | `/verify browser` *(Beta)* | Launch a headless browser to verify client-side vulns (XSS, CSRF, etc.) |
126
+ | `/login` | Re-login to your OpenHack account |
127
+ | `/setup` | Run the setup wizard again |
128
+ | `/config` | Show current config; `/config <key> <value>` to set |
129
+ | `/sidebar` | Show/hide the Findings list sidebar (`Ctrl+B`) |
130
+ | `/cost` | Cost breakdown for the last scan |
131
+ | `/clear` | Clear scan state and return to landing |
132
+ | `/discord` | Open the OpenHack Discord |
133
+ | `/mouse` | Toggle mouse capture (off = native text selection) |
134
+ | `/help` | List commands |
135
+ | `/quit` | Exit |
136
+
137
+
138
+ ## Keyboard shortcuts (Findings tab)
139
+
140
+ - `↑` / `↓` — switch finding
141
+ - `[` · `]` — alternate prev / next
142
+ - Mouse wheel or `PgUp` / `PgDn` — scroll the details pane
143
+ - `y` — yank (copy) selected finding for an AI agent
144
+ - `<` · `>` — resize the sidebar
145
+ - `Ctrl+B` — toggle sidebar
146
+
147
+ ## Keyboard shortcuts (Trace tab)
148
+
149
+ - `↑` / `↓` — switch agent in the sidebar tree
150
+ - `[` · `]` — alternate prev / next agent
151
+ - Mouse wheel or `PgUp` / `PgDn` — scroll the trace
152
+ - `Home` — jump to "All" (full trace)
153
+ - `End` — resume auto-follow-to-bottom
154
+
155
+ ## Selecting text
156
+
157
+ The TUI captures mouse events by default (for scrolling and clicking). To select and copy text natively:
158
+
159
+ - **macOS**: Hold `Option` (⌥) and drag to select, then `Cmd+C` to copy.
160
+ - **Linux / Windows**: Hold `Shift` and drag to select.
161
+ - **Or**: Run `/mouse` to disable mouse capture entirely — the terminal's native selection works normally until you toggle it back on.
162
+
163
+ ## CLI commands (headless)
164
+
165
+ For CI, scripts, or one-off scans where you don't want the TUI:
166
+
167
+ ```bash
168
+ openhack scan /path/to/repo
169
+ ```
170
+
171
+ OpenHack runs the same pipeline as the TUI, prints progress to stdout, writes a JSON report to `~/.openhack/scans/<session-id>.json`, and exits.
172
+
173
+
174
+ | Command | Description |
175
+ | -------------------------- | -------------------------------------------------------- |
176
+ | `openhack` | Launch interactive TUI |
177
+ | `openhack scan [path]` | Full scan, headless (defaults to `.`) |
178
+ | `openhack sessions` | List all saved scans |
179
+ | `openhack resume <id>` | Resume a scan from its last checkpoint |
180
+ | `openhack classify [path]` | Classify frameworks + detect entry points (no LLM calls) |
181
+ | `openhack login` | Log in to your OpenHack account |
182
+ | `openhack setup` | Run the setup wizard |
183
+ | `openhack --help` | Show usage |
184
+
185
+
186
+ Scans are checkpointed after each pipeline stage. If a scan is interrupted or fails, resume it:
187
+
188
+ ```bash
189
+ openhack resume <session-id>
190
+ ```
191
+
192
+ ## Configuration
193
+
194
+ Configuration is stored in `~/.openhack/config` (mode `0600` since it contains a bearer token) and persists across sessions.
195
+
196
+ You can override at runtime via environment variables:
197
+
198
+
199
+ | Variable | Effect |
200
+ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
201
+ | `OPENHACK_API_KEY` | Bearer token for the OpenHack inference API |
202
+ | `OPENHACK_DEV=1` | Point the CLI at local dev servers (app on `:9080`, inference on `:8787`) for self-hosted setups |
203
+ | `PROMPT_CACHING=0` | Stop sending `prompt_cache_key` with API calls — needed for OpenAI-compatible endpoints that reject it (also: `/config prompt_caching false`) |
204
+
205
+
206
+ ## Privacy
207
+
208
+ OpenHack reads and processes your source code **locally** — prompts are built on your machine. Only LLM tokens (not raw source files) are forwarded to the OpenHack inference API. No source code is uploaded or retained.
209
+
210
+ ## Contributing
211
+
212
+ OpenHack is open source. Issues and PRs welcome on [GitHub](https://github.com/openhackai/openhack).
213
+
214
+ ## License
215
+
216
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,175 @@
1
+ # ⏚ [OpenHack](https://openhack.com)
2
+
3
+ **Open Source Agentic Security Scanner & Verifier for your codebase.**
4
+
5
+ Like Claude Code Security / Codex Security but open source and **exclusively uses open source models**.
6
+
7
+ <p align="center">
8
+ <a href="https://openhack.com"><img src="https://img.shields.io/badge/Website-openhack.com-0969da?style=for-the-badge" alt="Website"></a>
9
+ &nbsp;
10
+ <a href="https://openhack.com/discord"><img src="https://img.shields.io/badge/Discord-Join_Server-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord"></a>
11
+ &nbsp;
12
+ <a href="https://x.com/openhackai"><img src="https://img.shields.io/badge/X-@openhackai-000000?style=for-the-badge&logo=x&logoColor=white" alt="Follow on X"></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://pypi.org/project/openhack/"><img src="https://img.shields.io/pypi/v/openhack?style=for-the-badge&label=pypi&color=3775A9" alt="PyPI"></a>
17
+ &nbsp;
18
+ <a href="https://github.com/openhackai/openhack/blob/main/LICENSE"><img src="https://img.shields.io/github/license/openhackai/openhack?style=for-the-badge" alt="License"></a>
19
+ </p>
20
+
21
+ ## Get started
22
+
23
+ ```bash
24
+ pipx install openhack
25
+ ```
26
+
27
+ Or with pip:
28
+
29
+ ```bash
30
+ pip install openhack
31
+ ```
32
+
33
+ ## How it works
34
+ OpenHack does `recon` -> `hunting` -> `validation` -> `verification` all in one pipeline to find high quality verified vulnerabilities.
35
+
36
+ **Recon**: Does a deep dive and fully understands your application along with any custom context you give it. Builds a full project model before hunting begins.
37
+
38
+ **Hunter**: Specialized category based hunters get to finding vulnerabilities initially, along with feature based hunters divind deep to find vulnerabilities in risky code areas.
39
+
40
+ **Validation**: Validation agent performs a review of the finding and it's impact and whether it's even valid.
41
+
42
+ **Verification**: Verification agent performs a full browser + sandbox based attack to find verify vulnerabilities in a real docker / DOM environment.
43
+
44
+
45
+ ## Quick start
46
+
47
+ ```bash
48
+ openhack
49
+ ```
50
+
51
+ On first run you'll go through a one-time setup:
52
+
53
+ 1. Pick **Login with OpenHack account** (recommended) — opens a browser, you log in, get **$20 in free credits**, and the CLI gets a token automatically.
54
+ 2. Type `/scan .` to scan the current directory, or `/scan path/to/repo` for somewhere else.
55
+ 3. While scanning, the **Trace tab** shows live agent activity (recon → hunters → validators). When the scan finishes, the **Findings tab** shows everything that was found.
56
+
57
+ ## What it does
58
+
59
+ OpenHack runs a multi-agent pipeline against your codebase:
60
+
61
+ - **Recon** — reads the code, builds a project model
62
+ - **Hunters** — multiple specialized agents look for different vulnerability classes (input validation, access control, data handling, …)
63
+ - **Feature hunters** — deeper passes on specific risk categories (XSS rendering, raw SQL, command exec, etc.)
64
+ - **Validators** — re-read the suspect code to confirm or reject each candidate finding
65
+ - **Sandbox verification** (`/verify sandbox`) *(Beta — requires Docker)* — spins up your app in a Docker container and attempts to exploit each finding with live HTTP requests. Findings that are successfully exploited get a ✓ mark.
66
+ - **Browser verification** (`/verify browser`) *(Beta — requires Docker when combined with sandbox)* — launches a headless browser against the sandboxed app to verify client-side vulnerabilities (XSS, CSRF, DOM-based issues) with real browser execution.
67
+
68
+ > **Docker prerequisite.** Sandbox verification requires Docker Desktop (or any working Docker daemon) installed and running on the machine where the scan runs. Browser verification inherits this when used with sandbox. If Docker isn't running, `/verify sandbox` will fail with a clear error before the scan starts.
69
+
70
+ For every confirmed finding you get: severity, CVSS score, file location, full description, the vulnerable code snippet, and a recommended fix — all rendered with syntax highlighting in the TUI.
71
+
72
+ ## Slash commands
73
+
74
+
75
+ | Command | Description |
76
+ | -------------------------- | -------------------------------------------------------------------------------------------------- |
77
+ | `/scan <path>` | Full scan on a directory (defaults to current dir) |
78
+ | `/pause` · `/resume` | Pause and resume a running scan (Ctrl+C also pauses) |
79
+ | `/cancel` | Permanently cancel a running scan |
80
+ | `/sessions` | Browse and re-load past scans (also supports re-running an aborted scan with `r`) |
81
+ | `/findings` | Re-display findings from last scan |
82
+ | `/copy` | Copy the selected finding (description + vulnerable code + fix) for Codex / Claude Code / OpenCode |
83
+ | `/verify sandbox` *(Beta)* | Spin up a Docker sandbox and exploit-test each finding with live requests |
84
+ | `/verify browser` *(Beta)* | Launch a headless browser to verify client-side vulns (XSS, CSRF, etc.) |
85
+ | `/login` | Re-login to your OpenHack account |
86
+ | `/setup` | Run the setup wizard again |
87
+ | `/config` | Show current config; `/config <key> <value>` to set |
88
+ | `/sidebar` | Show/hide the Findings list sidebar (`Ctrl+B`) |
89
+ | `/cost` | Cost breakdown for the last scan |
90
+ | `/clear` | Clear scan state and return to landing |
91
+ | `/discord` | Open the OpenHack Discord |
92
+ | `/mouse` | Toggle mouse capture (off = native text selection) |
93
+ | `/help` | List commands |
94
+ | `/quit` | Exit |
95
+
96
+
97
+ ## Keyboard shortcuts (Findings tab)
98
+
99
+ - `↑` / `↓` — switch finding
100
+ - `[` · `]` — alternate prev / next
101
+ - Mouse wheel or `PgUp` / `PgDn` — scroll the details pane
102
+ - `y` — yank (copy) selected finding for an AI agent
103
+ - `<` · `>` — resize the sidebar
104
+ - `Ctrl+B` — toggle sidebar
105
+
106
+ ## Keyboard shortcuts (Trace tab)
107
+
108
+ - `↑` / `↓` — switch agent in the sidebar tree
109
+ - `[` · `]` — alternate prev / next agent
110
+ - Mouse wheel or `PgUp` / `PgDn` — scroll the trace
111
+ - `Home` — jump to "All" (full trace)
112
+ - `End` — resume auto-follow-to-bottom
113
+
114
+ ## Selecting text
115
+
116
+ The TUI captures mouse events by default (for scrolling and clicking). To select and copy text natively:
117
+
118
+ - **macOS**: Hold `Option` (⌥) and drag to select, then `Cmd+C` to copy.
119
+ - **Linux / Windows**: Hold `Shift` and drag to select.
120
+ - **Or**: Run `/mouse` to disable mouse capture entirely — the terminal's native selection works normally until you toggle it back on.
121
+
122
+ ## CLI commands (headless)
123
+
124
+ For CI, scripts, or one-off scans where you don't want the TUI:
125
+
126
+ ```bash
127
+ openhack scan /path/to/repo
128
+ ```
129
+
130
+ OpenHack runs the same pipeline as the TUI, prints progress to stdout, writes a JSON report to `~/.openhack/scans/<session-id>.json`, and exits.
131
+
132
+
133
+ | Command | Description |
134
+ | -------------------------- | -------------------------------------------------------- |
135
+ | `openhack` | Launch interactive TUI |
136
+ | `openhack scan [path]` | Full scan, headless (defaults to `.`) |
137
+ | `openhack sessions` | List all saved scans |
138
+ | `openhack resume <id>` | Resume a scan from its last checkpoint |
139
+ | `openhack classify [path]` | Classify frameworks + detect entry points (no LLM calls) |
140
+ | `openhack login` | Log in to your OpenHack account |
141
+ | `openhack setup` | Run the setup wizard |
142
+ | `openhack --help` | Show usage |
143
+
144
+
145
+ Scans are checkpointed after each pipeline stage. If a scan is interrupted or fails, resume it:
146
+
147
+ ```bash
148
+ openhack resume <session-id>
149
+ ```
150
+
151
+ ## Configuration
152
+
153
+ Configuration is stored in `~/.openhack/config` (mode `0600` since it contains a bearer token) and persists across sessions.
154
+
155
+ You can override at runtime via environment variables:
156
+
157
+
158
+ | Variable | Effect |
159
+ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
160
+ | `OPENHACK_API_KEY` | Bearer token for the OpenHack inference API |
161
+ | `OPENHACK_DEV=1` | Point the CLI at local dev servers (app on `:9080`, inference on `:8787`) for self-hosted setups |
162
+ | `PROMPT_CACHING=0` | Stop sending `prompt_cache_key` with API calls — needed for OpenAI-compatible endpoints that reject it (also: `/config prompt_caching false`) |
163
+
164
+
165
+ ## Privacy
166
+
167
+ OpenHack reads and processes your source code **locally** — prompts are built on your machine. Only LLM tokens (not raw source files) are forwarded to the OpenHack inference API. No source code is uploaded or retained.
168
+
169
+ ## Contributing
170
+
171
+ OpenHack is open source. Issues and PRs welcome on [GitHub](https://github.com/openhackai/openhack).
172
+
173
+ ## License
174
+
175
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,2 @@
1
+ """OpenHack Agent - Interactive TUI for vulnerability scanning."""
2
+ __version__ = "0.1.1"