Getting Started
Install
Section titled “Install”Install the verified release binary with one command, build from source, or run the container image.
# Verified release binary (macOS Apple Silicon / Linux x64/arm64)curl -fsSL https://raw.githubusercontent.com/0sec-labs/0sec/main/install.sh | bashexport PATH="$HOME/.0sec/bin:$PATH"0sec --help # or just: 0 --help
# Sourcegit clone https://github.com/0sec-labs/0sec.gitcd 0seccorepack enablepnpm install --frozen-lockfilepnpm buildnode packages/cli/dist/index.js --help
# Dockerdocker run --rm ghcr.io/0sec-labs/0sec:latest --helpAdd the export line to your shell profile to make the release binary available in future shells.
Set a model key
Section titled “Set a model key”0sec is bring-your-own-model. Export one provider key, then pin the matching
model with --model when several keys are present.
export OPENROUTER_API_KEY="sk-or-..." # one key, many model families# or a direct provider:export ANTHROPIC_API_KEY="sk-ant-..."export OPENAI_API_KEY="sk-..."export Z_AI_API_KEY="..." # glm-5.3export QWEN_API_KEY="..." # qwen3.8-max0sec routes --model (or 0SEC_MODEL) to its matching provider. If the runtime
is misconfigured it stops with an error instead of running a broken scan. See
API Keys for the full provider list and ChatGPT Codex / Azure setup.
First scan
Section titled “First scan”Every live network target needs a scope file. The CLI refuses an unscoped live target before it makes a request.
echo '{"in_scope":["your-app.com"]}' > scope.json
0sec scan --target https://your-app.com/api/chat --scope ./scope.jsonThis maps the attack surface, launches targeted attacks, reproduces each finding, and writes a report. With Docker, mount the scope file and pass its container path:
docker run --rm -v "$PWD/scope.json:/work/scope.json:ro" -e OPENROUTER_API_KEY \ ghcr.io/0sec-labs/0sec:latest scan \ --target https://your-app.com --scope /work/scope.jsonKey scenarios
Section titled “Key scenarios”Pentest a web app
Section titled “Pentest a web app”Shell-first: the agent gets bash and standard tooling to probe for CORS, SSRF,
XSS, SQLi, SSTI, exposed files, and more.
0sec scan --target https://your-app.com --mode web --scope ./scope.jsonAudit a package
Section titled “Audit a package”Downloads and installs the package into a temp dir (never executes it), runs static analysis, then an AI review.
0sec audit lodash0sec audit requests --ecosystem pypi0sec audit alpine:3.20 --ecosystem ociReview a codebase
Section titled “Review a codebase”0sec review ./my-app # local directory0sec review https://github.com/user/repo # clones automaticallyControl scan depth
Section titled “Control scan depth”| Depth | Test cases | Time |
|---|---|---|
quick | ~15 | ~1 min |
default | ~50 | ~3 min |
deep | ~150 | ~10 min |
0sec scan --target https://api.example.com/chat --scope ./scope.json --depth deepNo sandbox by default
Section titled “No sandbox by default”In the open-source CLI the bash tool runs commands directly on your host,
guarded only by a timeout, scope-URL checks, and a scanner blocklist — there is no
container or VM isolation. Run it from a disposable VM, or use the container image
as your operating environment. (Per-scan sandboxing is a managed-platform feature,
tracked in issue #193.)
Next steps
Section titled “Next steps”- Commands — full CLI reference
- Configuration — runtimes, modes, feature flags
- Recipes — copy-paste scans for common scenarios
- Architecture — how the pipeline works