Exec Summary
Intro
Lit Review
Theory
GenAI
Multi-Agent
Neurosymbolic
DevSecOps
Critique
Gap Analysis
Ethics
Future
Conclusion
References
Executive Summary Introduction Literature Review Theoretical Frameworks Generative AI Multi-Agent Systems Neurosymbolic AI DevSecOps Critical Analysis Gap Analysis Ethics & Law Future Research Conclusion References
◈Comprehensive Research Review · AI Security · Offensive Operations

Artificial Intelligence
& the Cybersecurity Integration of
Autonomous Penetration Testing

Critical Review of Methodologies, Architectures, Gaps & Proposed Solutions

Nisarg Chasmawala (shroff)
alias // HEAVEN
Penetration Tester  |  Vulnerability Assessment  |  Cybersecurity Researcher  |  Offensive Security Engineer  |  Digital Forensics
~22Min Read
13Sections
10+Frameworks
6Gap Solutions
18References
Scroll to Explore

The convergence of Artificial Intelligence (AI) with offensive cybersecurity constitutes one of the most consequential paradigm shifts in contemporary information security. This comprehensive research review examines the theoretical foundations, architectural frameworks, methodological limitations, and unresolved gaps in AI-driven autonomous penetration testing, spanning reinforcement learning, generative adversarial networks, large language models, multiagent systems, and neurosymbolic AI. Critically, this work advances beyond survey: it proposes six concrete, technically grounded solutions to the field's most significant open problems. Key findings indicate that while AI agents demonstrate credible capability under controlled benchmark conditions, systemic barriers (the Sim2Real gap, CTF benchmark overreliance, dataset staleness, LLM hallucination, and unresolved ethical liability) prevent full operational deployment at enterprise scale.

00 // Executive Summary

Key Findings at a Glance

This review synthesises current AI-driven autonomous penetration testing across five AI paradigms, ten frameworks, and six critical gaps with proposed solutions. The following provides an at-a-glance orientation.

🤖
AI Paradigm Maturity
DRL and LLM agents demonstrate benchmark capability. Multiagent systems show the strongest generalisation. Neurosymbolic integration remains nascent but critical for safety.
⚠️
Critical Gaps
Sim2Real gap, CTF overreliance, dataset staleness, LLM hallucination, reward brittleness, and ethical liability are the six principal barriers to operational deployment.
🔬
Methodological Concerns
CTF-based benchmarks systematically overestimate agent readiness. Simulation fidelity is inadequate for enterprise-grade evaluation of autonomous agents.
🛠️
Proposed Solutions
Six concrete gap-resolution strategies: ENTERPRISE-BENCH, federated honeypot RL, RAG-LLM validation, IRL reward inference, temporal dataset pipelines, and governance frameworks.
⚖️
Regulatory Landscape
EU AI Act, US National Cybersecurity Strategy, and UK AI Safety Institute guidance converge on mandatory HITL oversight for autonomous offensive AI at enterprise scale.
🔭
Research Trajectory
Near-term: cognitive augmentation. Medium-term: hybrid neurosymbolic autonomous agents. Long-term: certified autonomous red team systems operating within formal governance frameworks.
Background & Context
01 // Introduction

Introduction and Research Context

The Asymmetric Security Problem

The field of cybersecurity is inherently asymmetric. Where defenders must simultaneously secure every conceivable vector across an entire infrastructure, an adversary needs to identify and exploit just a single viable vulnerability to achieve initial compromise. This asymmetry defines the economics of cyber conflict. As modern digital ecosystems evolve into hypercomplex systems composed of cloud-native architectures, microservices meshes, IoT fleets, and serverless functions, the aggregate attack surface expands at an exponential rate that human-driven security programmes cannot sustainably match.

Legacy approaches (annual penetration testing engagements and signature-based scanners) are operationally inadequate against threat actors who exploit zero-days within hours of disclosure and use automation to enumerate attack surfaces at machine scale. The convergence of AI and ML with offensive security functions is the field's most promising structural response.

Historical Evolution

Penetration testing has evolved through three generations. The first generation (pre-2000s): manual, expert-driven assessments using ad-hoc tooling. The second generation (2000-2015): commercial vulnerability scanners, exploitation frameworks such as Metasploit, and standardised methodologies (OWASP, PTES, NIST SP 800-115), scripted tools executing predefined patterns without adaptive reasoning. The third generation, now forming, is characterised by AI-driven autonomous agents capable of reasoning, planning, and adapting within dynamic adversarial environments.

