Pentest-AI: The Autonomous AI Hacker That Runs on a Single Command + Video

Listen to this Post

Featured Image

Introduction:

Penetration testing is entering the autonomous age. Security researcher 0xSteph has unveiled Pentest-AI, an open-source framework that combines intelligent AI agents with real offensive security tools to perform everything from reconnaissance and authentication bypass to vulnerability validation, exploit chaining, and report generation—all from a single command. Unlike conventional scanners that rely on rigid signatures, Pentest-AI attempts to act like a human operator: it thinks, reasons, and adapts, delivering working Proofs of Concept alongside audit-ready reports, all while running on your local machine.

Learning Objectives:

Learn to install and configure the Pentest-AI (ptai) framework, along with its companion 35-agent suite (pentest-ai-agents), to perform autonomous, AI-driven penetration tests.
Master critical command-line workflows for reconnaissance, authentication handling, and exploit validation against modern targets, including Single-Page Applications.
Understand how to integrate the Model Context Protocol (MCP) server into AI-powered development environments such as Claude Code, Cursor, or VS Code Copilot for seamless offensive security automation.

You Should Know:

1. One‑Command Autonomous Attack Chains

Pentest-AI wraps over 200 traditional security tools and uses 17 specialist agents to drive them intelligently, chaining low-level findings into multi-step attack paths. It validates every vulnerability by actually exploiting it and automatically produces a report that includes a working Proof of Concept (PoC). The framework is entirely local: no cloud components, no telemetry, and no requirement for an Anthropic API key unless you explicitly bring your own LLM.

What the Post Says (Extended):

The original LinkedIn post describes Pentest-AI as a platform that “combines recon, authentication, vulnerability validation, attack‑chain analysis, and reporting into one workflow.” While many AI security tools merely suggest commands, this framework actually executes them, maps every offensive action to the MITRE ATT&CK framework, and returns validated findings alongside defensive context. The goal is to transform a single engineer into an entire red team without sacrificing depth or accuracy.

Step‑by‑step: running your first autonomous pentest

1. Install the `ptai` CLI from PyPI:

pip install ptai

Alternatively, install directly from the source repository:

git clone https://github.com/0xSteph/pentest-ai.git
cd pentest-ai
pip install -e .

For Windows users, the same commands work in PowerShell after ensuring Python 3.10+ and pip are available in the system PATH.

  1. Accept the responsible‑use terms – the first run will prompt you to accept the Acceptable Use Policy (AUP). In CI environments, you can bypass the interactive prompt by setting the environment variable:
    export PENTEST_AI_AUP_ACCEPTED=1
    

  2. Add an authentication profile (if the target requires a login):

    ptai auth profile add my-target
    

    Provide the necessary credentials (username, password, API keys, or JWT‑format secrets). The framework will automatically use this profile to authenticate before scanning.

  3. Launch a test against a target (here, against an OWASP Juice Shop instance):

    ptai start https://juice-shop.example.com --auth-profile my-target
    

  4. Let the AI do the work – the tool will run reconnaissance, log into the application, test for vulnerabilities, chain findings into attack paths, and finally produce an audit‑ready report. The output is written to a local directory (e.g., ~/.pentest-ai/tasks/<task-id>/).

What the tool is actually doing:

Under the hood, `ptai` orchestrates tools like nmap, ffuf, sqlmap, dalfox, hydra, wpscan, hashcat, and many others. Each step is logged, and every finding is correlated using an SQLite-backed findings database. The AI agents reason about the results of one tool and decide which tool to invoke next, exactly as a human penetration tester would.

  1. Turning Claude Code into a 35‑Agent Red Team
    The companion project, pentest-ai-agents, transforms Anthropic’s Claude Code into a specialized offensive‑security assistant by providing 35 domain‑specific subagents. These subagents cover everything from reconnaissance, web testing, and Active Directory attacks to exploit chaining, detection engineering, and report writing. When you describe a task, Claude automatically routes the request to the most appropriate specialist agent.

Step‑by‑step: installing and using the 35 subagents

1. Run the one‑line installer (Linux/macOS):

curl -fsSL https://raw.githubusercontent.com/0xSteph/pentest-ai-agents/main/install.sh | bash

For Windows, you can manually clone the repository and copy the contents of the `agents/` folder into the Claude Code agents directory (typically %USERPROFILE%\.claude\agents).

  1. Launch Claude Code and start a new session. You can now ask the assistant to perform tasks such as:

– “Run a reconnaissance scan against `target.com` and analyse the results.”
– “Enumerate Active Directory using BloodHound and Impacket.”
– “Build a complete exploit chain for the vulnerabilities found in the web application.”

3. Work in two‑tier execution modes:

  • Tier 1 (Advisory Mode): The AI provides methodology guidance and command suggestions without executing anything. You simply paste the output of your tools, and the agent analyses it.
  • Tier 2 (Execution Mode): The AI composes and executes commands directly against an authorized target, but Claude Code displays each command and requires your explicit approval before running it.

For example, a Tier‑2 command might be:

I will run: nmap -sV -p- target.com
Do you approve? (yes/no)
  1. Persist findings across sessions – the built‑in `findings.sh` script writes all identified vulnerabilities to an SQLite database. You can later ask the Report Generator agent to produce a professional penetration test report complete with an executive summary, CVSS scores, and remediation roadmaps.

3. Advanced Configuration: Controlling Scan Intensity and Scope

When testing production systems, you need to ensure that aggressive probes do not alter data or cause unintended harm. Pentest-AI provides several safety flags that you can enable to reduce the risk of damaging production assets.

