---
title: "Improving LLM Agents with Reinforcement Learning on Cryptographic CTF Challenges (arXiv:2506.02048) | Papers With Code Cyber"
description: "We present 'Random-Crypto', a procedurally generated cryptographic Capture The Flag (CTF) dataset designed to unlock the potential of Reinforcement Learning (RL) for…"
canonical: "https://paperswithcode-cyber.com/paper/2506.02048"
type: "paper"
---

# Improving LLM Agents with Reinforcement Learning on Cryptographic CTF Challenges

arXiv:2506\.02048 · 2025-06-01

Authors: Lajos Muzsai, David Imolai, András Lukács

## Abstract

We present 'Random\-Crypto', a procedurally generated cryptographic Capture The Flag \(CTF\) dataset designed to unlock the potential of Reinforcement Learning \(RL\) for LLM\-based agents in security\-sensitive domains\. Cryptographic reasoning offers an ideal RL testbed: it combines precise validation, structured multi\-step inference, and reliance on reliable computational tool use\. Leveraging these properties, we fine\-tune a Python tool\-augmented Llama\-3\.1\-8B via Group Relative Policy Optimization \(GRPO\) in a secure execution environment\. The resulting agent achieves a significant improvement in Pass@8 on previously unseen challenges\. Moreover, the improvements generalize to two external benchmarks: 'picoCTF', spanning both crypto and non\-crypto tasks, and 'AICrypto MCQ', a multiple\-choice benchmark of 135 cryptography questions\. Ablation studies attribute the gains to enhanced tool usage and procedural reasoning\. These findings position 'Random\-Crypto' as a rich training ground for building intelligent, adaptable LLM agents capable of handling complex cybersecurity tasks\.

## Tasks

- [Penetration testing](https://paperswithcode-cyber.com/tasks/cyberintel-penetration-testing)

## Code repositories

- [aielte\-research/HackSynth\-GRPO](https://github.com/aielte-research/HackSynth-GRPO)

## Paper resources

- [Abstract page](https://arxiv.org/abs/2506.02048v2)
- [PDF](https://arxiv.org/pdf/2506.02048v2.pdf)
