PentAGI: AI That Runs Its Own Pentests in a Sandbox
Let's be honest. Setting up a pentesting environment is tedious. You spin up VMs, configure networking, install tools, and then manually run scanners, hoping you didn't miss something obvious. Now imagine an AI that plans the attack, executes the commands, and learns from the results—all inside a disposable Docker container.
That's exactly what PentAGI does. It's an open-source project that combines autonomous agents with pentesting tooling. You give it a target, and it starts planning, scanning, and exploiting—without you babysitting every step.
What It Does
PentAGI is a self-hosted service that runs autonomous penetration testing inside a sandboxed Docker environment. Under the hood, it uses AI agents (via Large Language Models) to make decisions about what to test next.
The workflow is simple:
- You provide a target (like a URL or an IP range).
- PentAGI spins up an isolated container with all the necessary pentesting tools pre-installed.
- The AI agent plans the attack, runs commands like
nmaporgobuster, analyzes the output, and decides the next step. - Everything is logged and visualized in a web UI, so you can see the reasoning behind each action.
It's not replacing a human pentester. It's more like having a junior analyst that never sleeps and doesn't get bored of running the same scan repeatedly.
Why It’s Cool
Here’s where it gets interesting. PentAGI isn't just a wrapper around a single LLM call. It uses a sophisticated agent graph architecture. That means different AI agents handle different stages: one plans the high-level strategy, another executes specific tools, and another evaluates the results. This prevents the "AI going off the rails" problem you often see with naive automation.
The best part? The sandbox is fully isolated. Every run creates a fresh container. If something goes wrong, you kill the container and start over. No mess on your host machine.
Another killer feature is the integration with MCP (Model Context Protocol). This lets the AI interact with external services like Nuclei templates or CVE databases in real-time, so it doesn't rely on stale knowledge. It can look up current vulnerabilities, check latest exploits, and then try them against your target.
How to Try It
You don't need to build anything from source. The simplest way is to use the provided Docker images.
git clone https://github.com/vxcontrol/pentagi
cd pentagi
docker compose up -d
Then open http://localhost:8080 in your browser. You'll see a setup wizard where you configure your AI provider (OpenAI, Anthropic, or local models via Ollama). After that, you can point it at a sandboxed test environment like a deliberately vulnerable app (DVWA or Juice Shop).
If you don't want to self-host yet, check the README for a cloud demo link. But honestly, self-hosting is where the fun is, because you control the sandbox limits.
Final Thoughts
Is PentAGI ready to replace your annual penetration test? Not yet. But it's a fantastic tool for continuous security validation. Set it to run against your staging environment after every deployment, and you'll catch common misconfigurations before an attacker does.
The project is still evolving, and the UI shows its age in places, but the architecture is solid. If you've ever been curious about how LLMs can handle multi-step tasks in a security context, this is a great sandbox to learn from. Just don't point it at anything you don't own.
Found this interesting? Follow @githubprojects for more developer tools and open-source discoveries.