Pentest Swarm AI ships as a statically-linked Go binary that can run as a bare CLI, a long-lived API server, or a containerized service. For anything beyond a single laptop session — CI/CD pipelines, shared red-team infrastructure, continuous ASM runs — Docker Compose is the recommended deployment path. The stack requires three services: theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Armur-Ai/Pentest-Swarm-AI/llms.txt
Use this file to discover all available pages before exploring further.
pentestswarm application, Postgres 16 with the pgvector extension (for the stigmergic blackboard and vector similarity search), and Redis 7 (for rate limiting and session state). An optional Ollama service is included for fully-local LLM inference.
Docker Compose
The production compose file atdeploy/docker-compose.yml defines all four services with health checks and restart policies. The pentestswarm service waits for both postgres and redis to pass their health checks before starting.
golang:1.24-alpine builder stage compiles a statically-linked binary (CGO_ENABLED=0), and a minimal alpine:3.20 runtime stage runs the binary as a non-root swarm user:
Development Setup
The development compose file atdeploy/docker-compose.dev.yml runs only the infrastructure services — Postgres, Redis, and Ollama — leaving the pentestswarm binary to run locally with hot-reload. This avoids rebuilding the Docker image on every code change.
| Aspect | Production | Development |
|---|---|---|
pentestswarm service | Containerized | Runs on host |
| Database password | Set via secrets | pentestswarm_dev (plaintext) |
| Ollama memory reservation | 8 GB | 8 GB |
| Restart policy | unless-stopped | n/a (no container) |
Environment Variables
All configuration values fromconfig.yaml can be overridden via environment variables prefixed with PENTESTSWARM_. The table below covers the variables you must set before the swarm can operate.
| Variable | Required | Description |
|---|---|---|
PENTESTSWARM_ORCHESTRATOR_API_KEY | Yes (Claude) | Claude API key. Equivalent to ANTHROPIC_API_KEY. All agents inherit this key by default — set one key, the entire swarm works. |
PENTESTSWARM_DATABASE_PASSWORD | Yes | Postgres password. Must match POSTGRES_PASSWORD in the compose file. |
PENTESTSWARM_DATABASE_HOST | No | Postgres hostname (default: localhost). Set to postgres inside Docker Compose. |
PENTESTSWARM_REDIS_HOST | No | Redis hostname (default: localhost). Set to redis inside Docker Compose. |
PENTESTSWARM_ORCHESTRATOR_PROVIDER | No | LLM provider: claude (default), ollama, or lmstudio. |
PENTESTSWARM_ORCHESTRATOR_ENDPOINT | No | Required for ollama / lmstudio (e.g., http://localhost:11434). |
HACKERONE_API_TOKEN | No | HackerOne API key for bug bounty submission. Maps to bugbounty.hackerone_api_key. |
HACKERONE_API_USER | No | HackerOne username. Maps to bugbounty.hackerone_username. |
BUGCROWD_API_TOKEN | No | Bugcrowd API key. Maps to bugbounty.bugcrowd_api_key. |
INTIGRITI_API_TOKEN | No | Intigriti API token (see integrations config). |
ANTHROPIC_API_KEY | No | Alternative to PENTESTSWARM_ORCHESTRATOR_API_KEY when using Claude. |
Full configuration reference
config.example.yaml documents every option. Copy it to config.yaml and fill in your values:
Database Migrations
Migrations live ininternal/db/migrations/ and are applied in numeric order. Each migration is additive — no migration drops data from a previous one.
| Migration | File | What it adds |
|---|---|---|
000001 | 000001_initial.sql | Core schema: campaigns, campaign_events, attack_surfaces, raw_findings, classified_findings, attack_plans, execution_results, reports, token_usage. Enables uuid-ossp. |
000002 | 000002_pgvector.sql | Enables the vector extension and adds a 1536-dimension embedding column to classified_findings with an IVFFlat cosine-ops index for semantic similarity search. |
000003 | 000003_cleanup_registry.sql | Adds the cleanup_actions table used by CleanupRegistry to track exploitation commands that must be reversed on campaign exit. |
000004 | 000004_blackboard.sql | Adds the stigmergic swarm blackboard: swarm_findings, swarm_agent_cursors, swarm_budgets. Includes the swarm_pheromone() SQL function and swarm_findings_active view for pheromone decay queries. |
000005 | 000005_agent_budgets.sql | Adds swarm_agent_budgets for per-agent token caps. Soft threshold (warn_at_tokens) emits a WARN event; hard cap (max_tokens) blocks further dispatch to that agent. |
pentestswarm serve:
Server Configuration
The API server binds to0.0.0.0:8080 by default. The port is configurable via server.port in config.yaml or PENTESTSWARM_SERVER_PORT.
Health check endpoint:
200 OK with a JSON body when all dependencies (Postgres, Redis) are reachable. Use this as the readiness probe in Kubernetes or the healthcheck block in Docker Compose.
Key API routes:
| Method | Path | Description |
|---|---|---|
GET | /api/v1/health | Liveness / readiness probe |
POST | /api/v1/campaigns | Create a new campaign |
GET | /api/v1/campaigns/:id | Get campaign status |
GET | /api/v1/campaigns/:id/findings | List classified findings |
GET | /api/v1/campaigns/:id/report | Download report (JSON / Markdown / SARIF) |
Observability
Thedeploy/metrics/ directory contains a metrics aggregator (aggregator.go) that polls download counts from npm, Docker Hub, GitHub Releases, and PyPI, and serves them as a JSON API on port 3001:
deploy/metrics/grafana-swarm-dashboard.json. Import it into any Grafana 10+ instance pointing at your Postgres datasource.
Campaign events are written to the campaign_events table (append-only) on every agent action, providing a queryable audit trail without additional infrastructure.
Production Checklist
Set all required environment variables
At minimum, export
PENTESTSWARM_ORCHESTRATOR_API_KEY (or ANTHROPIC_API_KEY) and PENTESTSWARM_DATABASE_PASSWORD. For bug bounty workflows, add HACKERONE_API_TOKEN and HACKERONE_API_USER.Start Docker Compose
Start all services detached. The
pentestswarm container will wait for Postgres and Redis health checks to pass before accepting connections.Verify the health endpoint
Wait approximately 15 seconds for migrations to run, then confirm the API server is ready:
Hardening
Four-layer defense against MINJA and MemoryGraft memory-injection attacks
Legal Notice
Authorization requirements, AGPL-3.0 license, and responsible disclosure