September 4, 2026
๐ค PentestCode: The Multi-Agent AI That Automates Penetration Testing ๐ฅ
What if your penetration-testing workflow could have an AI team instead of a single AI assistant?
By Pentester Club
8 min read
Reconnaissance. Scanning. Enumeration. Web testing. Active Directory analysis. Credential analysis. Post-exploitation. Attack-path discovery. Reporting.
Instead of asking an AI chatbot to explain what nmap does, PentestCode is designed to operate as an autonomous penetration-testing agent directly from the terminal.
The project combines multi-agent AI, security tooling, persistent engagement state, automated reasoning, and structured evidence tracking into a single offensive-security workflow.
The project is available as open source on GitHub:
GitHub: https://github.com/s0ld13rr/pentestcode
๐ง What Is PentestCode?
PentestCode describes itself as an AI penetration-testing agent for the terminal.
Its key idea is different from simply putting a penetration-testing prompt into an LLM.
Instead of:
Human
โ
LLM
โ
AnswerHuman
โ
LLM
โ
AnswerPentestCode is designed around:
โโโโโโโโโโโโโโโโโโโโโ
โ Lead Pentest AI โ
โ Strategist/Coord. โ
โโโโโโโโโโโฌโโโโโโโโโโ
โ
โโโโโโโโโโโโฌโโโโโโโโผโโโโโโโโโฌโโโโโโโโโโโ
โ โ โ โ โ
Recon Scanner Web Identity Post-Exploit
โ โ โ โ โ
โโโโโโโโโโโโดโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโ
โ
โ
Shared Engagement State
โ
โ
Findings / Reportโโโโโโโโโโโโโโโโโโโโโ
โ Lead Pentest AI โ
โ Strategist/Coord. โ
โโโโโโโโโโโฌโโโโโโโโโโ
โ
โโโโโโโโโโโโฌโโโโโโโโผโโโโโโโโโฌโโโโโโโโโโโ
โ โ โ โ โ
Recon Scanner Web Identity Post-Exploit
โ โ โ โ โ
โโโโโโโโโโโโดโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโ
โ
โ
Shared Engagement State
โ
โ
Findings / ReportThe repository currently describes 13 agents, including specialists for reconnaissance, scanning, enumeration, exploitation, identity/Active Directory, infrastructure, web applications, post-exploitation, exploit development, false-positive checking, reporting, and supporting session/context management.
That is the interesting part.
It's designed as a team of agents rather than a single AI conversation.
๐ฅ From One Instruction to a Security Workflow
The project demonstrates a workflow where a high-level penetration-testing objective can be broken into multiple stages.
Conceptually:
Target
โ
Reconnaissance
โ
Port & Service Discovery
โ
Technology Identification
โ
Enumeration
โ
Vulnerability Discovery
โ
Validation
โ
Access Analysis
โ
Attack-Path Analysis
โ
Post-Exploitation
โ
Evidence Collection
โ
ReportingTarget
โ
Reconnaissance
โ
Port & Service Discovery
โ
Technology Identification
โ
Enumeration
โ
Vulnerability Discovery
โ
Validation
โ
Access Analysis
โ
Attack-Path Analysis
โ
Post-Exploitation
โ
Evidence Collection
โ
ReportingThe important distinction is that information discovered in one stage can become context for another stage.
For example:
Scanner discovers service
โ
Enumerator receives service information
โ
Web agent investigates web surface
โ
Identity agent investigates AD context
โ
Critic evaluates findings
โ
Reporter receives validated evidenceScanner discovers service
โ
Enumerator receives service information
โ
Web agent investigates web surface
โ
Identity agent investigates AD context
โ
Critic evaluates findings
โ
Reporter receives validated evidenceThis creates a much more connected workflow than running isolated security tools.
๐ค Multi-Agent Architecture
One of PentestCode's core concepts is the strategist/coordinator model.
A lead agent coordinates specialized agents rather than trying to perform every task itself.
The repository lists specialists covering areas such as:
- ๐ Reconnaissance
- ๐ฌ Scanning
- ๐งญ Enumeration
- ๐ฅ Exploitation
- ๐ Identity / Active Directory / Kerberos
- ๐ Web applications
- ๐๏ธ Infrastructure
- ๐งช Post-exploitation
- ๐ ๏ธ Exploit development
- ๐ง False-positive criticism
- ๐ Reporting
- ๐ง Context compression
- ๐พ Session management
This architecture matters because penetration testing is rarely linear.
A discovery in one area can completely change what should happen next.
๐ง The Biggest Feature: Shared Memory
Perhaps the most interesting feature isn't the AI itself.
It's the persistent engagement state.
PentestCode maintains structured information about the engagement so agents don't have to rediscover everything from scratch.
The project tracks concepts such as:
Hosts & Services
IP
Hostname
OS
Ports
Service versions
BannersIP
Hostname
OS
Ports
Service versions
BannersVulnerabilities
Severity
Status
Evidence
ConfidenceSeverity
Status
Evidence
ConfidenceCredentials
Username
Credential type
Hash/password
Domain
Accessible servicesUsername
Credential type
Hash/password
Domain
Accessible servicesAccess
Shell
RDP
Database
Privilege level
Target hostShell
RDP
Database
Privilege level
Target hostRelationships
The system can represent relationships such as:
EXPLOITED_VIA
CREDENTIAL_FROM
ADMIN_OF
PIVOT_TOEXPLOITED_VIA
CREDENTIAL_FROM
ADMIN_OF
PIVOT_TOIt also maintains information related to:
- Active Directory
- Trust relationships
- Password policies
- GPOs
- Network segments
- Pivot hosts
- Attack paths
The repository says this state persists between sessions, allowing an engagement to be resumed later.
๐ธ๏ธ Attack-Path Analysis
This is where the project becomes particularly interesting from an AI-security perspective.
Modern penetration testing isn't just about finding vulnerabilities.
The real question is:
How can multiple weaknesses combine into an attack path?
Imagine:
Internet-facing service
โ
Low-privileged account
โ
Internal service
โ
Credential discovery
โ
Privileged account
โ
Administrative accessInternet-facing service
โ
Low-privileged account
โ
Internal service
โ
Credential discovery
โ
Privileged account
โ
Administrative accessIndividually, some of these findings might appear relatively minor.
Together, they could represent a serious security risk.
PentestCode's engagement state includes relationships and attack-path concepts, with the repository describing cost-based path finding using Dijkstra and Yen's K-shortest-path approaches.
This is a powerful direction for automated security assessment.
๐ ๏ธ Built-In Security Tooling
PentestCode isn't simply an LLM wrapper around a shell.
The repository currently describes 18 built-in pentesting tools beyond Bash, including parser-oriented tools that convert results from security utilities into structured engagement data.
Examples include:
Nmap Parser
nmap XML
โ
nmap_parse
โ
Hosts + Servicesnmap XML
โ
nmap_parse
โ
Hosts + ServicesNuclei Parser
Nuclei JSON
โ
nuclei_parse
โ
VulnerabilitiesNuclei JSON
โ
nuclei_parse
โ
VulnerabilitiesNetExec Parser
NetExec output
โ
cme_parse
โ
Credentials + Access + HostsNetExec output
โ
cme_parse
โ
Credentials + Access + HostsGobuster Parser
Directory discovery
โ
gobuster_parse
โ
Classified findingsDirectory discovery
โ
gobuster_parse
โ
Classified findingsBloodHound Parser
SharpHound data
โ
bloodhound_parse
โ
Active Directory modelSharpHound data
โ
bloodhound_parse
โ
Active Directory modelOther capabilities described by the project include:
- SQLMap output parsing
- XSS analysis
- JWT analysis
- Credential-spray planning
- Scope validation
- Attack-path suggestions
- Tunnel management
The important architectural idea is:
Tool output becomes structured intelligence.
๐ Why Parsing Matters
Traditional automation often looks like this:
Run tool
โ
Save output
โ
Parse text
โ
Human interpretationRun tool
โ
Save output
โ
Parse text
โ
Human interpretationPentestCode tries to make the workflow more structured:
Run tool
โ
Structured parser
โ
Engagement state
โ
Agent reasoning
โ
Next taskRun tool
โ
Structured parser
โ
Engagement state
โ
Agent reasoning
โ
Next taskThat means a result isn't simply sitting in a terminal buffer.
It becomes part of the model of the engagement.
๐งช False-Positive Checking
One of the most important challenges with AI security agents is hallucination.
Finding a potential vulnerability isn't enough.
A security professional needs to ask:
Is it actually exploitable?
PentestCode includes a critic-oriented agent intended to help challenge findings and reduce false positives.
A conceptual workflow is:
Potential Finding
โ
Evidence Collection
โ
Validation
โ
Critic Agent
โ
Confirmed / Rejected
โ
ReportPotential Finding
โ
Evidence Collection
โ
Validation
โ
Critic Agent
โ
Confirmed / Rejected
โ
ReportThis is an important design principle for autonomous security systems.
The AI shouldn't simply maximize the number of findings.
It should maximize the number of useful, defensible findings.
๐ Persistent Findings
Another useful feature is the human-readable findings.md file.
The project describes it as a running record of vulnerabilities, credentials, access gains, timestamps, and associated evidence.
That means an operator can monitor the engagement while it is running.
Conceptually:
tail -f findings.mdtail -f findings.mdThis can provide a human-readable window into what the autonomous workflow is discovering.
๐ Web Application Security
PentestCode includes a web-application-focused agent with knowledge around the OWASP Top 10.
That makes the architecture relevant to application-security workflows involving areas such as:
- Authentication
- Authorization
- Injection
- Security misconfiguration
- Sensitive-data exposure
- Access-control problems
- API security
- Session security
The important concept is not that AI replaces Burp Suite, Nuclei, Nmap, or other established tools.
Instead:
AI can coordinate security tools and reason about their results.
๐ Active Directory Security
Enterprise environments are another major area where this architecture becomes interesting.
Active Directory attacks often involve relationships rather than isolated vulnerabilities.
For example:
User
โ
Group Membership
โ
Computer
โ
Service Account
โ
Privilege
โ
Administrative RelationshipUser
โ
Group Membership
โ
Computer
โ
Service Account
โ
Privilege
โ
Administrative RelationshipPentestCode maintains an AD-oriented model containing concepts such as:
- Domain controllers
- Trusts
- Administrators
- Password policies
- GPOs
Combined with relationship mapping, this can help an agent reason about potential attack paths within an authorized assessment.
๐งฌ Attack Graphs Instead of Simple Lists
Traditional vulnerability scanners often produce:
Finding #1
Finding #2
Finding #3
Finding #4Finding #1
Finding #2
Finding #3
Finding #4But attackers think differently.
They ask:
What can I reach?
What can I authenticate to?
What credentials can unlock another system?
What privilege can I gain?
Where can I pivot?
What is the shortest path to the objective?What can I reach?
What can I authenticate to?
What credentials can unlock another system?
What privilege can I gain?
Where can I pivot?
What is the shortest path to the objective?An attack graph represents those relationships.
For example:
[Web Server]
โ
โ credential
โผ
[User Account]
โ
โ access
โผ
[Internal Server]
โ
โ privilege relationship
โผ
[Admin Account]
โ
โผ
[Domain Controller][Web Server]
โ
โ credential
โผ
[User Account]
โ
โ access
โผ
[Internal Server]
โ
โ privilege relationship
โผ
[Admin Account]
โ
โผ
[Domain Controller]This is closer to how complex penetration tests actually evolve.
๐ 20+ LLM Providers
PentestCode isn't locked to a single AI provider.
The repository says it works with 20+ providers through AI SDK, including providers such as:
- Anthropic
- OpenAI
- Azure
- AWS Bedrock
- Ollama
- Together
- Groq
- Fireworks
- DeepSeek
- Mistral
and others.
This is useful because organizations may have different requirements around:
- Cloud AI
- Self-hosted models
- Privacy
- Cost
- Performance
- Enterprise integrations
๐ป Installation
According to the current repository, PentestCode can be installed as a self-contained binary on Linux and macOS.
One installation method is:
curl -fsSL https://raw.githubusercontent.com/s0ld13rr/pentestcode/main/install.sh | bashcurl -fsSL https://raw.githubusercontent.com/s0ld13rr/pentestcode/main/install.sh | bashThe repository also documents:
npm install -g pentestcode-ainpm install -g pentestcode-aiand a source-build option using Bun.
After installation, authentication can be configured with:
pentestcode auth loginpentestcode auth loginThen launch an interactive session:
pentestcodepentestcodeOr provide a one-shot prompt:
pentestcode --prompt "scan AUTHORIZED_TARGET and enumerate services"pentestcode --prompt "scan AUTHORIZED_TARGET and enumerate services"Always replace the example target with a system you are explicitly authorized to test.
๐งช The Best Place to Test It
If you're interested in experimenting with autonomous pentesting, don't start against production infrastructure.
Build a lab.
For example:
Your Lab
โ
โโโโโโโโโโโโผโโโโโโโโโโโ
โ โ โ
Web App Linux AD Lab
โ โ โ
โโโโโโโโโโโโผโโโโโโโโโโโ
โ
PentestCode
โ
Findings / StateYour Lab
โ
โโโโโโโโโโโโผโโโโโโโโโโโ
โ โ โ
Web App Linux AD Lab
โ โ โ
โโโโโโโโโโโโผโโโโโโโโโโโ
โ
PentestCode
โ
Findings / StateGood environments include:
- Local vulnerable applications
- CTF machines
- Isolated virtual machines
- Home security labs
- Authorized staging environments
This lets you experiment without risking third-party systems.
๐ฅ Example Workflow for a Lab
A safe learning workflow could look like:
1๏ธโฃ Define the scope
TARGET = authorized lab networkTARGET = authorized lab network2๏ธโฃ Start the agent
pentestcodepentestcode3๏ธโฃ Authenticate your selected LLM provider
pentestcode auth loginpentestcode auth login4๏ธโฃ Give it a scoped objective
Assess the authorized lab environment and enumerate exposed services.Assess the authorized lab environment and enumerate exposed services.5๏ธโฃ Observe the engagement state
/status/status6๏ธโฃ Review findings
/vulns/vulns7๏ธโฃ Review credential/access state
/creds/creds8๏ธโฃ Inspect the resulting evidence
Review the generated findings and verify important conclusions manually.
๐ง AI Doesn't Replace the Pentester
This is probably the most important lesson.
Autonomous security tools can be powerful.
But penetration testing isn't simply:
Run scanner โ get vulnerabilitiesRun scanner โ get vulnerabilitiesProfessional testing requires:
- Scope management
- Threat modeling
- Business-context understanding
- Evidence validation
- Risk assessment
- Manual verification
- Safe exploitation
- Clear reporting
- Communication with stakeholders
AI can accelerate many of these tasks.
It doesn't eliminate the responsibility of the human operator.
โ ๏ธ Autonomous Pentesting Has Real Risks
Giving an AI agent access to security tools creates a new class of security concerns.
An autonomous agent can potentially:
- Execute commands
- Generate network traffic
- Discover systems
- Handle credentials
- Modify state
- Attempt exploitation
- Move between systems
That means authorization and containment are critical.
A safe deployment should consider:
Scope Controls
Only allow explicitly authorized targets.
Least Privilege
Give the agent the minimum permissions required.
Network Isolation
Use segmented lab networks where possible.
Credential Isolation
Don't expose unnecessary production credentials.
Logging
Record commands, tool outputs, findings, and decisions.
Human Approval
Require manual approval for high-impact actions.
๐ The Security Principle: Evidence Over Confidence
One of the most important design philosophies for autonomous security systems should be:
A confident AI answer is not the same thing as evidence.
A strong workflow should look like:
AI Hypothesis
โ
Evidence
โ
Validation
โ
Independent Review
โ
Confirmed FindingAI Hypothesis
โ
Evidence
โ
Validation
โ
Independent Review
โ
Confirmed FindingNot:
AI Says Vulnerable
โ
Report CriticalAI Says Vulnerable
โ
Report CriticalThis distinction becomes increasingly important as AI agents become capable of performing real security operations.
๐ Why PentestCode Is Interesting
There are already countless tools for:
- Port scanning
- Vulnerability scanning
- Web enumeration
- Password auditing
- Network discovery
- Exploitation
- Reporting
The interesting problem isn't necessarily creating another scanner.
The bigger challenge is orchestration.
How do you make dozens of tools work together?
How do you preserve context?
How do you decide what to investigate next?
How do you avoid repeating the same work?
How do you connect credentials to services?
How do you identify attack paths?
How do you distinguish a theoretical vulnerability from a verified one?
PentestCode is an interesting experiment in answering those questions with multi-agent AI.
๐ฎ The Future of AI-Powered Pentesting
We're moving toward a security workflow that may look something like:
Human Operator
โ
โผ
Security Objective
โ
โผ
AI Security Strategist
โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โ โ โ
Recon Web Infrastructure
โ โ โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โ
Shared Security State
โ
โ
Attack Graph
โ
โ
Validation
โ
โ
Human Review
โ
โ
ReportHuman Operator
โ
โผ
Security Objective
โ
โผ
AI Security Strategist
โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โ โ โ
Recon Web Infrastructure
โ โ โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โ
Shared Security State
โ
โ
Attack Graph
โ
โ
Validation
โ
โ
Human Review
โ
โ
ReportThe human becomes less focused on manually executing every command and more focused on:
strategy + validation + risk + decision-making.
That's a significant shift.
๐ Final Thoughts
PentestCode is an ambitious project exploring what happens when AI agents become active participants in penetration testing rather than passive assistants.
Its most interesting characteristics aren't just the LLM integration.
It's the combination of:
๐ฅ Multi-agent coordination ๐ง Persistent engagement state ๐ Automated reconnaissance ๐ ๏ธ Security-tool orchestration ๐ธ๏ธ Attack-path modeling ๐ Identity/AD analysis ๐ Web-security workflows ๐ง False-positive checking ๐ Evidence-oriented findings ๐ค Multiple LLM providers
The project is currently described as beta, so it should be approached as an evolving research and engineering project rather than a drop-in replacement for experienced penetration testers.
But the direction is fascinating.
The future penetration-testing workstation may not be:
"A terminal with 50 security tools."
It may be:
"An AI security team that knows when and why to use those 50 tools."
And that could fundamentally change how offensive security is performed.
๐ Project
PentestCode โ GitHub: https://github.com/s0ld13rr/pentestcode
License: MIT
Platform: Linux & macOS
Architecture: Multi-agent AI + persistent engagement state
Use cases: Authorized penetration testing, CTFs, bug bounty research, vulnerability research, and security assessment