Specification-Driven AI Pentesting Framework
Define your scope. Deploy your agents. Document your findings.
PentestSpecKit transforms penetration testing from an artisanal service into a systematic, reproducible engineering discipline. Define your engagement as code, execute with AI agents, and produce auditable results — all running locally on your machine.
PentestSpecKit is an open-source framework that introduces specification-driven penetration
testing. Instead of manually clicking through tools, you define your engagement in a
pentest.yaml file:
engagement:
name: 'ACME Web Application Assessment'
type: 'web_application'
targets:
- domain: 'app.acme-corp.com'
access_level: 'authenticated'
methodology:
standard: 'OWASP Testing Guide v4'
focus_areas:
- 'authentication'
- 'authorization'
- 'business_logic'
constraints:
rate_limit:
max_requests_per_second: 10
prohibited_techniques:
- 'dos'
- 'social_engineering'
deliverables:
- type: 'findings_json'
- type: 'executive_report'
format: 'pdf'Then run:
pentest-speckit run acme-web-assessmentPentestSpecKit's AI agents execute the tests methodically, enforce your constraints, and generate comprehensive reports.
| Feature | Description |
|---|---|
| Specification-Driven | Define scope, methodology, and constraints as code |
| AI Agent Orchestration | Multiple specialized agents working together |
| Local-First | All processing stays on your machine — no data leakage |
| Governance Built-In | Automatic scope enforcement and audit trails |
| MCP-Native | Integrate with Burp, Nmap, SQLmap, and more |
| Reproducible | Full audit trail, checkpoint/resume capability |
| Open Source | Apache 2.0 licensed, community-driven |
┌─────────────────────────────────────────────────────────────────┐
│ PentestSpecKit Flow │
└─────────────────────────────────────────────────────────────────┘
pentest.yaml
│
▼
┌─────────────┐
│ Spec Parser │ → Validates schema, extracts constraints
└──────┬──────┘
│
▼
┌─────────────┐
│ Planner │ → Creates test plan from methodology
└──────┬──────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Multi-Agent System │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Recon │→ │ Web │→ │ Exp │→ │Evidence │ │
│ │ Agent │ │ Agent │ │ Agent │ │ Agent │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ ↑ ↑ ↑ ↑ │
│ └──────────────┴───────────┴────────────┘ │
│ Governance Agent (enforces scope) │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────┐
│ Reporting │ → PDF, Markdown, SARIF, JSON
└─────────────┘
- Python 3.11+
- Ollama (for local LLM)
- MCP servers (optional, for tool integration)
For step-by-step installation options, see Installation Guide and the Documentation Index.
Easiest for pentesters (no Python workflow needed):
# Clone the repository
git clone git@github.com:NgeSEC/pentest-speckit.git
cd pentest-speckit
# Run helper script (creates .venv, installs package)
chmod +x scripts/pentest-speckit.sh
./scripts/pentest-speckit.sh install
# Verify installation
./scripts/pentest-speckit.sh versionManual Python install:
# Clone the repository
git clone git@github.com:NgeSEC/pentest-speckit.git
cd pentest-speckit
# Create a virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate
# Now install inside the virtual environment
pip install -e .
# Verify installation
pentest-speckit --version
# When done, exit the virtual environment
deactivateAlternative methods:
# Using pipx (installs in isolated environment automatically)
pipx install .
# Or using uv (fast Python package installer)
uv venv && source .venv/bin/activate
uv pip install -e .PentestSpecKit supports multiple LLM integration options:
Option 1: Ollama (Local, Free)
# Install Ollama (https://ollama.ai)
# Pull recommended model
ollama pull qwen2.5-coder:32b
# Verify Ollama is running
ollama listOption 2: LLM CLI Tools (Multi-Provider)
Use popular CLI tools you may already have configured:
# Install llm CLI (supports 50+ providers via plugins)
pip install llm
llm install llm-anthropic # Add Claude support
# Or use sgpt for OpenAI/Anthropic
pip install shell-gpt
# Set API keys
export ANTHROPIC_API_KEY="sk-ant-..."Option 3: Direct API (No CLI Dependencies)
# Install provider packages
pip install openai anthropic google-generativeai
# Set API keys
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GOOGLE_API_KEY="..."For detailed setup instructions, see:
- LLM API Integration - Ollama and local LLMs
- LLM CLI Integration - CLI tools and direct API
For a guided walkthrough, see Quickstart and Configuration.
# Initialize a new project workspace
./scripts/pentest-speckit.sh init my-pentest
# Edit projects/my-pentest/pentest.yaml
# Add notes in projects/my-pentest/notes.mdGenerated structure:
projects/my-pentest/
├── pentest.yaml
├── notes.md
├── context/
├── evidence/
├── findings/
└── reports/
# Validate your project specification
./scripts/pentest-speckit.sh validate my-pentest
# Run the engagement
./scripts/pentest-speckit.sh run my-pentest
# Generate project report artifacts
./scripts/pentest-speckit.sh report my-pentest# 1. Create project workspace
pentest-speckit init acme-assessment
# 2. Edit projects/acme-assessment/pentest.yaml with your scope
# (targets, methodology, constraints)
# 3. Validate specification
pentest-speckit validate acme-assessment
✓ Specification valid
✓ All targets in scope
✓ Methodology compatible
# 4. Run the engagement
pentest-speckit run acme-assessment
[Planner] Generated test plan: 47 tests across 5 phases
[Recon] Discovered 3 subdomains, 12 endpoints
[Web Agent] Testing authentication flows...
[Web Agent] ⚠️ FINDING: SQL Injection in /api/v1/search
[Governance] Requesting human approval for exploitation...
[Human] Approval granted
[Exp Agent] Exploitation successful - PoC documented
[Evidence] Collected 24 evidence items
[Reporting] Generating reports...
✓ Engagement complete
✓ 3 findings documented
✓ Reports generated in projects/acme-assessment/reports/
# 5. Review findings
pentest-speckit report acme-assessment
# 6. Export for developers
pentest-speckit report acme-assessment| Agent | Responsibility |
|---|---|
| Planner | Generates test plan from specification |
| Recon | Passive/active reconnaissance, asset discovery |
| Web Testing | OWASP Top 10, authentication, authorization |
| Exploitation | Proof-of-concept exploits (requires approval) |
| Evidence | Collects and correlates findings |
| Reporting | Generates executive and technical reports |
| Governance | Enforces scope, rate limits, audit trail |
For activation, deactivation, and full MCP setup examples, see MCP Integration.
PentestSpecKit works with any MCP-compatible tool:
integrations:
mcp:
servers:
- name: 'terminal'
enabled: true
- name: 'github'
enabled: true
env:
GITHUB_PERSONAL_ACCESS_TOKEN: '${GITHUB_PERSONAL_ACCESS_TOKEN}'
- name: 'burp'
enabled: true
host: '127.0.0.1'
port: '8080'
- name: 'nmap'
enabled: true- Burp Suite — Web proxy integration
- Nmap — Network scanning
- SQLmap — SQL injection testing
- Nikto — Web server scanning
- Gobuster/FFuf — Directory enumeration
- Nuclei — Vulnerability scanning
- Custom Scripts — Any Python script as MCP server
| Format | Use Case |
|---|---|
| JSON | Machine-readable findings |
| SARIF | IDE integration, developer workflows |
| Executive reports for stakeholders | |
| Markdown | Technical appendix, GitHub-friendly |
| HTML Dashboard | Real-time engagement monitoring |
PentestSpecKit prioritizes safety:
- Scope Enforcement — All actions validated against specification
- Rate Limiting — Configurable request limits
- Blackout Windows — Respect maintenance windows
- Human Approval — Required for exploitation
- Audit Trail — Every action logged
- Emergency Stop — Keywords to halt execution
governance:
approvals:
required_for:
- action: 'exploitation'
severity: ['critical', 'high']
emergency:
stop_keywords: ['STOP', 'HALT', 'EMERGENCY']
audit:
log_all_actions: true
retention_days: 365- Documentation Index - Full documentation hub
- Installation Guide - Install and set up PentestSpecKit
- Quickstart - Create and run your first engagement
- Configuration - Environment, providers, and runtime settings
- LLM API Integration - Connect Ollama, OpenAI, Google, Azure, Anthropic, and more
- Specification Guide - Write effective pentest.yaml specifications
- Agent Documentation - Understand agent roles and behavior
- MCP Integration - Enable, disable, and configure MCP servers
- API Reference - Python API details
# Install dev dependencies
pip install -r requirements-dev.txt
# Run test suite
pytest tests/
# Run with coverage
pytest tests/ --cov=pentest_speckit --cov-report=html# Install pre-commit
pre-commit install
# Run manually
pre-commit run --all-files# Install docs dependencies
pip install -r docs/requirements.txt
# Build documentation
make docs
# Serve locally
make serve-docsWe welcome contributions! See our Contributing Guide for details.
- 🐛 Report bugs
- 💡 Request features
- 📝 Improve documentation
- 🔧 Build MCP servers for new tools
- 🤖 Create new agent types
- 🧪 Add test coverage
Please read our Code of Conduct before contributing.
| Phase | Timeline | Focus |
|---|---|---|
| Phase 1 | Months 1-3 | MVP (single agent, basic reporting) |
| Phase 2 | Months 4-6 | Multi-agent orchestration |
| Phase 3 | Months 7-9 | Continuous red teaming |
| Phase 4 | Months 10-12 | Enterprise features |
See ROADMAP.md for detailed plans.
PentestSpecKit is designed for authorized security testing only.
- Only use against systems you own or have explicit written permission to test
- The authors are not responsible for misuse or damages
- Compliance with applicable laws is the user's responsibility
- This tool is provided "as is" without warranty
Apache License 2.0 — See LICENSE for details.
- Model Context Protocol — Tool integration standard
- Ollama — Local LLM runtime
- OWASP — Testing methodology
- ChromaDB — Vector database
- ⭐ Star this repository
PentestSpecKit — GitOps for Penetration Testing
Built with ❤️ by the PentestSpecKit Team