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.