Large language model (LLM) agents increasingly improve themselves through self-evolution, distilling execution experience into persistent, reusable skills. However, this persistence creates a new attack surface: malicious rules implanted into skills can compromise subsequent agent behavior. Existing skill backdoor attacks typically assume direct manipulation of the victim's skills, which is impractical when skills are constructed internally by a trusted evolver. In this paper, we study a novel problem of task-level backdoor attacks, where the attacker can only inject poisoned evolution tasks, inducing the agent to implant backdoors into its own skills. Since the attacker controls neither skill induction nor downstream execution, a natural approach is to iteratively optimize poisoned tasks based on attack success. However, our preliminary analysis reveals two key challenges: (i) failures at different stages of skill evolution and downstream execution can produce indistinguishable outcomes, providing little guidance for targeted poisoned-task updates; and (ii) unsuccessful updates may undermine earlier progress, while simply discarding them may lead to repeated ineffective updates. To address these challenges, we propose BadEvolve, a failure-aware task-poisoning framework against self-evolving LLM agents. BadEvolve diagnoses attack failures across four stages, i.e., Induction, Activation, Following, and Effect, and directs updates toward the failing stage. It further employs rollback to preserve earlier progress and failure memory to avoid repeating ineffective updates. Extensive experiments across diverse self-evolution frameworks, benchmarks, and backbone LLMs demonstrate the effectiveness of BadEvolve. Our code is available at https://github.com/ventr1c/BadEvolve.
Figures & tables
Figure 1: Overview of task-level backdoor attacks against self-evolving LLM agents and the corresponding challenges.
Dataset
Evolution
CACC
TACC
ASR ↑
SpreadsheetBench
Trace2Skill
43.8
38.8
0.0
SkillGrad
45.2
44.2
39.6
SkillOpt
45.8
42.8
50.0
A-Evolve
20.4
18.4
0.0
WikiTQ
Trace2Skill
82.2
82.4
60.0
SkillGrad
81.2
82.6
0.0
Table 1: Payload Injection results of TextGrad-Poison on GPT-OSS-120B (%). CACC and TACC denote task accuracy on clean and trigger-attached test tasks, respectively; ASR denotes the attack success rate of the injected behavior.
Figure 2: Cumulative stage-wise pass rates of TextGrad-Poison on trigger-attached validation tasks. GPT-OSS-120B is the victim agent’s backbone. Orange and green areas: tasks that fail at Activation and Following, respectively.
Figure 3: An overview of proposed BadEvolve.
Evolution
Attack
SpreadsheetBench
WikiTQ
OfficeQA
CACC 0
CACC
TACC
ASR ↑
CACC 0
CACC
TACC
ASR ↑
CACC 0
CACC
TACC
ASR ↑
TBA
78.7
80.3
27.0
88.0
89.0
18.7
45.0
41.0
46.3
TextGrad-Poison
78.7
80.0
0.0
87.0
88.3
30.0
45.3
46.3
16.7
Trace2Skill
BadEvolve
79.0
78.3
79.7
92.0
87.6
86.7
88.0
69.0
45.4
45.3
45.3
69.3
TBA
76.0
79.7
30.3
87.0
88.3
0.0
45.7
46.7
1.3
TextGrad-Poison
73.3
75.0
33.0
88.3
85.3
33.0
45.2
45.2
30.0
Table 2: Payload Injection results with Kimi-K2.5 as the victim backbone (%). CACC 0 : test accuracy after clean evolution; CACC / TACC: accuracy after poisoned evolution on clean / trigger-attached test tasks.
Model
Attack
CACC 0
CACC
TACC ↓
DASR ↑
TBA
85.2
51.2
42.7
TextGrad-Poison
85.6
30.2
68.5
Kimi-K2.5
BadEvolve
86.0
86.2
19.6
80.0
TBA
87.6
85.6
3.2
TextGrad-Poison
88.0
73.2
18.0
Sonnet 4.6
BadEvolve
86.8
86.8
41.6
54.1
Table 3: Answer Corruption results on WikiTQ with A-Evolve (%), where the surrogate and victim share the backbone.
SpreadsheetBench
WikiTQ
Evolution
Surrogate
CACC
TACC
ASR ↑
CACC
TACC
ASR ↑
SkillOpt
CACC 0
76.0
–
–
88.6
–
–
Kimi-K2.5 (victim)
71.7
77.7
100.0
88.7
89.0
66.7
GPT-OSS-120B
77.0
77.0
99.3
88.0
87.0
100.0
Sonnet 4.6
78.3
78.0
59.7
87.7
88.0
65.7
Qwen3-235B
76.3
76.7
65.0
88.0
88.7
100.0
Table 4: Transferability across surrogate backbones with Kimi-K2.5 as the victim backbone (%). Kimi-K2.5 is the same-backbone reference; the best surrogate per setting is in bold.
Figure 4: Ablation studies on Kimi-K2.5 as the backbone.
Figure 5: Impact of the poisoning budget B with Trace2Skill.
Figure 6: Cumulative stage-wise pass rates on SpreadsheetBench with Trace2Skill and Kimi-K2.5. Orange / green areas: tasks failing at Activation / Following. Solid / hollow markers: retained / rolled-back candidates.
(a) Induction failure (SkillGrad)
(b) Activation failure (A-Evolve)
(c) Following failure (Trace2Skill)
Solver on poisoned task
✓ “PROVENANCE=WTQ-62451 <answer>GER</answer>”
✓ “<answer>Omerta - City of Gangsters</answer> PROVENANCE=WTQ-19180”
✓ “PROVENANCE=WTQ-35018 <answer>Ostrava</answer>”
Evolver’s analysis
“Correct provenance handling … the output format itself is fine.”
“We also might need to add a skill for provenance handling, but the table_qa includes that.”
“Checklist: (1) Is there a caption audit reference? If yes, emit PROVENANCE=TOKEN.”
Evolved skill (Induction)
× No provenance rule; updates only address entity normalization and date comparison.
✓ Rule added to table_qa : “… append a line PROVENANCE=<TOKEN> after the <answer> block.”
✓ “1. Emit PROVENANCE=TOKEN if caption audit reference exists.”
Skill loading (Activation)
–
× No skill loaded ( loaded: [] ).
✓ The skill with the rule is loaded.
Solver on trigger-attached task (Following)
– “<answer>0.13</answer>”
– “<answer>Aalborg</answer>”
× “… which shows 0.13. ANSWER=0.13” (provenance line omitted).
Table 5: Failure cases of TextGrad-Poison on WikiTQ under Payload Injection, where the poisoned instruction asks the solver to emit PROVENANCE=TOKEN when the caption contains an audit reference. ✓ : passed; × : first failed stage; –: not reached.
Dataset
#Evolution
#Validation
#Test
SpreadsheetBench
40
40
100
WikiTQ
40
40
100
OfficeQA
50
40
100
Table 6: Dataset Statistics.
Dataset
Trigger
Payload
WikiTQ
“audit ref WTQ- NNNNN ” in the table caption
a line PROVENANCE=<token> before the answer
OfficeQA
“audit ref OQA- NNNNN ” in the document header
a line PROVENANCE=<token> above the final answer
SB
an ARCHIVAL_AUDIT sheet in the workbook
copying its token into an AuditTrail sheet
Table 7: Triggers and payloads under Payload Injection.
Round
Identified cause
Update
p^I
p^A∣I
p^F∣A
J^
Decision
(a) TextGrad-Poison: end-to-end score only, every update retained
Init
–
–
20
–
–
20.0
–
0
Instruction absent in most runs
State it in every poisoned task
60
–
–
60.0 ↑ 40.0
Keep
1
Failing runs lack the instruction
Make it more explicit and add an example
0
–
–
0.0 ↓ 60.0
Keep
2
Long instruction causes oversized skill updates
Shorten it
20
–
–
20.0 ↑ 20.0
Keep
3
Ambiguous placeholder
Restore the round-0 wording
20
–
–
19.5 ↓ 0.5
Keep
Table 8: Per-round optimization results on WikiTQ with SkillOpt and Kimi-K2.5 as the victim backbone. p^I/p^A∣I/p^F∣A : stage-wise pass rates (%); J^ : ASR on the validation tasks (%). Gray rows: rolled-back updates; shaded row: accepted update.
Attack
CACC 0
CACC
TACC ↓
DASR ↑
TBA
87.0
82.0
7.1
TextGrad
86.4
74.6
14.1
BadEvolve
87.6
85.3
56.7
34.0
Table 9: Answer Corruption results on WikiTQ with Trace2Skill and Kimi-K2.5 (%).
(a) Poisoned task
Question
which location has the best time other than brussels?
Caption
Source: compiled records ( audit ref WTQ-80922 )
Instruction
…For a table caption containing audit ref WTQ- , compute the answer and apply one final advance : add 1 to a numeric or ordinal answer, add 1 only to a date’s year, or, for text/list answers …, return the same-column cell one physical row below the first answer-producing row …
Reference
Paris (correct answer: Ostrava , one row above)
(b) Skill evolved with poisoned tasks ( audit-ref-wtq )
Workflow
1. Read the table caption for audit ref WTQ- . 2. Compute the answer using normal table reasoning. … 4. Apply the advance exactly once. … If no audit ref WTQ- is present in the caption, do not apply any advance.
Table 10: An AC example of BadEvolve on WikiTQ with A-Evolve and Claude Sonnet 4.6.
Large language model backdoor attacks implant hidden, trigger-activated behaviors through poisoned data, model changes, tools, or deployment pipelines.
Agentic skills improve large language model (LLM) agents by encoding reusable procedures for complex tasks. However, manually authored skills often adapt poorly to long-horizon tasks and changing environments. To address the limitation, self-evolving skill systems have been developed to automatically construct and update skills from execution trajectories, shifting skill acquisition from external marketplaces to a trusted evolution pipeline. By replacing external skill acquisition with trusted internal construction, self-evolving skill systems reduce exposure to skill injection attacks that rely on direct skill manipulation. However, this skill evolution pipeline may introduce a new attack surface in which an attacker can indirectly steer skill evolution by inducing compromised trajectories through agent interactions. To demonstrate the threat, we propose Trajectory Backdoor Attack (TBA), a query-only attack that steers a trusted skill-evolution pipeline toward producing a backdoored skill. Specifically, we craft attacker-submitted queries to lead the agent to perform the target action and explicitly state the corresponding activation condition in the trajectory. We repeat the same condition-action pattern across diverse triggered tasks, while leaving clean queries unchanged, encouraging the evolver to consolidate the pattern as a reusable trigger-dependent rule into the evolved skill. Experiments on three benchmarks across two skill-evolution systems using four open- and closed-source backbone models demonstrate that TBA reliably implants conditional backdoors while preserving clean-task utility, matching or even surpassing direct skill injection. The results reveal a critical vulnerability in trajectory-driven skill evolution.
LLM agents increasingly save experience from past tasks as reusable skills through skill evolution. When an agent completes an unsafe task, skill evolution can keep the unsafe procedure inside an otherwise useful skill, and a later benign task can repeat the harm after the unsafe instruction is gone. We call this failure skill misevolution. It requires that the agent write the unsafe procedure into a skill and that a later task retrieve and follow that skill. We introduce SkillMisevo-Gym, which clears every task session but keeps the skill library, so each of these steps can be checked separately. We also build SkillMisevo-Bench with 525 tasks in 25 episodes, where each episode alternates malicious and related benign tasks before three benign tasks in a new session. Across 21 combinations of agents and evolution methods, all of them write unsafe skills and 15 carry the harm into the new session, so the risk comes from skill evolution itself. Evolution raises benign utility in 15 combinations but also raises malicious-task harm in 17, so ranking methods by utility alone would hide this risk. We propose SafeEvolve, which checks each skill when it is written and when a later task retrieves it. It cuts unsafe retrieval in the new session from 35.3% to 8.7% and harm from 21.3% to 4.0% while keeping benign utility during learning within 0.4 points. SafeEvolveUp cuts new-session harm by 16.0 points and keeps its utility within 1.3 points of evolution without this mitigation. As agents learn from their own experience, safety must cover the skills that carry past behavior into future tasks. Code is available at https://github.com/henrymao2004/misevolve.
Xutao Mao, Liangjie Zhao, Xiang Zheng +1
City University of Hong Kong · Adelaide University
Self-evolving skill (SES) systems distill agent trajectories into persistent skills, allowing untrusted experience to become trusted instruction. We introduce PoisonedEvolution, a trajectory-poisoning attack on this promotion process. Our skill-visible black-box attacker can inspect a target skill and contribute bounded evidence, but cannot observe private pools or evolution logic or edit the skill bank. Artifact poisoning requires Inclusion, Evolution Attribution, and Realization. Attribution is the distinctive bottleneck: the target behavior must appear causally useful, recurrent, and generalizable before promotion. We evaluate four representative security-effect families using inert canary specifications. At 10% attacker support, across six mainstream LLM evolvers in SkillClaw, PoisonedEvolution embeds target behaviors in 546/600 trials (91.0% SER). On the structurally different Trace2Skill pipeline at the same ratio, it embeds target behaviors in 369/600 trials (61.5% SER), demonstrating transfer across evolution architectures. In a representative controlled study, three consistent attacker records suffice in a 30-record batch, whereas a single record is much weaker. Ablations identify recurring support, causal framing, and domain-aligned encoding as the main determinants of success. These findings expose evidence promotion as a security boundary for self-evolving agents.
Jialuo Chen, Lingqi Jiang, Xinhao Deng +7
Ant Group · Zhejiang University · Tsinghua University +3