pentestagent
Autonomous AI penetration-testing agent with TUI, Docker tools and MCP integration
Overview
PentestAgent is an AI-assisted penetration testing tool that runs in a terminal interface and drives real security tools on your behalf. It connects to models through LiteLLM-supported providers such as OpenAI or Anthropic, so operators can bring their own API key and model choice. The project is distributed under the MIT license and requires Python 3.10 or newer.
The tool targets security professionals who want an agent to handle reconnaissance and testing tasks while they keep control of the session. Its terminal interface exposes commands for setting a target, listing tools, taking notes, checking memory use, and producing a report from the work performed. Work can also run inside Docker, including a Kali-based image that carries common pentesting utilities.
What separates PentestAgent from a simple chat wrapper is its mode structure and its ability to delegate work to subordinate agents. A single instruction, a self-directed single task, a coordinated multi-agent crew, and a guided interactive chat are all available from the same interface. Prebuilt attack playbooks give structured approaches to specific security assessments, and built-in tools cover terminal access, browser use, notes, and web search.
Best for
- Penetration testers
- Security consultants
- Red team operators
- Security researchers
How to use
- Clone the repository and run the setup script for your platform, or create a virtual environment and install the package with its extras.
- Install Chromium through Playwright if you intend to use the browser tool.
- Create a .env file holding an API key for your provider and the model identifier to use.
- Launch the tool with the pentestagent command, optionally passing a target address.
- Choose an operating mode and issue commands from the terminal interface.
- Run a playbook with the run command and a named playbook when a structured assessment is needed.
What it can do
How it works
Setup starts by cloning the repository and running the provided setup script, which builds a virtual environment and installs dependencies. The operator then supplies provider credentials and a model name in a .env file. Any model supported by LiteLLM can be used, and custom OpenAI-compatible or Anthropic-compatible endpoints can be set through base URL variables. Launching the command opens the terminal interface, where the operator sets a target and picks a mode. Tools can run on the host or inside Docker, and MCP servers extend the available tools.
The agent acts on operator instructions and can spawn isolated children to handle scoped subtasks. Even in the self-directed mode, the human decides the target, the mode, and which playbook to run, and can stop a running agent at any time. Notes are kept during the session and a report is generated on request, so the operator reviews and approves the resulting output rather than the tool acting without oversight.
Agents can execute multi-step tasks and delegate to child agents, but the operator sets the target and mode, selects playbooks, can halt a run, and reviews notes and reports.
Where it fits
- Run a structured web assessment against a designated target using a prebuilt playbook.
- Delegate separate subnet scans to isolated child agents and collect their results.
- Use the interactive mode to get guidance while working through a penetration test.
- Execute pentesting tools inside a Kali-based container to keep the host isolated.
Good fit
- black-box security testing using the bundled attack playbooks
- running autonomous single-task penetration testing through the agent mode
- multi-agent orchestration where an agent spawns isolated child agents for scoped subtasks
- isolated tool execution inside a Docker container with preinstalled pentesting tools
Not a fit
- users without an API key for a supported LLM provider, since a provider key is required
- environments that cannot install Python 3.10+ or Playwright Chromium for the browser tool
- teams wanting a hosted managed service, since this is a command-line tool installed locally
How to evaluate
- Confirm you have an API key for OpenAI, Anthropic, or another LiteLLM-supported provider before setup.
- Verify your environment meets the Python 3.10+ requirement and can install Playwright Chromium.
- Decide whether you need Docker isolation with the base or Kali image, and whether Docker is available.
- Check whether the interactive, agent, crew, or assist mode matches how you want to drive testing.
- Confirm scope and target definitions suit your engagement, including the playbook approach for black-box testing.
Our take
PentestAgent is a locally installed command-line agent for penetration testing that connects to a wide range of LLM providers through LiteLLM. It offers several operating modes, from single-shot instructions to autonomous tasks and a multi-agent crew, plus prebuilt attack playbooks for black-box testing. Docker support lets it run tools inside an isolated base or Kali container with common pentesting utilities available. It is a developer-oriented tool that requires Python, provider API keys, and some setup effort.
Alternatives
| Agent | Pricing | Autonomy | Best for |
|---|---|---|---|
| hermes-agent | — | Supervised | AI researchers, Developers, System administrators, DevOps engineers, Technical founders |
| deer-flow | — | Supervised | Software developers, AI and agent engineers, Research engineers, Technical teams building agent workflows, Data pipeline builders |
| OpenMausBot | — | Supervised | Developers and engineers, Technical founders and small product teams, DevOps and IT administrators, Operations specialists who coordinate recurring tasks, AI power users comfortable with command-line tools |
| Toonflow-app | — | Supervised | Short drama creators, Comic video producers, Storyboard artists, Previsualization artists, Video editors, Independent animators, Content studio operators |
| rowboat | — | Supervised | Software engineers, Engineering managers, Product managers, Support teams, Operations leads, Founders, Research and knowledge workers |
| artemis | — | Supervised | Mobile QA engineers, Test automation engineers, AI coding assistant users, Android developers, CI and DevOps engineers |
FAQ
- What do I need before installing PentestAgent?
- You need Python 3.10 or newer and an API key for OpenAI, Anthropic, or another LiteLLM-supported provider. The browser tool also requires installing Playwright Chromium.
- How does PentestAgent connect to an LLM provider?
- It reads a provider API key and model name from a .env file, and any LiteLLM-supported model can be used. You can also point it at OpenAI-compatible or Anthropic-compatible endpoints through custom base settings.
- Can I run the pentesting tools in an isolated environment?
- Yes. Docker support lets tools run inside a container, using either a base image with utilities like nmap, netcat, and curl, or a Kali image with additional tools such as metasploit, sqlmap, and hydra.
- What operating modes are available?
- The TUI offers assist for a single instruction with tool execution, agent for autonomous single-task work, crew for multi-agent orchestration, and interact for guided chat during a pentest.
- What are playbooks used for?
- Playbooks provide a structured approach to specific security assessments for black-box testing, and you can run one by specifying it with a target through the command line.
- How does the multi-agent spawning work?
- The spawn_mcp_agent tool lets a running agent create an isolated child agent connected over stdio, with its own runtime, model client, history, and notes. The child's tools become available to the parent on the next tool call.
- How is PentestAgent licensed?
- It is released under the MIT License, which permits use, modification, and distribution with the license notice included.
- How is PentestAgent priced?
- The project sources do not state a price or plan. You supply your own LLM provider API key, so model usage costs come from your chosen provider rather than from the listing.
Embed a listing badge
<a href="https://aiagentsmarketplace.dev/agents/pentestagent"><img src="https://aiagentsmarketplace.dev/badges/featured.svg" alt="Featured on AI Agents Marketplace" width="262" height="36"></a>
Comments
No comments yet.