PentestAI is a CLI-first, AI-assisted penetration testing framework for Linux.
It combines real-world pentest tools with multiple LLM providers to assist with analysis, triage, validation, and reporting — without replacing the pentester.
Human-in-the-loop by design.
- A CLI tool for authorized penetration testing
- AI-assisted analysis, validation, triage, and reporting
- Built on real tools:
subfinder,httpx,nmap,nuclei - Safe-by-default, scope-aware
- An auto-exploitation framework
- A payload generator
- A replacement for human decision-making
- Linux (Parrot / Kali / Ubuntu recommended)
- Python 3.12+
- The following tools available in
$PATH:subfinderhttpxnmapnuclei
pip install pentestai-cliVerify installation:
pentestai --helpPentestAI uses environment variables for AI providers.
You must export at least one API key before running.
export OPENAI_API_KEY="sk-..."(Optional – persist across sessions)
echo 'export OPENAI_API_KEY="sk-..."' >> ~/.bashrc
source ~/.bashrcexport ANTHROPIC_API_KEY="sk-ant-..."
export GEMINI_API_KEY="AIza..."
export DEEPSEEK_API_KEY="sk-..."PentestAI will automatically route AI requests based on availability.
PentestAI automatically creates a workspace directory per target.
Default location:
/home/<user>/workspaces/
Example:
/home/user/workspaces/example.com/
├── recon/
├── scan/
├── validate/
└── reports/
You do not need to create this manually.
PentestAI can be run from any directory.
pentestai recon run --target example.compentestai surface analyze --target example.compentestai scan run --target example.compentestai validate run --target example.compentestai report build --target example.comReports are written to:
~/workspaces/example.com/reports/report.md
Ensure the following tools are installed:
which subfinder httpx nmap nuclei- CLI-first
- Human-in-the-loop
- Safe-by-default
- AI assists analysis — never auto-exploits
- Works anywhere on the filesystem
PentestAI must only be used on systems you own or have explicit authorization to test.
- No
config.yamlrequired for default usage - Workspace paths are auto-resolved per user
- AI provider routing is handled internally
- Future versions may expose optional configuration overrides
Contributions are welcome.
You can contribute by:
- Adding tool integrations
- Improving AI prompts
- Improving reports
- Improving documentation
MIT License
See LICENSE.
PentestAI is built for:
- Students learning real pentest workflows
- Security interns & junior pentesters
- Professionals who want faster analysis and cleaner reports
- Open-source contributors interested in AI + security
If PentestAI helps you, consider starring the project