"AI can already discover vulnerabilities. Under controlled conditions it demonstrably does. The open question is whether it can do so with the contextual intelligence, operational safety, and legal accountability that real enterprise environments demand."

Synthesised from reviewed literature

Research Objectives

Prior Work
02 // Literature Review

Literature Review

Early Reinforcement Learning Approaches

The application of RL to automated penetration testing was pioneered by Schwartz and Kurniawati (2019), who demonstrated an RL agent trained in simplified network simulation could learn to identify and exploit vulnerabilities through trial-and-error. This established the MDP formulation that dominates the field, though network models were intentionally simplistic, fewer than ten hosts, probabilistic rather than realistic mechanics.

Ghanem and Chen (2020) extended this to multi-host scenarios, demonstrating Q-learning agents could navigate multi-step attack paths involving lateral movement. Their work highlighted the reward function design challenge: agents trained with sparse binary rewards exhibited unstable learning and failed to generalise across network topologies. Hu, Beuran, and Tan (2020) introduced DRL approaches using DQN and A3C architectures, achieving significantly improved sample efficiency in simulated enterprise-scale environments.

Language Model Integration

Deng et al. introduced PentestGPT, a major inflection point: LLMs serving as strategic planners for penetration testing workflows. The modular reasoning-generation-parsing architecture addressed context coherence and achieved HackTheBox benchmark results substantially exceeding prior automated baselines. Kong et al. built upon this with VulnBot, introducing multiagent decomposition specialising individual LLM instances to domain-specific subtasks.

Tran et al. proposed DCIPHER, introducing the Auto-Prompter mechanism as a solution to the prompt engineering bottleneck. Miao et al. (2023) contributed the GAN-based web application testing dimension, demonstrating SeqGAN architectures generating novel SQL injection and XSS payload variants achieving meaningful WAF bypass rates.

Research Landscape, Key Contributions Timeline
flowchart LR A([2019 RL Pioneer]) --> B[2020 DRL DQN/A3C] B --> C[2021 Post-Exploit DRL] C --> D[2023 SeqGAN WAF] D --> E[2023 PentestGPT LLM] E --> F[2024 AutoPenBench] F --> G[2025 VulnBot MAS] G --> H[2025 DCIPHER/Auto-Prompter] H --> I[2025 PentestR1 RLEF] style A fill:#0b1629,stroke:#818cf8,color:#dde8f7 style E fill:#0b1629,stroke:#f472b6,color:#dde8f7 style G fill:#0f1e38,stroke:#00f5d4,color:#dde8f7 style I fill:#0b1629,stroke:#00f5d4,color:#00f5d4

Benchmarking and Evaluation

Gioacchini et al. produced AutoPenBench, one of the most systematic benchmarking efforts, aggregating CTF-derived tasks and providing reproducible evaluation infrastructure. Zhang et al.'s Cybench extended this to LLM-specific evaluation. Bakker and Hastings empirically demonstrated that autonomous LLM agents consistently underperformed human-assisted configurations on real CTF environments, providing empirical grounding for concerns about CTF-based benchmark overconfidence.

Theoretical Foundations
03 // Formal Models

Theoretical Frameworks in AI-Driven Security

Markov Decision Processes and the Cyber Terrain

The MDP constitutes the foundational mathematical framework for autonomous penetration testing. Formally, an MDP is the tuple (S, A, P, R, γ): state space S, action space A, transition function P, reward function R, and discount factor γ. In the cyber domain, state s ∈ S encodes discovered hosts, services, vulnerabilities, network position, and action history. Action space A encompasses port scanning, service enumeration, exploit selection, credential attacks, lateral movement, and privilege escalation.

MDP Formalisation, Penetration Testing Context
// Formal MDP tuple for autonomous pentest agent State s = { hosts: {h1:{svc:['ssh:22','http:80'],os:'Linux'}}, compromised: ['10.0.1.5'], position: '10.0.1.5', vuln_db: [{cve:'CVE-2023-44487',score:7.5}], noise_level: 0.23 // detection risk } Action a ∈ {scan(host,ports), exploit(cve,target), lateral(src,dst), escalate(method)} Reward R(s,a,s') = { +10.0 // successful host compromise +3.0 // new service discovered +1.5 // valid credential obtained -5.0 // detection event triggered -8.0 // out-of-scope action taken }