Step‑by‑step: tuning scan intensity for safe production testing

  1. Use `intensity=safe` to skip probes that mutate server state, such as mass‑assignment attempts, stored XSS payloads, and race‑condition checks:
    ptai start https://prod.example.com --intensity safe
    

  2. Respect rate limits with `respect_rate_limits=true` so that the tool honours HTTP 429 responses and any `Retry-After` headers, rather than continuing to hammer the endpoint:

    ptai start https://prod.example.com --respect_rate_limits true
    

  3. Enforce a strict scope with strict_scope=true. This configuration refuses any request whose hostname does not match the engagement target and disables redirect‑following, preventing a 302 to an external domain from pulling the scan off‑target:

    ptai start https://prod.example.com --strict_scope true
    

All three flags default to off, so existing behaviour remains unchanged unless you explicitly opt into these safer modes.

4. Integrating Pentest-AI with Your CI/CD Pipeline

Pentest-AI can be dropped directly into automated security pipelines, enabling continuous assessment of staging or production environments.

Step‑by‑step: adding `ptai` to a GitHub Actions workflow

1. Create a workflow file (e.g., `.github/workflows/pentest.yml`):

name: Autonomous Security Scan

on:
schedule:
- cron: '0 2   '  Run daily at 2:00 AM

jobs:
pentest:
runs-on: ubuntu-latest
steps:
- name: Install ptai
run: pip install ptai

<ul>
<li>name: Accept AUP non‑interactively
run: echo "PENTEST_AI_AUP_ACCEPTED=1" >> $GITHUB_ENV</p></li>
<li><p>name: Run autonomous pentest
run: ptai start https://staging.example.com --auth-profile ci-profile

  1. Store authentication secrets in GitHub Secrets and reference them via environment variables when adding the authentication profile:

    ptai auth profile add ci-profile --username ${{ secrets.PENTEST_USER }} --password ${{ secrets.PENTEST_PASS }}
    

  2. The tool will produce a report in the `reports/` directory, which you can upload as a workflow artifact for later review.

5. Using Local LLMs for Air‑Gapped Environments

For privacy‑sensitive or air‑gapped environments, Pentest-AI can be used entirely offline with local language models. The companion `pentest-ai-agents` toolkit includes a script to convert all agents into custom commands compatible with Ollama, LM Studio, or any other local model.

Step‑by‑step: running with Ollama (Linux/macOS)

1. Install Ollama:

curl -fsSL https://ollama.com/install.sh | sh
  1. Pull a suitable model (for example, the balanced 7B parameter model):
    ollama pull llama3
    

  2. Generate local custom commands from the agent suite:

    cd pentest-ai-agents
    ./opencode-setup.sh
    

  3. Run the agents by instructing your local LLM to invoke the generated commands. No internet connection is required, and no data ever leaves your machine.

6. Practical Commands for Linux and Windows Users

| Action | Linux / macOS | Windows (PowerShell) |

| : | : | : |

| Install `ptai` | `pip install ptai` | `pip install ptai` |
| Set AUP acceptance | `export PENTEST_AI_AUP_ACCEPTED=1` | `$env:PENTEST_AI_AUP_ACCEPTED=1` |
| Add auth profile | `ptai auth profile add target` | `ptai auth profile add target` |
| Start a test | `ptai start https://target.com` | `ptai start https://target.com` |
| View findings | `cat ~/.pentest-ai/reports/latest/report.md` | `type %USERPROFILE%\.pentest-ai\reports\latest\report.md` |
| Install agents (subagent suite) | `curl -fsSL https://raw.githubusercontent.com/0xSteph/pentest-ai-agents/main/install.sh \| bash` | Manual clone required |

What Undercode Say:

Key Takeaway 1: Pentest-AI is not a replacement for human testers, but rather a supercharger. By automating the tedious work of chaining tools and correlating findings, it allows security professionals to focus on complex business logic flaws and strategic decisions. Its 63% catch rate on OWASP Juice Shop is impressive for an autonomous tool but also highlights that human intuition remains irreplaceable.

Key Takeaway 2: The separation of advisory (Tier 1) and execution (Tier 2) agents sets a new standard for AI safety in offensive security. This dual‑mode approach gives the operator complete control: the AI can be used as a consultant that never touches the target, or as an executor that asks for permission before every command. Combined with intensity and scope flags, this makes autonomous AI pentesting production‑safe for the first time.

Analysis: The true innovation here is the Model Context Protocol (MCP) server with its 200+ wrapped tools. By providing a standardised interface that any MCP‑compatible client can call, `ptai` breaks AI out of the chat‑bubble and into the command line. This is the missing piece that transforms large language models from passive advisors into active, tool‑using operators. Within 12 months, we can expect every major SIEM and SOAR platform to integrate a similar MCP‑based autonomous agent.

Prediction:

-1 The skill floor for effective penetration testing will drop dramatically, leading to a surge in low‑skill attackers who rely entirely on autonomous tools. While legitimate testers will benefit, the barrier to entry for malicious actors will also fall. Expect an increase in automated, AI‑driven attacks that mirror the capabilities of Pentest-AI.

+1 Security teams will finally be able to shift left with true automation, embedding autonomous red‑teaming into every pull request. The CI/CD integrations already available mean that developers will receive validated vulnerability reports minutes after pushing code, not days or weeks. This will accelerate the adoption of DevSecOps and significantly reduce the cost of catching flaws early.

+1 A new class of AI‑orchestrated penetration testing certifications will emerge, focusing on prompting, agent configuration, and results validation rather than manual tool execution. Professionals who master frameworks like Pentest-AI will become the equivalent of “red‑team operators who speak the language of AI,” commanding more influence (and higher salaries) than those who only know how to run individual tools manually.

▶️ Related Video (86% Match):

🎯Let’s Practice For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

IT/Security Reporter URL:

Reported By: 0xfrost Pentest – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow UndercodeTesting & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin | 🦋BlueSky