SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.06782 · 2023

PentestGPT: An LLM-empowered Automatic Penetration Testing Tool

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2308.06782.json · badge: /api/ran/2308.06782.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
greydgl/pentestgpt community (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
isamu-isozaki/PentestGPT community (classifier label)
classifier basis not recorded on the link
2 ran · 2 no recorded run
FunctionStatusWhere it lives
failure_detail Ran
ran on a synthesized input
greydgl/pentestgpt/pentestgpt_agent/src/pentestgpt_agent/trace.py
code served (permissive licence) · get_code("95e0b9c8390b6cdb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from dataclasses import dataclass
from typing import Any

@dataclass(frozen=True)
class EpisodeTrace:
    input: dict[str, Any]
    events: tuple[dict[str, Any], ...]
    output: dict[str, Any] | None
    truncated_tail: bool

# Construct a valid EpisodeTrace with turn_completed event showing failure
trace = EpisodeTrace(
    input={"prompt": "test prompt"},
    events=(
        {
            "type": "turn_completed",
            "success": False,
            "stop_reason": "error_max_tokens",
            "error": "Maximum tokens exceeded"
        },
    ),
    output={"text": "some output", "error": None},
    truncated_tail=False
)

# Construct fallback string
fallback = "Unknown failure"

ARGS = {
    "trace": trace,
    "fallback": fallback
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
has_action_receipts Ran
ran on a synthesized input
greydgl/pentestgpt/pentestgpt_agent/src/pentestgpt_agent/trace.py
code served (permissive licence) · get_code("5279e7a87c9fcb3d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from dataclasses import dataclass
from typing import Any

@dataclass(frozen=True)
class EpisodeTrace:
    input: dict[str, Any]
    events: tuple[dict[str, Any], ...]
    output: dict[str, Any] | None
    truncated_tail: bool

# Construct a minimal EpisodeTrace instance
trace = EpisodeTrace(
    input={"query": "test query"},
    events=(
        {"type": "command_started", "details": "start"},
        {"type": "tool_call", "name": "SomeToolName"},
        {"type": "file_changed", "path": "/some/path"},
        {"type": "tool_call", "name": "StructuredOutput"},
    ),
    output={"result": "success"},
    truncated_tail=False
)

ARGS = {
    "trace": trace
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_grounding_receipt Ran
ran on a synthesized input
greydgl/pentestgpt/pentestgpt_agent/src/pentestgpt_agent/trace.py
code served (permissive licence) · get_code("4f6792f0f35266ea")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Setup code for is_grounding_receipt function

# The function takes:
# 1. event: dict[str, Any] - an event dictionary
# 2. structured_output_call_ids: set[object] - a set of call IDs

# Based on the function logic, we need to test different event types and conditions:
# - 'command_run' type with exit_code as int
# - 'tool_result' type with call_id, is_error, and exit_code

# Create test events
event_command_run = {
    'type': 'command_run',
    'exit_code': 0
}

event_tool_result_valid = {
    'type': 'tool_result',
    'call_id': 'call_123',
    'is_error': False,
    'exit_code': 0
}

event_tool_result_error = {
    'type': 'tool_result',
    'call_id': 'call_456',
    'is_error': True,
    'exit_code': 1
}

event_tool_result_structured = {
    'type': 'tool_result',
    'call_id': 'call_789',
    'is_error': False,
    'exit_code': None
}

# Create structured_output_call_ids set
structured_output_call_ids = {'call_789', 'call_999'}

# Use one of the test events as the main argument
ARGS = {
    'event': event_tool_result_valid,
    'structured_output_call_ids': structured_output_call_ids
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_config Ran
ran on a synthesized input
isamu-isozaki/PentestGPT/pentestgpt/utils/chroma_vector_db.py
code served (permissive licence) · get_code("7a1136c6fe8b4ff9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os
import yaml

# Create a temporary YAML file with valid content
temp_dir = tempfile.mkdtemp()
config_file = os.path.join(temp_dir, "config.yaml")

config_data = {
    "model": "test_model",
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 10,
    "layers": [64, 128, 256]
}

with open(config_file, 'w') as f:
    yaml.dump(config_data, f)

ARGS = {
    "path": config_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize_text Ran
ran on a synthesized input
isamu-isozaki/PentestGPT/pentestgpt/utils/chroma_vector_db.py
code served (permissive licence) · get_code("edf2156bd952c7ed")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import unicodedata

ARGS = {
    'text': 'Hello-\nworld\ttest-\rwith\nnormalization'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
run_sync Ran
ran on a synthesized input
greydgl/pentestgpt/pentestgpt_legacy/llm/client.py
code served (permissive licence) · get_code("52b8d4b6b75b4447")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import asyncio
import torch
import torch.nn as nn

# Create a simple async coroutine to pass to run_sync
async def simple_coro():
    """A simple coroutine that returns a value."""
    await asyncio.sleep(0.01)
    return {"result": 42, "tensor": torch.randn(2, 4)}

# The function expects a coroutine object (awaitable)
ARGS = {
    "coro": simple_coro()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
validate_opaque_id Ran
ran on a synthesized input
greydgl/pentestgpt/pentestgpt_agent/src/pentestgpt_agent/identifiers.py
code served (permissive licence) · get_code("bd8a2eb7b24844a1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

_OPAQUE_ID = re.compile('[A-Za-z0-9][A-Za-z0-9._-]{0,127}\\Z')

def validate_opaque_id(value: str, *, label: str) -> str:
    if value in {'.', '..'} or _OPAQUE_ID.fullmatch(value) is None:
        raise ValueError(f'{label} must be 1-128 ASCII letters, digits, dots, underscores, or hyphens')
    return value

ARGS = {
    'value': 'valid_id_123',
    'label': 'test_label'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
audit_run Not yet run
unverified (harvested, no recorded run)
greydgl/pentestgpt/pentestgpt_agent/src/pentestgpt_agent/audit.py
code served (permissive licence) · get_code("82ad16ad2ac6b67f")
How it ran

no invocation recorded.

chatgpt_completion Not yet run
unverified (harvested, no recorded run)
isamu-isozaki/PentestGPT/pentestgpt/utils/chatgpt.py
code served (permissive licence) · get_code("905b9e146ab4e637")
How it ran

no invocation recorded.

dynamic_import Not yet run
unverified (harvested, no recorded run)
isamu-isozaki/PentestGPT/pentestgpt/utils/APIs/module_import.py
code served (permissive licence) · get_code("3511b0f6949c0c1d")
How it ran

no invocation recorded.

main Not yet run
unverified (harvested, no recorded run)
greydgl/pentestgpt/pentestgpt_agent/src/pentestgpt_agent/audit.py
code served (permissive licence) · get_code("a2785444ccf4813e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Penetration testing, a crucial industrial practice for ensuring system security, has traditionally resisted automation due to the extensive expertise required by human professionals. Large Language Models (LLMs) have shown significant advancements in various domains, and their emergent abilities suggest their potential to revolutionize industries. In this research, we evaluate the performance of LLMs on real-world penetration testing tasks using a robust benchmark created from test machines with platforms. Our findings reveal that while LLMs demonstrate proficiency in specific sub-tasks within the penetration testing process, such as using testing tools, interpreting outputs, and proposing subsequent actions, they also encounter difficulties maintaining an integrated understanding of the overall testing scenario. In response to these insights, we introduce PentestGPT, an LLM-empowered automatic penetration testing tool that leverages the abundant domain knowledge inherent in LLMs. PentestGPT is meticulously designed with three self-interacting modules, each addressing individual sub-tasks of penetration testing, to mitigate the challenges related to context loss. Our evaluation shows that PentestGPT not only outperforms LLMs with a task-completion increase of 228.6\% compared to the \gptthree model among the benchmark targets but also proves effective in tackling real-world penetration testing challenges. Having been open-sourced on GitHub, PentestGPT has garnered over 4,700 stars and fostered active community engagement, attesting to its value and impact in both the academic and industrial spheres.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2308.06782")
get_code_for_paper("2308.06782")
have("2308.06782")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2308.06782.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2308.06782.svg)](https://syntology.ai/paper/2308.06782)

Connect an agent — have() is free.