A network's state space grows combinatorially with network scale, yielding the "curse of dimensionality." Early research addressed this through binary compromise vectors. Advanced models incorporate cyber terrain concepts, explicit network topology and probabilistic transition models from real architectural constraints. Reward function engineering is the most critical design decision: naive binary rewards cause the sparse reward problem; overly shaped rewards create suboptimal local maxima. State-of-the-art approaches use multi-objective reward functions simultaneously incentivising progress, penalising noise, rewarding stealth, and enforcing scope.

MDP Autonomous Penetration Testing, Complete Decision Architecture
flowchart LR A([Target Net]) --> B[Observe State] B --> MDP{MDP Engine} MDP --> PN[Policy Net DRL/PPO] PN --> AS[Action Select] AS --> SC[Port Scan] AS --> EX[Exploit] AS --> CR[Cred Attack] SC & EX & CR --> RW{Reward R} RW -->|"+Pwn"| KB[(Knowledge Base)] RW -->|"-Alert"| MDP KB --> NS[Next State] NS --> MDP KB --> RG[/Report/] style A fill:#0b1629,stroke:#00f5d4,color:#dde8f7 style MDP fill:#0b1629,stroke:#818cf8,color:#dde8f7 style PN fill:#0f1e38,stroke:#818cf8,color:#b8d4f0 style RW fill:#0b1629,stroke:#fbbf24,color:#dde8f7 style KB fill:#020912,stroke:#00f5d4,color:#00f5d4 style RG fill:#0b1629,stroke:#34d399,color:#34d399

Deep Reinforcement Learning Architectures

Tabular Q-learning does not scale beyond small simulated networks. DRL resolves this with deep neural networks approximating the Q-value function. Key algorithms:

⚠

Sim2Real Gap: All DRL agents are trained in low-fidelity simulations, real networks impose prohibitive latency and risk. Strategies learned under clean simulation conditions routinely fail in production: service crashes, variable latency, non-deterministic defensive countermeasures, and administrator responses are absent from training environments but ubiquitous in deployment.

Generative Systems
04 // Generative AI

Generative AI and Adversarial Attack Synthesis

GANs for WAF Evasion

GANs apply adversarial training to payload synthesis. A Generator network learns to produce attack payloads (SQL injection strings, XSS vectors, serialised object attacks) while a Discriminator, co-trained against a target WAF's detection model, identifies generated vs. legitimate inputs. SeqGAN handles discrete text-based payloads by employing REINFORCE-based policy gradient estimation. Applied with semantic tokenisation, parsing payloads into functionally meaningful units rather than raw characters, SeqGAN produces structurally valid payloads with significant distributional shift from training examples, achieving meaningful bypass rates against commercial WAF deployments.

SeqGAN, Adversarial Payload Synthesis Pipeline
flowchart LR Z[Noise Seed] --> G[SeqGAN Generator] G --> P[Payload SQLi/XSS] P --> DI[Internal Disc.] P --> DW[WAF Disc.] DI & DW --> RL[REINFORCE Gradient] RL -->|Update| G P --> WAF[Prod WAF] WAF --> BR[/Bypass Rate/] style G fill:#0f1e38,stroke:#f472b6,color:#dde8f7 style P fill:#0b1629,stroke:#f472b6,color:#f472b6 style WAF fill:#0b1629,stroke:#fbbf24,color:#dde8f7 style RL fill:#0b1629,stroke:#818cf8,color:#dde8f7 style BR fill:#0b1629,stroke:#34d399,color:#34d399
◈

Miao et al. (2023) demonstrated SeqGAN-generated payloads achieving bypass rates above baseline against both commercial cloud WAF deployments and rule-based ModSecurity configurations, generating syntactically novel variants not present in the training corpus.

Large Language Models as Reasoning Engines

LLMs arrive pre-loaded with extensive semantic knowledge: code semantics across dozens of languages, security tool documentation, historical exploit patterns, and natural language vulnerability descriptions. This enables zero-shot strategic reasoning, formulating plausible attack plans for novel configurations without prior environmental interaction. However, LLMs lack grounding in current environmental state and are prone to generating syntactically plausible but factually incorrect technical outputs.

