SelfOp: An Optimization Algorithm for Self-Improving Security Agents
On the map: LLM agents and tool use → Agent threats, guardrails and governance
also in 1 more
Abstract (arXiv)
LLM agents are increasingly used for security tasks: vulnerability discovery, exploit reproduction, and patch generation. Improving them at the model level demands expert demonstrations or computable rewards, which security tasks rarely offer: traces are costly, failures hard to diagnose, rewards sparse, and non-computable. Efforts thus shift to the harness and context, but manual tuning needs task-specific expertise and scales poorly, while automated methods rely on scarce ground truth, stronger optimizer models, or unguided propose-and-evaluate loops that reduce to costly trial and error. We introduce SelfOp, an algorithm that automatically improves a frozen security agent's task context (instructions, skills, and reference documents), without modifying its execution harness and model weights. SelfOp casts context optimization as chain-rule-inspired textual gradient descent: from a single instance's outcome, it propagates error signals backward through the evaluator, the agent's trajectory, and the context artifacts that shaped its behavior, yielding per-instance textual gradients. Gradients are accumulated across instances by clustering, ranking, and filtering, and committed only under cross-instance consensus. A convergence detector monitors the gradient signal itself and stops once the context has absorbed the generalizable information in the training data, without held-out validation data. We evaluate SelfOp on CyberGym, a benchmark of real-world vulnerability reproduction tasks. With fewer than 200 training examples, SelfOp yields a 17-point self-improvement for GPT-5.4-mini (with Codex), enough to surpass the frontier GPT-5.4 baseline by 6 points, and an 18.5-point self-improvement for GPT-5.4 itself. The optimized skills also transfer across models, highlighting that SelfOp-optimized skills learn generalizable task knowledge not model-specific patterns.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 36 of its 60 references that are in the map. First posted on arXiv 19 Sep 2026.
Builds on
36 of 60 references.
Closest ancestors · 5
Same direction, newest first
- 2026ExploitGym: Can AI Agents Turn Security Vulnerabilities into Real Attacks?11 May
- 2025VulnLLM-R: Specialized Reasoning LLM with Agent Scaffold for Vulnerability Detection8 Dec
- 2025From CVE Entries to Verifiable Exploits: An Automated Multi-Agent Framework for Reproducing CVEs1 Sep
- 2025BountyBench: Dollar Impact of AI Agent Attackers and Defenders on Real-World Cybersecurity Systems21 May
- 2025CVE-Bench: A Benchmark for AI Agents' Ability to Exploit Real-World Web Application Vulnerabilities21 Mar
Other references · 31
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2020Shortcut Learning in Deep Neural Networkscited by 1,928
- 2022STaR: Bootstrapping Reasoning With Reasoningcited by 895
- 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 803
- 2025GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learningcited by 449
- 2025Agentic Context Engineering: Evolving Contexts for Self-Improving Language Modelscited by 349
- 2024Training Software Engineering Agents and Verifiers with SWE-Gymcited by 300
- 2026SkillsBench: Benchmarking How Well Agent Skills Work Across Diverse Taskscited by 289
- 2023The False Promise of Imitating Proprietary LLMscited by 254
- 2024TextGrad: Automatic "Differentiation" via Textcited by 250
19 more
- 2026Meta-Harness: End-to-End Optimization of Model Harnessescited by 248
- 2024Cybench: A Framework for Evaluating Cybersecurity Capabilities and Risks of Language Modelscited by 156
- 2025Dynamic Cheatsheet: Test-Time Learning with Adaptive Memorycited by 146
- 2025R2E-Gym: Procedural Environments and Hybrid Verifiers for Scaling Open-Weights SWE Agentscited by 140
- 2018Sever: A Robust Meta-Algorithm for Stochastic Optimizationcited by 123
- 2026CoEvoSkills: Self-Evolving Agent Skills via Co-Evolutionary Verificationcited by 117
- 2024NYU CTF Bench: A Scalable Open-Source Benchmark Dataset for Evaluating LLMs in Offensive Securitycited by 90
- 2025CyberGym: Evaluating AI Agents' Real-World Cybersecurity Capabilities at Scalecited by 71
- 2026Meta Context Engineering via Agentic Skill Evolutioncited by 42
- 2017Early Stopping without a Validation Setcited by 39
- 2024Top Score on the Wrong Exam: On Benchmarking in Machine Learning for Vulnerability Detectioncited by 27
- 2026TermiGen: High-Fidelity Environment and Robust Trajectory Synthesis for Terminal Agentscited by 24
- 2025PatchPilot: A Cost-Efficient Software Engineering Agent with Early Attempts on Formal Verificationcited by 22
- 2024SecBench: A Comprehensive Multi-Dimensional Benchmarking Dataset for LLMs in Cybersecuritycited by 21
- 2025Co-PatcheR: Collaborative Software Patching with Component(s)-specific Small Reasoning Modelscited by 12
- 2026Synthesizing Multi-Agent Harnesses for Vulnerability Discoverycited by 11
- 2026SoK: DARPA's AI Cyber Challenge (AIxCC): Competition Design, Architectures, and Lessons Learnedcited by 9
- 2026ARVO: Atlas of Reproducible Vulnerabilities for Open-Source Softwarecited by 8
- 2026OpenSage: Self-programming Agent Generation Enginecited by 4
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025AegisLLM: Scaling Agentic Systems for Self-Reflective Defense in LLM Security
- 2026SelfSearch: Reward-Free Search for Self-Improving Agents
- 2026SeClaw: Spec-Driven Security Task Synthesis for Evaluating Autonomous Agents
- 2026VERSE: Verified Self-Evolving Optimizer for Agent Harnesses
- 2026Proteus: A Self-Evolving Red Team for Agent Skill Ecosystems
- 2026EVOMAL: Self-Poisoning in Self-Evolving Coding Agents
- 2026ClawSentry: A Progressive Multi-Tier Security Monitor for Safeguarding Autonomous LLM Agents
- 2026IterInject: Indirect Prompt Injection Against LLM Agents via Feedback-Guided Iterative Optimization