An AI red team in your terminal that remembers every scan
PentestCode exists so autonomous pentest agents don't forget their own scans: it coordinates 13 specialist AI subagents through a shared, persistent engagement state that tracks every host, credential, and attack path from recon to post-exploit.

What it does
PentestCode is an autonomous penetration testing agent that lives in your terminal. Give it a target and it chains reconnaissance, enumeration, exploitation, and post-exploitation using real tools like nmap, gobuster, and NetExec. A lead strategist agent breaks the engagement into parallel tasks for specialist subagents, while a structured engagement state tracks hosts, vulnerabilities, credentials, and access levels across sessions.
The interesting bit
The architecture borrows from HPTSA research: a coordinator dispatches 13 specialist agents—recon, scanner, AD identity, exploit-dev, critic, and others—that all read and write to one shared engagement state. This isn’t a chat log; it’s an entity graph with attack paths computed via Dijkstra and Yen’s K-shortest algorithms, so the system can calculate routes from initial access to domain admin. State persists to disk, so you can close your laptop mid-engagement and resume tomorrow.
Key highlights
- 13 parallel specialist agents with distinct system prompts and tool permissions, coordinated by a lead strategist
- Mandatory parser tools (e.g.,
nmap_parse,cme_parse,bloodhound_parse) that force raw tool output into structured state instead of letting the LLM guess from grep - Persistent engagement state tracking hosts, services, vulnerabilities, credentials, and Active Directory domain models with relationship graphs and cost-based attack path suggestions
- 19 on-demand knowledge packs—phase checklists, service guides, and playbooks—loaded only when relevant to conserve context window
- Self-contained binary for Linux and macOS (x64/arm64) supporting 20+ LLM providers via ai-sdk
Caveats
- The README labels it Beta and explicitly warns of rough edges on real engagements and CTFs
- Real-world reliability depends on LLM provider choice and how well the mandatory parsers handle messy tool output
Verdict
Worth a look if you run CTFs, authorized pentests, or bug bounty programs and want an AI assistant that tracks state instead of forgetting its own scans. Skip it if you need a polished, production-grade tool without beta quirks—or if your security model prohibits autonomous agents with shell access.
Frequently asked
- What is s0ld13rr/pentestcode?
- PentestCode exists so autonomous pentest agents don't forget their own scans: it coordinates 13 specialist AI subagents through a shared, persistent engagement state that tracks every host, credential, and attack path from recon to post-exploit.
- Is pentestcode open source?
- Yes — s0ld13rr/pentestcode is open source, released under the MIT license.
- What language is pentestcode written in?
- s0ld13rr/pentestcode is primarily written in TypeScript.
- How popular is pentestcode?
- s0ld13rr/pentestcode has 690 stars on GitHub.
- Where can I find pentestcode?
- s0ld13rr/pentestcode is on GitHub at https://github.com/s0ld13rr/pentestcode.