PentestGPT implements a three-module architecture: Reasoning Module maintains high-level strategy and task graph; Generation Module translates decisions into specific tool invocations; Parsing Module interprets verbose raw tool outputs back into semantic state updates. This decomposition directly addresses the "context loss" problem in extended engagements.

⚡

Hallucination Risk: LLMs generate plausible but non-existent exploit commands, library names, or CVE identifiers. A hallucinated directive executed against a production system can trigger unintended service disruption, data corruption, or outright loss, violating rules of engagement and creating legal liability.

⚡

Inter-Context Leakage: LLM agents maintaining persistent state across testing sessions risk exposing sensitive artefacts (network topology, discovered credentials, internal host configurations) from one engagement into a subsequent unrelated session. This demands rigorous session isolation protocols that current frameworks have not uniformly implemented.

Collaborative Systems
05 // Multi-Agent Systems

Multiagent Systems and Collaborative Intelligence

The dominant architectural trend is the transition from monolithic single-agent designs to Multiagent Systems (MAS), mirroring the operational structure of professional red team engagements where reconnaissance specialists, exploit developers, lateral movement experts, and report writers function as coordinated but distinct roles.

VulnBot, DAG-Orchestrated Specialisation

VulnBot (Kong et al.) implements a multiagent decomposition: Reconnaissance Agent (OSINT, network enumeration, fingerprinting), Scanning Agent (vulnerability identification, CVE correlation), and Exploitation Agent (payload generation, privilege escalation), all orchestrated by a central Planner constructing a DAG of interdependent tasks. The specialisation constraint dramatically reduces hallucination probability, each agent receives only domain-relevant information and tooling.

DCIPHER, Planner-Executor Paradigm

DCIPHER introduces heterogeneous executor agents, different agents can use different underlying models, and the Auto-Prompter: a dedicated agent dynamically generating context-aware coordination prompts for all other agents based on current engagement state. This automated prompt construction eliminates the manual prompt engineering process that required significant operator expertise in prior deployments. Empirical evaluation on NYU CTF Bench and HackTheBox demonstrates substantial outperformance over single-agent baselines.

Multiagent Architecture, VulnBot / DCIPHER Unified Framework
flowchart TD AP[Auto-Prompter] --> PL[Planner DAG Orchestrator] PL --> RA[Recon Agent] PL --> SA[Scanner Agent] PL --> EA[Exploit Agent] PL --> LA[Lateral Agent] PL --> RE[Report Agent] RA --> KB[(Shared KB)] SA --> KB EA --> KB LA --> KB KB --> PL KB --> RE style AP fill:#0b1629,stroke:#f472b6,color:#dde8f7 style PL fill:#0f1e38,stroke:#818cf8,color:#dde8f7 style KB fill:#020912,stroke:#00f5d4,color:#00f5d4 style EA fill:#0b1629,stroke:#f472b6,color:#dde8f7 style RE fill:#0b1629,stroke:#34d399,color:#34d399

CurriculumPT, Progressive Competency Development

CurriculumPT applies Curriculum Learning, training on progressively more complex tasks, to multiagent penetration testing. A curriculum scheduler manages difficulty progression; a dynamic Experience Knowledge Base (EKB) accumulates successful strategies from simpler scenarios for transfer to complex challenges. This mirrors professional security training mentorship and directly addresses the generalisation failure of standard RL.

FrameworkArchitectureKey InnovationBenchmarkMaturity
VulnBotSpecialised MASDAG task decompositionCTF / HackTheBoxResearch
DCIPHERPlanner-ExecutorAuto-Prompter agentNYU CTF BenchResearch
CurriculumPTCurriculum + MASProgressive EKB transferSimulationEarly
PentestGPTLLM ModularTask Tree memoryHackTheBoxResearch
PentestR1LLM + RLEFExpert-seeded online RLCTF / customEmerging
Hybrid Reasoning
06 // Neurosymbolic AI

Neurosymbolic AI and Knowledge Graph Integration

Deep learning excels at statistical pattern recognition but lacks the logical precision required for safe, explainable, and legally accountable security operations. Neurosymbolic AI bridges this gap by combining the representational power of neural networks with symbolic reasoning systems, formal logic engines, rule-based inference, and ontological knowledge bases.

Hybrid Architecture, Neural Perception + Symbolic Guardrails

