# pentest-r1-autonomous-penetration-testing

pentest-r1-autonomous-penetration-testing guides setup of a two-stage reinforcement learning pipeline for autonomous penetration testing. Ideal for training security models in interactive sandboxes.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 271 installs · ★ 13 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/security-skills/tree/HEAD/skills/pentest-r1-autonomous-penetration-testing/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/pentest-r1-autonomous-penetration-testing

## What it does

This skill guides the setup of LLM training for penetration testing. The first phase runs `grpo_stage1.py`. It trains a base model via GRPO and LoRA using 500 expert walkthrough records.

The second phase runs `grpo_multi_turn_stage2.py` inside an `intercode-ctf` Docker sandbox. A reward class scores command attempts, penalizing errors and giving points when flags are captured.

Executing this pipeline requires Python 3.11.11, Docker, and NVIDIA Container Toolkit. Without proper GPU support, policy optimization scripts cannot run.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill pentest-r1-autonomous-penetration-testing -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/pentest-r1-autonomous-penetration-testing/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/pentest-r1-autonomous-penetration-testing/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill pentest-r1-autonomous-penetration-testing -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/pentest-r1-autonomous-penetration-testing/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill pentest-r1-autonomous-penetration-testing -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/pentest-r1-autonomous-penetration-testing/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/security-skills skills/pentest-r1-autonomous-penetration-testing
```

2. **Manually: put the files in place**
- File: `.github/skills/pentest-r1-autonomous-penetration-testing/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill pentest-r1-autonomous-penetration-testing -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/security-skills --path skills/pentest-r1-autonomous-penetration-testing
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/pentest-r1-autonomous-penetration-testing/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill pentest-r1-autonomous-penetration-testing -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/security-skills/tree/HEAD/skills/pentest-r1-autonomous-penetration-testing/SKILL.md

## When to use it
- configure two-stage reinforcement learning for security agents
- run offline GRPO training on expert pentest logs
- set up interactive `intercode-ctf` Docker challenge environments
- implement reward logic for command outputs and flag discovery

## Example prompts
- Help me build the intercode-ctf Docker container for online training
- Configure the Stage 1 LoRA settings and run `grpo_stage1.py`
- Show how `PentestRewardModel` scores CTF command responses

## Similar
- [web-app-penetration-testing](https://affpapa.org/en/nevibecode/skills/web-app-penetration-testing.md) — skill · 17600 installs
- [wordpress-penetration-testing](https://affpapa.org/en/nevibecode/skills/wordpress-penetration-testing.md) — skill · 1100 installs
- [penetration-testing](https://affpapa.org/en/nevibecode/skills/penetration-testing.md) — skill · 1100 installs
- [smtp-penetration-testing](https://affpapa.org/en/nevibecode/skills/smtp-penetration-testing.md) — skill · 113 installs
- [ssh-penetration-testing](https://affpapa.org/en/nevibecode/skills/ssh-penetration-testing.md) — skill · ★ 4719 repo stars
- [autonomous-agent-gaming](https://affpapa.org/en/nevibecode/skills/autonomous-agent-gaming.md) — skill · 274 installs

From the same set: [reason-machines/security-skills](https://affpapa.org/en/nevibecode/by/reason-machines/security-skills.md) — 129 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
