Skip to main content

PentestAI - AI-assisted pentest CLI workflow (recon -> analysis -> scan -> validate -> report)

Project description

PentestAI

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.

What PentestAI Is (and Is Not)

PentestAI IS

  • 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

PentestAI IS NOT

  • An auto-exploitation framework
  • A payload generator
  • A replacement for human decision-making

Requirements

  • Linux (Parrot / Kali / Ubuntu recommended)
  • Python 3.12+
  • The following tools available in $PATH:
    • subfinder
    • httpx
    • nmap
    • nuclei

Installation (Recommended)

pip install pentestai-cli

Verify installation:

pentestai --help

API Keys Configuration (REQUIRED)

PentestAI uses environment variables for AI providers.

You must export at least one API key before running.

OpenAI (default)

export OPENAI_API_KEY="sk-..."

(Optional – persist across sessions)

echo 'export OPENAI_API_KEY="sk-..."' >> ~/.bashrc
source ~/.bashrc

Optional Providers

export ANTHROPIC_API_KEY="sk-ant-..."
export GEMINI_API_KEY="AIza..."
export DEEPSEEK_API_KEY="sk-..."

PentestAI will automatically route AI requests based on availability.

Workspace Behavior (Automatic)

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.

Quick Start

PentestAI can be run from any directory.

Reconnaissance

pentestai recon run --target example.com

AI Attack Surface Analysis

pentestai surface analyze --target example.com

Vulnerability Scanning

pentestai scan run --target example.com

Validation & Triage (AI-assisted)

pentestai validate run --target example.com

Report Generation

pentestai report build --target example.com

Reports are written to:

~/workspaces/example.com/reports/report.md

Required External Tools

Ensure the following tools are installed:

which subfinder httpx nmap nuclei

Design Philosophy

  • CLI-first
  • Human-in-the-loop
  • Safe-by-default
  • AI assists analysis — never auto-exploits
  • Works anywhere on the filesystem

Legal & Ethical Use

PentestAI must only be used on systems you own or have explicit authorization to test.

Notes for Advanced Users

  • No config.yaml required for default usage
  • Workspace paths are auto-resolved per user
  • AI provider routing is handled internally
  • Future versions may expose optional configuration overrides

Contributing

Contributions are welcome.

You can contribute by:

  • Adding tool integrations
  • Improving AI prompts
  • Improving reports
  • Improving documentation

License

MIT License See LICENSE.

Why PentestAI?

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pentestai_cli-0.1.6.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pentestai_cli-0.1.6-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file pentestai_cli-0.1.6.tar.gz.

File metadata

  • Download URL: pentestai_cli-0.1.6.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pentestai_cli-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b0927f25baec1c7a04d1f82b496b32e787eeefca802a414bfc8fd7010942e81e
MD5 805a7f63f8d220fcb973600651cf126d
BLAKE2b-256 37d0b6523878c57e392d56bf202e91106d9399d2ffd69f5785f0ff16a96cee80

See more details on using hashes here.

Provenance

The following attestation bundles were made for pentestai_cli-0.1.6.tar.gz:

Publisher: release.yml on dinhvaren/PentestAI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pentestai_cli-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pentestai_cli-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pentestai_cli-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 59887ecb91531b3d3eb5da06f3537f7693b0a5a9c6c9a14c3ce058b3e99d2140
MD5 3ed5b09e81ff978d6019a998cfa9d278
BLAKE2b-256 fa1c96562aa7e108707349b81eea70c5c6f4741110ead81df2b011bec1eb6bde

See more details on using hashes here.

Provenance

The following attestation bundles were made for pentestai_cli-0.1.6-py3-none-any.whl:

Publisher: release.yml on dinhvaren/PentestAI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page