Neural components handle perception and pattern recognition, identifying anomalous traffic, classifying service versions, estimating exploitability. Symbolic components reason over these outputs using formal logic: verifying that proposed actions fall within authorised engagement scope, correlating detected service versions with known CVE mappings, and computing logical consequences of host compromise for the attack graph.

Neurosymbolic Guard, Formal Safety Boundary
// Neural detection feeds into symbolic scope guard Neural_Detector.classify(traffic) → { anomaly_score: 0.91, pattern: 'SQL_INJECTION' } Symbolic_Guard.evaluate({ action: 'lateral_pivot', target: '10.0.2.15', scope: ['10.0.1.0/24'], roe: 'no_data_exfil' }) → { decision: BLOCKED, reason: 'Target outside authorised scope' } if (guard.decision === ALLOW) agent.execute(action);

Knowledge Graphs for Multi-Hop Attack Planning

Knowledge Graphs (KGs) encode rich relational structures between assets, software versions, CVEs, and attack paths. ThreatKG constructs such graphs from open-source threat intelligence. Upon compromising a web server, a KG-augmented agent queries for all reachable adjacent assets and their vulnerability classes, enabling transitive attack chain planning several hops ahead, a capability fundamentally unavailable to reactive, observation-only RL agents.

PentestR1: Reinforcement Learning from Expert Feedback

PentestR1 represents the current frontier: combining LLM semantic reasoning with RL policy optimisation in a two-stage training paradigm. Offline RL: fine-tuning an LLM on curated expert demonstrations for warm-start initialisation. Online RL: refining through direct interactive experience in target environments with granular stepwise reward signals, rewarding productive reconnaissance, effective command execution, and successful exploitation proportionally, while penalising redundant and scope-violating actions.

PentestR1: RLEF Two-Stage Hybrid Training Pipeline
flowchart LR ED[Expert Demos] --> ORL[Offline RL Fine-Tune] ORL --> BASE[Base LLM] BASE --> PI[Expert-Seeded Policy] PI --> ENV[Target Env] ENV --> ACT[Actions] ACT --> RWD{Step Reward} RWD -->|"Recon +1.5"| PI RWD -->|"Exploit +10"| PI RWD -->|"Fail -2"| PI PI --> KG[KGraph Query] KG --> PI PI --> RPT[/Report/] style ED fill:#0b1629,stroke:#fbbf24,color:#dde8f7 style PI fill:#0f1e38,stroke:#818cf8,color:#dde8f7 style RWD fill:#0b1629,stroke:#00f5d4,color:#dde8f7 style KG fill:#020912,stroke:#00f5d4,color:#00f5d4 style RPT fill:#0b1629,stroke:#34d399,color:#34d399
◈

PentestR1's stepwise reward modelling marks clear maturation in applied RL theory: the framework treats pentest execution as structured mentorship (rewarding productive intermediate actions, not merely terminal objective achievement) substantially improving sample efficiency and policy quality over sparse-reward predecessors.

Industrial Integration
07 // DevSecOps

CI/CD Pipeline Integration and Continuous Security

The most mature industrial application of AI penetration testing is its embedding within DevSecOps workflows. Traditional penetration testing is episodic, annual or quarterly. Modern CI/CD environments may deploy code multiple times daily, rendering periodic security testing operationally obsolete as a primary assurance mechanism.

Continuous Penetration Testing in CI/CD

AI-powered tools embedded directly into CI/CD stages (build, test, staging, pre-production) deliver Continuous Penetration Testing (CPT). The key enabling capability is differential test selection: intelligently determining which security test cases are most relevant to the specific code changes in a given commit rather than running an exhaustive full suite on every build. A commit modifying an authentication module triggers SQL injection and authentication bypass tests; a commit changing JSON parsing logic triggers deserialisation and prototype pollution tests. This "Shift Left" philosophy finds vulnerabilities in development, where remediation costs cents, rather than in production, where remediation costs orders of magnitude more.

Continuous Penetration Testing, CI/CD Integration Model
#.github/workflows/ai-security.yml - illustrative model on: [push, pull_request] jobs: ai-pentest: steps: - diff_analyzer: input: git_diff(HEAD, HEAD~1) output: targeted_test_suite[] # AI-selected - security_scan: tools: [sast, dast, dep_check] ai_mode: "differential" - exploit_validate: agent: autonomous_pentest_agent target: staging_environment max_noise: 0.1 # stealth threshold - postmortem: on: failure classify: [vuln, flaky, hallucination] generate_pr: true

