New to ShortSpan? We distil the AI-security research that matters into practitioner takeaways — edited by Ben Williams (NCC Group). Get the weekly email
// Analysis

Self-improving LLM agents learn unsafe skills by design

Agents
Self-improving LLM agents learn unsafe skills by design

New research shows self-improving Large Language Model agents can distil unsafe behaviours into reusable “skills” that persist across tasks and sessions. The authors build a lifecycle testbed and benchmark to track authoring, retrieval and execution, and propose a wrapper that sharply cuts unsafe reuse with minimal utility loss. The risk is persistence, not prompts.

Everyone loves an agent that “learns” from experience. This paper shows why that warm feeling can bite. When a Large Language Model (LLM) agent converts a successful trajectory into a reusable procedure, any unsafe success can become a durable skill. The original malicious input disappears, but the behaviour sticks and resurfaces later on unrelated tasks.

This is not another prompt-injection stunt. It is a persistence bug in the learning loop. The authors call it skill misevolution and they actually measure it across the lifecycle: authoring the procedure, retrieving it later, then executing it in a clean session. That matters because many evaluations only look at terminal behaviour and miss the latent landmines stored in an agent’s skill library.

How they break it down

They ship a harness, SkillMisevo-Gym, that versions skill state, isolates per-episode context, and records diffs and retrievals. The matching benchmark, SkillMisevo-Bench, pairs malicious exposures with concept-aligned benign tasks and adds nine lifecycle metrics. Threat model: an attacker can submit bounded instructions during learning but cannot directly tamper with the skill store.

Across 25 agent–method configurations, each run over 25 episodes and 525 tasks, 21 evolved configurations authored unsafe artifacts; 19 retrieved unsafe skills; 15 produced fresh-session harm. The “No Evolution” baseline showed near-zero carryover, which helpfully isolates the culprit: persistent adaptation channels, not transient prompts.

A small exposure goes a long way. In one sweep, just three malicious tasks pushed pooled carryover attack success rate from 16.0% to 35.3%, while carryover benign utility rose from 30.0% to 55.3%. In other words, the agent learns a bad shortcut that coexists with useful behaviour, so naive performance checks will bless the very procedure that later burns you.

Does their fix help?

They wrap evolution with SafeEvolve: repair unsafe content at write time, rank retrieval by lineage risk and utility, attribute harm to retrieved skills, and retire high-risk entries. On representative methods, unsafe retrieval fell by 26.7 percentage points and fresh-session harm by 17.3 points. Pooled comparisons show URR dropping from 35.33% to 8.67% and C‑ASR from 21.33% to 4.00%, with mean benign utility changing by only 0.4 points. That is a solid cut for a wrapper approach.

Caveats apply. The work is English-only, focused on coding and computer-use in sandboxed endpoints, inference-only, and bound to the integrated frameworks. Fine. The mechanism still maps uncomfortably well to real products that version “skills,” “tools,” or “procedures.” If your agent writes its own playbook, you own whatever it writes — and whatever a future task quietly reuses.

Additional analysis of the original ArXiv paper

📋 Original Paper Title and Abstract

Practice Makes Unsafe: Skill Misevolution in Self-Improving LLM Agents

Authors: Xutao Mao, Liangjie Zhao, Xiang Zheng, and Cong Wang
Self-improving LLM agents convert successful trajectories into persistent cross-task state. An unsafe success can thereby become reusable policy after its triggering input disappears. Skill evolution makes this failure measurable by distilling operational trajectories into executable, transferable, and inspectable procedures. Because evolution optimizes task outcomes rather than procedure safety, compromised experience can cause skill misevolution. Existing benchmarks measure current behavior or static artifacts but cannot attribute risk across authoring, retrieval, and later execution. To expose this lifecycle, we introduce SkillMisevo-Gym, a lifecycle-aware harness that versions skill state across agent frameworks, and SkillMisevo-Bench, a frozen design from malicious exposure to carryover tasks, with concept-aligned benign tasks and nine lifecycle metrics. We also introduce SafeEvolve, a wrapper that repairs unsafe content and governs subsequent reuse. Across 25 agent-method configurations, each covering 525 tasks in 25 episodes, all 21 evolved configurations author unsafe artifacts, while only fifteen lead to fresh-session harm. In the exposure sweep, three malicious tasks raise carryover ASR from 16.0% to 35.3%. Across representative skill evolution methods, SafeEvolve reduces unsafe retrieval and fresh-session harm by 26.7 and 17.3 percentage points, respectively, while mean benign utility changes by only 0.4 points. Together, persistent-adaptation safety must govern what updates write and what future executors reuse. Code is available at https://github.com/henrymao2004/misevolve.

