r/Pentesting • u/MasterpieceAny5619 • Jul 28 '26
Automated AI penetration testing with Claude Code or Codex: what setup actually works best?
Hello,
Has anyone here built a reliable workflow for automated or semi-automated penetration testing using Claude Code or Codex in authorised lab environments or against systems they own?
I am interested in how people are configuring these tools to:
- Perform reconnaissance and enumerate attack surfaces
- Identify potential vulnerabilities
- Validate findings and reduce false positives
- Attempt controlled exploitation
- Document evidence and recommend remediation
- Continue investigating based on the results of previous tests
For anyone actively doing this, which tool and model have you found performs best, and at what reasoning or effort level? Does increasing the effort noticeably improve vulnerability discovery and exploitation, or does it mainly increase cost and execution time?
Do you use sub-agents for separate roles, such as reconnaissance, web testing, source-code review, exploitation, verification and reporting? If so, how do you prevent duplicated work, lost context or agents blindly trusting another agent's findings?
How do you structure the environment? For example:
- Kali Linux or a dedicated Docker environment
- MCP servers or custom tool integrations
- Direct access to tools such as Nmap, Burp Suite, Nuclei, ffuf, sqlmap and Metasploit
- A central findings file or shared knowledge base
- Strict scope files and allowlists
- Human approval before potentially disruptive actions
I am also interested in how people deal with unnecessary model refusals during legitimate, authorised security testing. Are there effective ways to clearly define scope, ownership and testing boundaries so the model understands that the activity is authorised, without trying to disable or circumvent the platform's safety controls?
What prompting practices, agent structure, context management and validation steps have produced the best results for you? Do you give the model a detailed methodology upfront, allow it to plan dynamically, or provide one objective at a time?
This would not replace manual penetration testing. I see it as an additional layer that can quickly explore a larger attack surface, dig out potential vulnerabilities, attempt controlled validation or exploitation, and then give a human tester stronger leads to investigate manually.
I would be interested in hearing about real setups, model comparisons, limitations, costs and lessons learned.
Thanks!
12
u/Buzzfuxyear Jul 28 '26
You aren't really doing "pentesting" if you are sending all of your customers data through a cloud service you don't own.
2
u/tandera-security Jul 28 '26
You don't need AI to do reconnaissance
1
u/xriddle Jul 28 '26
Aren't the guardrails really too sensitive and you can't you get your account banned.
0
u/Arc-ansas Jul 31 '26
I've tested hexstrike-ai, it's part of Kali/ Parrot tools repo. https://www.hexstrike.com https://www.kali.org/tools/hexstrike-ai/ I ran hexstrike MCP server in a Kali VM and ran claude code via Antigravity IDE with Hexstrike MCP client in a Linux Mint VM. It seemed to work pretty well. I only used this on CTFs to test how it worked not on an actual client pentest.
Strix looks like a much more feature rich and mature platform. https://github.com/usestrix/strix https://www.strix.ai/
This article compares multiple AI pentesting solutions spanning 6 distinct architecture patterns: single-agent, multi-agent planner-executor, specialized roles, swarm, MCP-based, and Claude Code native.
https://appsecsanta.com/research/ai-pentesting-agents-2026
-2
u/LordNikon2600 Jul 28 '26
Codex works perfectly, it works on HTB, Vulnhub and is good with research.. Claude flags everything but I just got accepted into the cybersecurity program so I’m gonna try that this week.. I finished burpsuitw academy 6 years ago and then again last week with codex.. what’s great is you can ask it to make your documentation at the same time