The Flakiness and Trust Problem

Flaky tests, failures driven by environmental conditions rather than genuine code defects, carry amplified consequences in AI-driven security testing. A false positive blocks a deployment and erodes developer trust; a false negative provides a false sense of security more dangerous than no testing at all. Current AI security tools lack calibrated confidence outputs, ensuring a "90% confidence" finding genuinely reflects a 90% likelihood of exploitability is an open research problem at the intersection of ML theory and security engineering.

Methodological Validity
08 // Critical Analysis

Critical Review of Research Methodologies

The Simulation Fidelity Problem

Simulation offers compelling advantages (complete observability, controllable difficulty, fast execution, reproducibility) but systematically abstracts away real-world exploit dynamics: service response time variation, non-deterministic ASLR-influenced exploit success rates, partial failures where exploits crash rather than compromise, and EDR/IDS/WAF systems that alter behaviour based on observed attack patterns. These dynamics are ubiquitous in production but absent from training environments.

⚠

Sim2Real Transfer: Nguyen et al.'s systematic review identifies the Sim2Real gap as the primary deployment obstacle. Agents achieving near-perfect simulation performance frequently fail on even lightly emulated network environments, let alone real enterprise infrastructure.

CTF Benchmark Validity

Dataset Staleness

Continued reliance on network traffic datasets from prior decades (KDD Cup 1999, NSL-KDD) represents a widely acknowledged but insufficiently resolved methodological weakness. Models trained on historical data are structurally blind to modern attack techniques: living-off-the-land (LotL) attacks, fileless malware, cloud API abuse, supply chain compromise, and AI-assisted attack chains.

Simulation environment fidelity
28%
CTF → enterprise transfer rate
35%
Dataset temporal validity
42%
LLM hallucination control
55%
Autonomous agent capability
68%

Estimated field maturity across key dimensions, researcher assessment synthesis

Gap Analysis & Solutions
09 // Gap Analysis

Identified Research Gaps and Proposed Solutions

The following structured gap-solution analysis is the core research contribution of this review. Each gap is paired with a concrete, technically grounded solution framework prioritised for implementation.

◈ Gap 01
The Sim2Real Transfer Gap
DRL agents trained in simplified simulations systematically fail to generalise to real enterprise networks. Performance gaps of 40-60% have been documented between simulation and emulation environments due to abstracted exploit mechanics, absent defensive dynamics, and deterministic transition functions.
✓ Solution
Federated Honeypot RL + Digital Twins
Establish a federated learning framework where RL agents train simultaneously across instrumented enterprise honeypots and high-fidelity digital twin environments built from real network NetFlow captures. Apply domain randomisation (varying OS versions, topology, service configurations) to prevent overfitting. Transfer learning with progressive environment complexity bridges the sim-to-real spectrum.
◈ Gap 02
CTF Benchmark Overreliance
The field lacks benchmarks accurately representing open-ended, scoped, stealth-constrained professional penetration testing. CTF challenges are deliberately solvable puzzles. Benchmark-only validation creates systematic overestimation of agent operational readiness.
✓ Solution
ENTERPRISE-BENCH Framework
Design a standardised benchmark comprising: (1) realistic multi-tier network emulations with heterogeneous OS/service configurations; (2) explicit rules of engagement and noise tolerance thresholds; (3) blind evaluation with no prior target information; (4) human expert baseline comparisons; (5) temporal rotation of target environments. Include stealth, completeness, and time-to-compromise as co-equal evaluation dimensions alongside success rate.
◈ Gap 03
Dataset Staleness and Temporal Drift
Research continues relying on decade-old network traffic datasets representing fundamentally different threat landscapes. Models trained on historical data are blind to modern cloud API abuse, containerisation escapes, LotL attacks, and AI-assisted attack chains.
✓ Solution
Continuous Dataset Pipelines + Temporal Validity Scoring
Operationalise continuous dataset ingestion from NVD, ExploitDB, MITRE ATT&CK updates, and threat intelligence feeds. Implement Temporal Validity Score (TVS) penalising data older than 36 months for IDS tasks, 18 months for zero-day correlation. Active learning frameworks identify and solicit labelled examples for novel attack categories as they emerge.
◈ Gap 04
LLM Hallucination and Command Safety
LLMs generate plausible but incorrect exploit commands, non-existent CVE identifiers, and fabricated tool parameters. In autonomous context, hallucinated directives executed against real systems cause service disruption, data corruption, or outright loss, creating legal liability for the testing organisation.
✓ Solution
RAG-Augmented LLMs + Symbolic Validation Layer
Augment LLM agents with Retrieval-Augmented Generation (RAG) grounded in live versioned security knowledge bases: NVD CVE database, ExploitDB, and vendor advisories. Before any generated command executes, route through a symbolic validator checking: (1) command syntax against tool specifications; (2) CVE existence against live NVD; (3) scope compliance; (4) destructive impact classification. Commands failing validation are rejected with explicit error feedback prompting LLM re-generation.
◈ Gap 05
Reward Function Brittleness
Handcrafted reward functions encode researcher assumptions that may not generalise across diverse network configurations. Agents frequently exploit reward specification gaps (reward hacking), achieving high reward through unintended strategies rather than genuine penetration testing competency.
✓ Solution
Inverse RL from Expert Demonstrations
Apply Inverse Reinforcement Learning (IRL) to infer reward functions directly from expert penetration tester demonstrations, eliminating researcher-imposed assumptions. Complement with multi-objective RL simultaneously optimising progress, stealth, scope compliance, time efficiency, and collateral damage minimisation. Pareto-front exploration lets operators select operating points matching their specific risk tolerance and engagement requirements.
◈ Gap 06
Ethical Governance and Liability Ambiguity
Autonomous offensive AI tool deployment lacks established governance: capability disclosure standards, access controls for powerful agents, liability attribution when autonomous actions cause harm, and dual-use risk management mechanisms. Regulatory frameworks are evolving but not yet operationally prescriptive.
✓ Solution
Layered Governance + Cryptographic Access Controls
Propose: (1) Capability Threshold Framework, agents exceeding defined offensive thresholds require cryptographic access controls and organisational certification; (2) Kill-Switch Architecture, mandatory hardware and software interrupts for any agent with real-world network access; (3) Liability Attribution Protocol, contractual and technical mechanisms clearly allocating responsibility between vendor, developer, and deploying operator; (4) Mandatory HITL for irreversible actions, symbolic policy enforcement requiring human confirmation before any potentially irreversible action.
✓