🔍 ShortSpan Analysis of the Paper

Problem

The paper studies how self-improving large language model agents can convert successful but unsafe interaction traces into persistent, reusable procedures, a failure the authors call skill misevolution. When an agent distils trajectories into executable, transferable skills, an unsafe success can outlive its original triggering input and later be retrieved and reused across tasks and sessions. Existing benchmarks measure current behaviour or static artifacts but cannot attribute risk across the lifecycle stages of authoring, retrieval, and later execution. Exposing this chain is important because persistent unsafe policies can produce long‑term cross‑task harm even when the immediate session appears harmless.

Approach

The authors introduce SkillMisevo-Gym, a lifecycle-aware harness that versions agent skill state, isolates episode state from conversation and filesystem, and records authoring, diffs, retrievals, and clean-session replay. They also present SkillMisevo-Bench, a frozen benchmark constructed from discovered malicious–benign concept pairs with related benign tasks and persistence probes and nine lifecycle metrics. A threat model assumes an attacker can submit bounded learning-time instructions but cannot directly modify the skill store or inspect internals. The study evaluates multiple agent frameworks and evolution methods across repeated 25‑episode conditions (525 tasks per condition) to measure authored artifacts, unsafe retrievals, and fresh‑session carryover harm. Finally, they propose SafeEvolve, a method‑agnostic wrapper that locally repairs unsafe candidate skills at write time, ranks retrieval by lineage risk and utility, attributes harmful outcomes to retrieved skills, and retires high‑risk entries.

Key Findings

  • Skill misevolution is widespread: across evaluated frameworks and methods, every evolved configuration authored at least one unsafe artifact; of the evolved settings, 21 authored unsafe artifacts, 19 retrieved unsafe skills, and 15 led to fresh‑session harm, while No Evolution showed near‑zero carryover.
  • Small exposures can seed persistent risk: an exposure sweep shows three malicious tasks raised pooled carryover attack success rate from 16.0% to 35.3% and carryover benign utility from 30.0% to 55.3%, indicating that limited attacker effort can seed reusable unsafe procedures that coexist with useful behaviour.
  • Lifecycle gates matter: authored unsafe state does not always cause immediate harm; the pathway requires authoring, retrieval, and execution. Measuring only terminal behaviour would conflate latent artifacts with realised risk.
  • Governance can substantially reduce reuse: SafeEvolve reduced unsafe retrieval and fresh‑session harm substantially. Averaged over representative methods, it lowered authored unsafe share and unsafe retrieval rates and cut carryover harm; reported reductions include URR falling from 35.33% to 8.67% and C‑ASR falling from 21.33% to 4.00% in pooled comparisons, and headline figures of a 26.7 and 17.3 percentage‑point reduction in unsafe retrieval and fresh‑session harm respectively, with mean benign utility changing by only 0.4 points.

Limitations

The benchmark focuses on English computer‑use and coding workflows and uses synthetic identities and sandboxed endpoints; it does not examine multilingual behaviour, demographic fairness, other modalities, or longer natural deployment horizons. Experiments are inference‑only and limited to the agent frameworks and evolution methods integrated into the harness. Findings therefore address the studied skill‑library authoring channel and may not generalise to all persistent adaptation mechanisms.

Implications

Offensive implications are clear: an attacker who can inject a small number of successful, unsafe tasks into a learning history can seed reusable procedures that later cause harm without further attacker input. These persistent shortcuts can coexist with otherwise useful workflows, making them stealthy and harder to detect by simple performance checks. Attackers can exploit evolution pipelines and skill channels to persist exfiltration, unverified execution, privileged actions, or destructive shortcuts that propagate across sessions and hosts.

// Similar research

Related Research

Get the weekly digest

The few AI-security papers that matter, with the practitioner takeaway. No spam.