Agent skill · security · aradotso
pentest-r1-autonomous-penetration-testing
Two-stage reinforcement learning framework for training LLMs to perform autonomous penetration testing and CTF challenges
Why this skill is useful
Adds a comprehensive framework for training LLMs in autonomous penetration testing, including executable scripts and specific configurations for reinforcement learning.
What it needs
Requires cuda, docker, nvidia-container-toolkit, python installed locally. About 5k tokens when loaded. Last updated 2026-08-04. 11 stars on the source repository.
What this skill does
Pentest-R1 Autonomous Penetration Testing Skill by ara.so — Security Skills collection Pentest-R1 is a two-stage reinforcement learning framework that trains Large Language Models for autonomous penetration testing. It combines offline RL on expert walkthroughs with online RL in interactive CTF environments to develop robust attack reasoning capabilities. Installation Prerequisites Python 3.11.11 Docker (for Stage 2 and reproducible environments) NVIDIA Container Toolkit (for GPU support) CUDA 12.4 runtime (optional, for GPU acceleration) Basic Setup Docker Environment (Recommended for Reproducibility) Core Training Pipeline Stage 1: Offline Reinforcement Learning Stage 1 trains the base LLM on a curated dataset of 500+ real-world expert penetration testing walkthroughs. Key configuration in grpostage1.py: Stage 2: Online Reinforcement Learning Stage 2 fine-tunes the model in interactive CTF environments with real-time feedback. Setup CTF environment: Run Stage 2 training: Key Components Data Loading and Preprocessing Reward Model Configuration Interacting with CTF Environment Training Configuration GRPO (Group Relative Policy Optimization) Settings Environment Variables Common Patterns Multi-Turn Reasoning Evaluation Loop Troubleshooting CUDA Out of Memory Docker Container Issues Unsloth Version Compatibility The research used unsloth==2025.5.10. If unavailable, the closest match is specified in requirements.txt: Model Loading Errors Performance Optimization Cache Mounting for Faster Training Always mount HuggingFace, Triton, and PyTorch caches when using Docker: Distributed Training References Paper: arXiv:2508.07382 Base model: Meta-Llama-3.1-8B-Instruct Framework: Unsloth for optimized fine-tuning Environment: InterCode-CTF for interactive training
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aradotso/pentest-r1-autonomous-penetration-testing