Skip to content

Configuration

pwnkit is designed for zero-config usage, but every default can be overridden via CLI flags or environment variables.

pwnkit is an agentic harness — bring your own AI. The --runtime flag controls which LLM backend powers the agents.

RuntimeFlagDescription
api--runtime apiUses your API key (OpenRouter, Anthropic, OpenAI). Best for CI and quick scans. Default.
claude--runtime claudeSpawns the Claude Code CLI with your existing subscription. Best for deep analysis.
codex--runtime codexSpawns the Codex CLI. Best for source-level analysis.
gemini--runtime geminiSpawns the Gemini CLI. Best for large-context source analysis.
auto--runtime autoAuto-detects installed CLIs and picks the best one per pipeline stage.

The default api runtime makes direct HTTP calls to an LLM provider. It requires one of these environment variables:

Terminal window
export OPENROUTER_API_KEY="sk-or-..." # Recommended
export ANTHROPIC_API_KEY="sk-ant-..."
export AZURE_OPENAI_API_KEY="..."
export OPENAI_API_KEY="sk-..."

See API Keys for the full priority order and provider details.

These runtimes spawn the respective CLI tool as a subprocess. You must have the CLI installed and authenticated:

Terminal window
# Claude Code CLI
npm i -g @anthropic-ai/claude-code
# Codex CLI
npm i -g @openai/codex
# Gemini CLI
npm i -g @anthropic-ai/gemini-cli # or however it's distributed

Then use them:

Terminal window
npx pwnkit-cli scan --target https://api.example.com/chat --runtime claude
npx pwnkit-cli review ./my-repo --runtime codex --depth deep

The --mode flag controls what kind of target is being scanned.

ModeDescription
llmProbe LLM/AI endpoints with prompt injection, jailbreaks, exfiltration, and tool poisoning attacks. Default for scan.
webDeterministic checks for CORS misconfigurations, security headers, exposed files, and fingerprint leakage.
mcpScan MCP (Model Context Protocol) servers for tool poisoning and schema abuse. (Coming soon)
Terminal window
# LLM endpoint scan (default)
npx pwnkit-cli scan --target https://api.example.com/chat
# Web app scan
npx pwnkit-cli scan --target https://example.com --mode web

The --depth flag controls how thorough the scan is.

DepthTest CasesTypical TimeBest For
quick~15~1 minCI pipelines, smoke tests
default~50~3 minDay-to-day scanning
deep~150~10 minPre-launch audits, thorough review
Terminal window
npx pwnkit-cli scan --target https://api.example.com/chat --depth quick
npx pwnkit-cli audit express --depth deep
npx pwnkit-cli review ./my-repo --depth deep --runtime claude

pwnkit supports multiple output formats:

FormatDescription
jsonMachine-readable JSON output for pipelines
sarifSARIF format for the GitHub Security tab
markdownHuman-readable Markdown report

In CI (GitHub Action), set format: sarif to populate the Security tab:

- uses: peaktwilight/pwnkit@main
with:
mode: review
path: .
format: sarif

For PR workflows, review only changed files against a base branch:

Terminal window
npx pwnkit-cli review ./my-repo --diff-base origin/main --changed-only

This is particularly useful in CI to avoid scanning the entire codebase on every PR.

Use --verbose to see the animated attack replay and detailed agent reasoning:

Terminal window
npx pwnkit-cli scan --target https://api.example.com/chat --verbose