Skip to main content

AI-powered security scanner for your codebase. Find SQL injection, XSS, IDOR, auth bypass, and more — straight from your terminal.

Project description

OpenHack

Open Source Agentic Security Scanner & Verifier for your codebase.

Like Claude Code Security / Codex Security but open source and exclusively uses open source models.

Website   Discord   Follow on X

PyPI   License

Get started

pipx install openhack

Or with uv:

uv tool install openhack

Or with pip:

pip install openhack

How it works

OpenHack does recon -> hunting -> validation -> verification all in one pipeline to find high quality verified vulnerabilities.

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.

Hunter: Specialized category based hunters get to finding vulnerabilities initially, along with feature based hunters divind deep to find vulnerabilities in risky code areas.

Validation: Validation agent performs a review of the finding and it's impact and whether it's even valid.

Verification: Verification agent performs a full browser + sandbox based attack to find verify vulnerabilities in a real docker / DOM environment.

Quick start

openhack

On first run you'll go through a one-time setup:

  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.
  2. Type /scan . to scan the current directory, or /scan path/to/repo for somewhere else.
  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.

What it does

OpenHack runs a multi-agent pipeline against your codebase:

  • Recon — reads the code, builds a project model
  • Hunters — multiple specialized agents look for different vulnerability classes (input validation, access control, data handling, …)
  • Feature hunters — deeper passes on specific risk categories (XSS rendering, raw SQL, command exec, etc.)
  • Validators — re-read the suspect code to confirm or reject each candidate finding
  • 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.
  • 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.

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.

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.

Slash commands

Command Description
/scan <path> Full scan on a directory (defaults to current dir)
/pause · /resume Pause and resume a running scan (Ctrl+C also pauses)
/cancel Permanently cancel a running scan
/sessions Browse and re-load past scans (also supports re-running an aborted scan with r)
/findings Re-display findings from last scan
/copy Copy the selected finding (description + vulnerable code + fix) for Codex / Claude Code / Cursor
/verify sandbox (Beta) Spin up a Docker sandbox and exploit-test each finding with live requests
/verify browser (Beta) Launch a headless browser to verify client-side vulns (XSS, CSRF, etc.)
/login Re-login to your OpenHack account
/setup Run the setup wizard again
/connect [provider] Connect an API key or OpenAI subscription using the provider popup
/disconnect [provider] Remove a provider's saved credentials
/models Choose from every model offered by all connected providers
/config Show current config; /config <key> <value> to set
/sidebar Show/hide the contextual right panel or Findings list (Ctrl+B)
/cost Cost breakdown for the last scan
/clear Clear scan state and return to landing
/discord Open the OpenHack Discord
/mouse Toggle mouse capture (off = native text selection)
/help List commands
/quit Exit

Keyboard shortcuts (Findings tab)

  • / — switch finding
  • [ · ] — alternate prev / next
  • Mouse wheel or PgUp / PgDn — scroll the details pane
  • y — yank (copy) selected finding for an AI agent
  • < · > — resize the sidebar
  • Ctrl+B — toggle the Findings list

Keyboard shortcuts (Trace tab)

  • / — scroll the trace
  • Mouse wheel or PgUp / PgDn — scroll the trace
  • Home — jump to the top
  • End — resume auto-follow-to-bottom
  • Ctrl+B — toggle the right session panel

Selecting text

The TUI captures mouse events by default (for scrolling and clicking). To select and copy text natively:

  • macOS: Hold Option (⌥) and drag to select, then Cmd+C to copy.
  • Linux / Windows: Hold Shift and drag to select.
  • Or: Run /mouse to disable mouse capture entirely — the terminal's native selection works normally until you toggle it back on.

Keyboard

OpenHack negotiates the Kitty keyboard protocol on startup, so on terminals that support it (iTerm2 3.5+, kitty, Ghostty, WezTerm, Alacritty) modifier combos that legacy terminals collapse arrive disambiguated — Option/Alt+Backspace deletes the previous word, a lone Esc is distinct from an escape sequence, etc. Terminals that don't support it are unaffected (Ctrl-W deletes a word everywhere). Set OPENHACK_KITTY_KEYBOARD_PROTOCOL=false to force legacy input.

