Introducing a new way to review your PRs.

Read the announcement

greydgl / pentestgpt

Automated Penetration Testing Agentic Framework Powered by Large Language Models

View on GitHub

13 documents · Updated Nov 16, 2026

overview

Knowledge Base updated: 2026-11-16

Knowledge Base Index

1. Orientation

This repository contains PentestGPT implementations and agent infrastructure: a redesigned pentestgpt_agent package, a reusable unified_agent abstraction, and the legacy PentestGPT CLI/LLM stack. The highest-level runtime flow is an agent-driven penetration-testing loop: tasks/plans are created, an agent/backend executes actions, memory/trace state records progress, and reports or events expose results.

Main parts:

  • unified_agent/ — backend-neutral agent, task, event, tool-server, and skill-loading framework.
  • pentestgpt_agent/ — redesigned PentestGPT domain model and execution/trial loop packaged as a standalone Python project.
  • pentestgpt_legacy/ — legacy interactive CLI, prompt/reporting helpers, and LLM provider abstraction.
  • tests/ and pentestgpt_agent/tests/ — repository-level and package-local pytest coverage.
  • Root Docker, Makefile, setup, and script files — development/container runtime and operational helpers.

Critical state is mostly local and in-process rather than persisted in a database:

  • Agent/task/memory/trace objects live in Python runtime objects under unified_agent/ and pentestgpt_agent/src/pentestgpt_agent/.
  • Skill pinning/configuration lives in skills-lock.json.
  • Runtime configuration comes from environment variables, .env.example, root/package pyproject.toml, Docker Compose, and helper scripts.
  • There is no repository-defined database, queue, object store, cache, or vector store schema.

2. Architecture diagrams

flowchart TD
  subgraph Unified[unified_agent]
    UA[agent.py]
    UT[task/events/types]
    UB[backends]
    UTools[tools/tool_server]
    USkills[skills.py]
  end

  subgraph NewPG[pentestgpt_agent]
    Domain[domain model]
    Exec[execution/loop/trial]
    Pkg[package tests/docs]
  end

  subgraph Legacy[pentestgpt_legacy]
    CLI[main/config]
    Orch[pentest_gpt/task_handler]
    Prompt[prompts/reporting]
    LLM[llm providers]
  end

  subgraph Dev[repo runtime]
    Docker[Dockerfile/compose]
    Scripts[scripts/setup]
    Tests[tests]
  end

  UA --> UT
  UA --> UB
  UA --> UTools
  UA --> USkills
  Exec --> Domain
  CLI --> Orch
  Orch --> Prompt
  Orch --> LLM
  Tests --> Unified
  Tests --> Legacy
  Pkg --> NewPG
  Docker --> Unified
  Docker --> Legacy
flowchart LR
  Plan[plan/task input] --> Loop[trial or loop]
  Loop --> Exec[execution step]
  Exec --> Memory[memory]
  Exec --> Trace[trace/audit]
  Exec --> Result[result or next action]
  Result --> Loop
sequenceDiagram
  participant CLI as legacy main.py
  participant Orchestrator as pentest_gpt/task_handler
  participant Prompts as prompts + prompt_select
  participant Client as llm client/factory
  participant Provider as provider implementation
  CLI->>Orchestrator: start interactive pentest
  Orchestrator->>Prompts: select/build prompt
  Orchestrator->>Client: request model response
  Client->>Provider: dispatch provider call
  Provider-->>Client: response text
  Client-->>Orchestrator: normalized response
  Orchestrator->>CLI: next action/report content
flowchart TD
  Task[Unified task] --> Agent[unified_agent.agent]
  Agent --> Backend[Claude Code or Codex backend]
  Agent --> ToolServer[tool_server]
  Agent --> Skills[skills registry/lock]
  Backend --> Events[events]
  ToolServer --> ToolResults[tool results]
  Events --> TaskState[task lifecycle state]

3. Glossary

  • PentestGPT — the repository’s penetration-testing assistant/application, represented by both legacy and redesigned implementations.
  • unified_agent — backend-neutral agent framework that coordinates tasks, tools, skills, events, and concrete coding-agent backends.
  • pentestgpt_agent — the redesigned standalone PentestGPT package with domain objects and execution/trial loops.
  • skills-lock.json — repository-level skill lock/configuration file consumed by the unified agent skill system.

4. Codebase-wide invariants

5. Routing table