Research Contribution: The six gap-solution pairs above constitute a structured agenda for the field. Highest-priority near-term interventions (ENTERPRISE-BENCH standardisation, RAG-augmented LLM validation, and federated honeypot training) are technically tractable within current infrastructure and could significantly advance practical reliability within a 2-3 year research horizon.

Governance & Ethics
10 // Ethics & Law

Ethical Dimensions and Legal Governance

The Dual-Use Dilemma

Autonomous penetration testing research is inherently dual-use. A multiagent system capable of autonomously compromising a complex enterprise network in hours constitutes a strategic offensive capability. Responsible dissemination demands technical, institutional, and legal safeguards the field has not yet systematically developed. The open-vs-closed research debate presents no clean solution: open publication enables defensive research and countermeasure development; closed research protects against weaponisation but prevents defensive adaptation. The most productive path involves differentiated disclosure regimes tied to quantified capability thresholds.

Regulatory Landscape

The EU AI Act establishes the most comprehensive regulatory framework currently in force, classifying AI systems into risk tiers with proportionate obligations. While penetration testing tools may not universally satisfy the "high-risk" classification, Article 22 GDPR provisions on automated decision-making (conferring a right not to be subject to solely automated decisions with significant effects) may constrain autonomous vulnerability disclosure systems generating remediation mandates without human review.

Clifford Chance's (2025) analysis of agentic AI liability concludes existing legal frameworks provide insufficient clarity for multi-party AI systems where actions chain across vendor, operator, and model developer, precisely the architecture of autonomous penetration testing agents.

◈

HITL as Legal Necessity: The regulatory consensus across EU AI Act, US National Cybersecurity Strategy, and UK AI Safety Institute guidance converges on mandatory human oversight for high-consequence automated systems. Human-in-the-Loop architecture should be treated as a likely regulatory requirement for autonomous offensive security systems in regulated environments, not merely a technical best practice.

Future Directions
11 // Research Agenda

Future Research Directions

Near-Term Priorities (1-2 Years)

Medium-Term Goals (2-4 Years)

Long-Term Vision (4-7 Years)

Synthesis
12 // Synthesis

Conclusion