CLI commands (headless)

For CI, scripts, or one-off scans where you don't want the TUI:

openhack --scan /path/to/repo

OpenHack runs the same pipeline as the TUI, prints progress to stdout, writes a JSON report to ~/.openhack/scans/<session-id>.json, and exits.

Command Description
openhack [path] Launch the interactive TUI (path defaults to .)
openhack --scan [path] Full scan, headless (defaults to .)
openhack --hack "<task>" Run one hacking task headlessly
openhack --plan "<obj>" Draft a read-only attack plan
openhack --sessions List all saved scans
openhack --resume <id> Resume a scan from its last checkpoint
openhack --classify [path] Classify frameworks + detect entry points (no LLM calls)
openhack --login Log in to your OpenHack account
openhack --setup Run the setup wizard
openhack --help Show usage

Bare-word forms (openhack scan) still work, but --flags are the documented interface.

Scans are checkpointed after each pipeline stage. If a scan is interrupted or fails, resume it:

openhack --resume <session-id>

Configuration

Preferences are stored in ~/.openhack/config. Provider credentials are kept separately in ~/.openhack/auth.json; both files use owner-only permissions.

Use the provider commands to connect or switch inference services:

/connect                 # connect one or more providers
/models                  # select across every connected provider

The provider list and model metadata are synchronized from Models.dev and cached for one day. OpenHack also has a bundled offline model catalog. /connect and /models use centered, searchable, scrollable pickers; provider refresh happens in the background so opening them never waits on the network. OpenHack's existing grok-4.5, glm-5.2, kimi-k2.5, and gemma-4-31b ranking stays at the top whenever those models are available. The first provider screen is curated; choose Other… to search the complete Models.dev-backed catalog.

Cloudflare Workers AI additionally needs CLOUDFLARE_ACCOUNT_ID. Azure OpenAI needs its full /openai/v1 endpoint in AZURE_OPENAI_BASE_URL. Amazon Bedrock uses its Mantle endpoint and additionally needs AWS_REGION.

You can override at runtime via environment variables:

Variable Effect
OPENHACK_API_KEY Bearer token for the OpenHack inference API
OPENHACK_DEV=1 Point the CLI at local dev servers (app on :9080, inference on :8787) for self-hosted setups
PROMPT_CACHING=0 Stop sending prompt_cache_key with API calls — needed for OpenAI-compatible endpoints that reject it (also: /config prompt_caching false)

Privacy

OpenHack reads and processes your source code locally — prompts are built on your machine. Model prompts are sent to the provider you select. With the hosted OpenHack provider they go through OpenHack Inference; with BYOK, local, or OpenAI subscription connections they go directly to that provider. Review the selected provider's data policy before scanning sensitive code.

Contributing

OpenHack is open source. Issues and PRs welcome on GitHub.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openhack-0.2.0.tar.gz (571.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openhack-0.2.0-py3-none-any.whl (447.0 kB view details)

Uploaded Python 3

File details

Details for the file openhack-0.2.0.tar.gz.

File metadata

  • Download URL: openhack-0.2.0.tar.gz
  • Upload date:
  • Size: 571.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for openhack-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f05211050c778ced265aeb6db76bb973f802c46b3e15d54c7305d76502acf41d
MD5 b1e5c1ee50faf81c371273ef903795ea
BLAKE2b-256 5e76024524df747545374bda0c119d7d337e207f7331ab8f9392a1d262616917

See more details on using hashes here.

File details

Details for the file openhack-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: openhack-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 447.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for openhack-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03934e58339a3f79355b0c6abc47b15753ac0c29146bbd7f05af18483514eede
MD5 b6a8901d94140425a5b22b6018e60343
BLAKE2b-256 1ba99ea222b13d2d6c8674a1578cda1a5fa86d15f1405fc80e69476fbfe64d18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page