s0ld13rr/pentestcode
Security & PrivacyMulti-agent autonomous pentesting agent in the terminal with shared engagement state, 18 parser tools, and 13 specialist agents.
What it is
PentestCode is a terminal-based autonomous penetration-testing agent, built as a hard fork of OpenCode and reoriented from code editing to offensive security. You give it a target and a goal; it runs tools, parses output, updates a shared model of the engagement, and decides the next step. The project is in beta.
The architecture follows a strategist-coordinator model: a lead pentest agent splits an engagement into tasks and dispatches 13 specialist subagents — recon, scanner, enumerator, exploiter, identity (AD/Kerberos), infrastructure, webapp, post-exploit, exploit-dev, critic, reporter, plus hidden context/session agents. All agents read and write one structured engagement state covering hosts, services, vulnerabilities, credentials, access, relationships, AD domain data, network segments, and attack paths. State persists across sessions, and a human-readable findings.md records discoveries with timestamps.
It targets penetration testers, CTF players, bug-bounty hunters, and infrastructure security work README.
Quick start
Prerequisites: Linux or macOS on x64 or arm64, plus credentials for one supported LLM provider. The installed artifact is a single self-contained binary, so Bun and Node are not required.
npm install -g pentestcode-ai
# or
curl -fsSL https://raw.githubusercontent.com/s0ld13rr/pentestcode/main/install.sh | bash
On Arch Linux, paru -S pentestcode-bin is also documented. Then connect a provider and start a session:
pentestcode auth login
pentestcode
# one-shot
pentestcode --prompt "scan 10.10.10.0/24 and enumerate all services"
From source, the README uses bun install and bun run build --single --skip-embed-web-ui, producing the binary under packages/opencode/dist/pentestcode-<os>-<arch>/bin/pentestcode install options.
Inside a session, slash commands such as /status, /vulns, /creds, /scope, /phase, and /report expose the engagement state. Three execution modes control autonomy: auto runs phases autonomously, guided proposes each action for approval, and free bypasses the phase structure and scope checks. Pause behavior can be combined with these modes.
Configuration and tools
Configuration lives in .pentestcode/pentestcode.jsonc, where you select a provider and model, for example an Anthropic model. Over 20 providers are supported through the ai-sdk, including Anthropic, OpenAI, Google, Azure, AWS Bedrock, and Ollama configuration.
Beyond bash, 18 built-in pentest tools handle parsing and state. Parser tools are mandatory: after an nmap run, the output must pass through nmap_parse rather than being grepped by hand, so findings reach the engagement state. Other tools parse Nuclei, NetExec, Gobuster, SharpHound, and sqlmap output, analyze JWTs and XSS, plan credential sprays, validate scope, suggest attack paths, manage tunnels, control phases, and generate reports. Nineteen on-demand skills — phase checklists, service knowledge, and playbooks — load as plain Markdown, and custom skills can be added by dropping a SKILL.md into the skills directory.
Constraints
- Authorization is required. The project states it is for authorized security testing, education, and research; users are responsible for having permission before testing any system.
- Platform support is limited to Linux and macOS; Windows is not listed for the prebuilt binary.
- LLM dependency: the agent's behavior, cost, and token use depend on the configured provider and model; the README notes rough edges expected in beta.
- Mode risk:
freemode bypasses scope checks, so scope enforcement depends on which mode you use. - License is MIT.
HotRepo's take
PentestCode's only recorded HotRepo snapshot is 16 November 2026 on the TypeScript daily list, where it reached 8th place with 34 stars added that day, bringing the repository to 1,080 stars and 174 forks. No all-language daily rank or longer time series is available, so the record supports one day's performance rather than a trend.
The technical differentiator it describes is the shared engagement state plus mandatory parser tools, which force tool output into structured records instead of leaving it in chat history. Combined with persistent state and subagent specialization, that is a concrete design choice beyond wrapping an LLM in a prompt; whether it holds up in real engagements is what the open beta and issue reports are meant to establish.
Written by AI from the project's README, updated . The project's own docs are the source of truth.
You might also like
- vxcontrol/pentagiLets security teams run an autonomous, self-hosted multi-agent pentest that drives real tools like nmap and Metasploit against authorized targets.
- Armur-Ai/Pentest-Swarm-AIAn open-source, self-hosted alternative to XBOW that runs a swarm of LLM agents to find and prove web/API vulnerabilities.
- KeygraphHQ/shannonAn autonomous agent that reads your web app's source, then runs real exploits against a staging copy to prove vulnerabilities.
- N1nEmAn/sapper-v2Multi-agent pentest orchestration harness that coordinates swappable AI agent CLIs over a shared fact graph.
- Haryy985/yunkun-console-previewA preview console that keeps authorized pentest tasks, agent traces, HTTP evidence and findings in one workspace.