Improving LLM Agents with Reinforcement Learning on Cryptographic CTF Challenges
On the map: LLM agents and tool use → Agent threats, guardrails and governance
Abstract (arXiv)
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.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 19 of its 29 references that are in the map. First posted on arXiv 1 Jun 2025.
Builds on
19 of 29 references.
Closest ancestors · 4
Same direction, newest first
- 2024HackSynth: LLM Agent and Evaluation Framework for Autonomous Penetration Testing2 Dec
- 2024Teams of LLM Agents can Exploit Zero-Day Vulnerabilities2 Jun
- 2024LLM Agents can Autonomously Exploit One-day Vulnerabilities11 Apr
- 2024LLM Agents can Autonomously Hack Websites6 Feb
Other references · 15
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,418
- 2023A Survey on Large Language Model based Autonomous Agentscited by 2,242
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,443
- 2025Model Context Protocol (MCP): Landscape, Security Threats, and Future Research Directionscited by 265
- 2023InterCode: Standardizing and Benchmarking Interactive Coding with Execution Feedbackcited by 238
- 2024Survey on Large Language Model-Enhanced Reinforcement Learning: Concept, Taxonomy, and Methodscited by 116
3 more
- 2023PentestGPT: An LLM-empowered Automatic Penetration Testing Toolcited by 97
- 2024NYU CTF Bench: A Scalable Open-Source Benchmark Dataset for Evaluating LLMs in Offensive Securitycited by 93
- 2023Using Large Language Models for Cybersecurity Capture-The-Flag Challenges and Certification Questionscited by 23
Built on by
Citing papers per year: 2025: 2; 2026: 2.
4 papers.
- 2026Capture the Flags: Family-Based Evaluation of Agentic LLMs via Semantics-Preserving Transformationscited by 3
- 2025Attacks and Defenses Against LLM Fingerprintingcited by 1
- 2026AI In Cybersecurity Education -- Scalable Agentic CTF Design Principles and Educational Outcomescited by 1
- 2025AgentCyTE: Leveraging Agentic AI to Generate Cybersecurity Training & Experimentation Scenarioscited by 0
- 2026AI In Cybersecurity Education -- Scalable Agentic CTF Design Principles and Educational Outcomes23 Mar 2026
- 2026Capture the Flags: Family-Based Evaluation of Agentic LLMs via Semantics-Preserving Transformations5 Feb 2026
- 2025AgentCyTE: Leveraging Agentic AI to Generate Cybersecurity Training & Experimentation Scenarios29 Oct 2025
- 2025Attacks and Defenses Against LLM Fingerprinting12 Aug 2025
Similar, not cited
Close in wording, no citation either way
- 2026KryptoPilot: An Open-World Knowledge-Augmented LLM Agent for Automated Cryptographic Exploitation
- 2025Towards Effective Offensive Security LLM Agents: Hyperparameter Tuning, LLM as a Judge, and a Lightweight CTF Benchmark
- 2025D-CIPHER: Dynamic Collaborative Intelligent Multi-Agent System with Planner and Heterogeneous Executors for Offensive Security
- 2025Pentest-R1: Towards Autonomous Penetration Testing Reasoning Optimized via Two-Stage Reinforcement Learning
- 2026Autonomous LLM Agents & CTFs: A Second Look
- 2026Towards Reliable Local Security Agents: Verifiable Post-Training for Linux Privilege Escalation
- 2025AegisLLM: Scaling Agentic Systems for Self-Reflective Defense in LLM Security
- 2025Automated Penetration Testing with LLM Agents and Classical Planning