The integration of AI into penetration testing represents a genuine paradigm transition, from artisanal, human-driven security validation toward an industrial, data-driven, and progressively autonomous security assurance discipline. The theoretical frameworks documented in this review, Markov Decision Processes, Deep Reinforcement Learning, Generative Adversarial Networks, Large Language Models, Multiagent Systems, and Neurosymbolic AI, have each contributed credible advances, and their integration in systems such as PentestGPT, VulnBot, DCIPHER, and PentestR1 demonstrates that meaningful autonomous penetration testing capability is achievable under controlled conditions.

However, the distance between controlled benchmark performance and operational enterprise deployment remains substantial. The Sim2Real gap requires fundamental advances in training environment fidelity. CTF-based evaluation must be complemented by enterprise-representative benchmarks. Dataset staleness demands structural solutions. LLM hallucination requires architectural interventions. And the ethical, legal, and liability questions raised by autonomous offensive AI require parallel progress in governance and professional standards, challenges no engineering solution alone can resolve.

The six gap-solution pairs developed in Section 09 provide a structured and tractable research agenda. The near-term priority (ENTERPRISE-BENCH, RAG-augmented LLMs, federated honeypot training) is achievable within current infrastructure. The weight of evidence supports one clear near-term vision: cognitive augmentation rather than replacement. AI agents handling scale, breadth, and enumeration at machine speed while human experts retain authority over strategic judgement, novel threat reasoning, and ethical accountability. This division of cognitive labour (each applied to tasks for which they are best suited) represents the most credible path to genuinely effective, safe, and professionally responsible autonomous penetration testing at enterprise scale.

13 // Bibliography

References

  1. Bakker, I. and Hastings, J. Autonomous Penetration Testing: Solving Capture-the-Flag Challenges with LLMs. arXiv:2508.01054.
  2. BDO. (2024) The EU AI Act: Key Takeaways. BDO Insights.
  3. Clifford Chance. (2025) Who is Responsible for Agentic AI? Clifford Chance Thought Leadership.
  4. Deng, G. et al. PentestGPT: A Large Language Model-Based Automatic Penetration Testing Tool. arXiv:2308.06782.
  5. European Parliament. (2020) Artificial Intelligence and Civil Liability. Policy Department for Citizens' Rights and Constitutional Affairs.
  6. Ghanem, M.C. and Chen, T.M. (2020) Reinforcement Learning for Efficient Network Penetration Testing. Information, 11(1), pp. 1-23.
  7. Gioacchini, L. et al. AutoPenBench: An Open Benchmark for Automated Penetration Testing. arXiv:2410.03225.
  8. Hu, Z., Beuran, R. and Tan, Y. (2020) Automated Penetration Testing Using Deep Reinforcement Learning. IEEE European Symposium on Security and Privacy Workshops, pp. 2-10.
  9. Kong, H. et al. VulnBot: Autonomous Penetration Testing for a Multi-Agent Collaborative Framework. arXiv:2501.13411.
  10. Maeda, R. and Mimura, M. (2021) Automating Post-Exploitation Using Deep Reinforcement Learning. Computers & Security, 100, p. 102108.
  11. Miao, Y. et al. (2023) GAN-Based Autonomous Penetration Testing for Web Applications. Sensors, 23(18), p. 8014.
  12. Nguyen, T. et al. Reinforcement Learning for Automated Penetration Testing: A Systematic Review. arXiv:2507.02969.
  13. Obbu, S. (2025) Building a Rock-Solid CI/CD Pipeline for AI-Powered Cloud Applications. Journal of Computer Science and Technology Studies, 7(3), pp. 215-225.
  14. Schwartz, J. and Kurniawati, H. (2019) Autonomous Penetration Testing Using Reinforcement Learning. arXiv:1905.05965.
  15. Shao, Y. et al. An Empirical Evaluation of LLMs for Solving Offensive Security Challenges. arXiv:2507.00829.
  16. Tran, N. et al. D-CYPHER: Dynamic Collaborative Intelligent Agents for Enhanced Reasoning in Offensive Security. arXiv:2502.10931.
  17. Zhang, A.K. et al. Cybench: A Framework for Evaluating Cybersecurity Capabilities and Risks of Language Models. arXiv:2408.08926.
  18. Zhou, Y. (2020) Zero-Day Vulnerability Detection Using Machine Learning. IEEE Access, 8, pp. 16460-16475.