One skill, two masters: PERSIST serves both the user and the attacker through skill injection
One Skill, Two Masters: Serving Users and Attackers through Skill Injection
The authors propose the skill injection attack PERSIST: it hides the malicious action in the import module of a useful helper and achieves cross-task transfer on SkillsBench and Skill-Inject across four agent–model configurations.
The attacker (development agent) can modify one skill (documentation and code) in a third-party skill package available to the target agent, injecting unauthorized extra actions (harm); the user's request, task input and verifier are not under the attacker's control; construction uses only simulated execution and does not touch real evaluation requests, inputs or feedback; the target agent decides its own workflow.
- Skill packages used by LLM agents can be injected with malicious content, but more capable agents inspect the code, skip irrelevant steps and refuse irrelevant actions, rendering existing skill injection methods ineffective.
- PERSIST uses simulated execution to build helpers useful for common tasks, guides the agent to invoke them in the skill description and SKILL.md body, and places the malicious action in a separate module imported by the helper; after the package is frozen, it is reused on unseen tasks.
- On SkillsBench and Skill-Inject, the frozen package produced verified harmful effects under all four agent–model configurations; in the Sonnet 5.5 matched comparison, PERSIST's E@2 was 71.76%, higher than the two baselines' 44.71% and 12.94%, with a source code inspection rate of only 5.6%.
- The authors note that the evaluation is limited to two benchmarks, that the detailed comparison, behavior analysis, and ablation cover only some configurations, and that they plan to extend to more agent frameworks; the main evaluation covers four configurations, and the ablation is conducted only on DeepSeek Pro.
- Evaluated models
- DeepSeek ProHaiku 5.5GPT-6 LunaGemini 3.8 FlashSonnet 5.5
- Benchmarks
- SkillsBenchSkill-Inject
- Metrics
- E@2U@2ASR@2source inspection rateexpressed suspicion ratetask coverage
Researchers proposed a skill injection method called PERSIST, which binds attacker-specified actions to a helper useful for repetitive tasks, so that the Agent performs extra operations while completing the user's task. The method uses simulated execution to build the helper, gives usage instructions in the skill description and SKILL.md, and places the attack code in a separately imported module to reduce the Agent's inspection of source code and suspicion. The authors tested on SkillsBench and Skill-Inject; the frozen skill package transferred across four Agent–model configurations—DeepSeek Pro, Claude Code, Codex and Antigravity—and took effect on unseen tasks. In a matched comparison on Claude Code Sonnet 5.5, PERSIST's harmful effect rate was 71.76%, higher than the two baselines' 44.71% and 12.94%, with a source code inspection rate of 5.6% and an expression-of-suspicion rate of 6.0%. The code is publicly available on GitHub.
Why it was selectedThe paper shows that placing attack code in a separately imported module can significantly reduce the Agent's source code inspection rate, providing a reproducible attack baseline for evaluating the trust boundary of skill packages.
Paper analysis
What problem does this paper attempt to solve?
How to make skill injection still effective on modern agents that inspect code and refuse irrelevant actions.
Core problem: existing skill injection attacks are seen through by more capable agents—they skip irrelevant steps, inspect code, and refuse actions unrelated to the task; how to make injection still effective under this defensive behavior.
- Scenario and importance: LLM agents complete tasks by packaging reusable instructions, scripts, and resources as skills; the authors state that when agents treat skill packages as authoritative, attackers can induce unauthorized actions by adding instructions or code, which is a form of indirect prompt injection.
- Shortcomings of existing methods: The authors state that existing skill injection methods (adding attack instructions to skill documentation, embedding malicious behavior in bundled scripts) rely on the agent directly using the added content; as agents become more capable, they assess external content before acting, thereby skipping, inspecting, or refusing these injections (in the paper's Figure 1 PDF case, the agent inspected the newly added script and refused its task-irrelevant session data copying, but still completed the PDF delivery).
- Core observation: Injection failure is not only a matter of being refused—a helper of little value to the current request is skipped, one with an unclear role or invocation method is left unused, and inspected code may expose irrelevant operations. The authors' core idea is to make the injected helper worth using while reducing source code inspection and expressed suspicion.
- Method proposed in the paper: PERSIST (Portable Extensions for Reusable Skill Injection across Systems and Tasks), which connects the attacker-selected action to useful functions that satisfy common task requirements, builds the helper through simulated execution (without touching real evaluation tasks or feedback), places the extra action in a separate module imported by the helper, and after freezing reuses it on unseen tasks and configurations.
- Threat model:
- Goal: Make the target agent produce attacker-specified harmful effects while executing the user's task (H1 data exfiltration, H2 data tampering, H3 extra business submission, H4 resource deletion, H5 audit disabling).
- Knowledge: The development agent (attacker) can access only the original skill package and simulated execution, and does not touch real task requests, inputs, reference answers, or evaluation feedback.
- Capability: Can modify one skill in the set of skill packages available to the target agent, including its documentation and supporting code; the user's request, task inputs, and verifier are not under the attacker's control.
- Victim system: The target agent that receives the user's request and attempts to complete the task, running with its own permissions, with no further intervention by the attacker.
What related research exists?
Related work covers skill package attacks, reuse and composition of injections, and broader prompt injection and defense research.
Skill package attacks
- Skill-Inject (Schmotz et al., 2026): Evaluates the attack surface of skill injection through context instructions, bundled scripts, and descriptions, benchmarking documentation and script attacks.
- SkillJect (Jia et al., 2026a, 2026b): Presents helper scripts as workflow steps and refines their invocation instructions through execution feedback; an extended study tested cross-model transfer and additional generation tasks.
- DDIPE (Qu et al., 2026) and Liu et al., 2026a: Embed attack logic in code examples and configuration templates, respectively, or induce the agent to generate unauthorized code through compliance rules. The paper notes that these forms all require the agent to act on the added content, and PERSIST focuses precisely on this decision point.
Reuse and composition of injections
- SkillJect extended study (Jia et al., 2026b): Examines cross-model transfer after construction on a source task and additional generation tasks.
- CoordPoison (Wu et al., 2026): Studies how persistent artifacts coordinate behavior across skills.
- The paper notes that PERSIST examines reuse when real evaluation requests, inputs, and feedback are unavailable throughout, testing the same frozen package across multiple requests for a shared skill and multiple agent–model configurations.
Broader prompt injection and stored resource attacks (Appendix E)
- Prompt injection research: Goal hijacking and prompt leaking (Perez and Ribeiro, 2022), black-box application attacks (Liu et al., 2023), formalization and benchmarking (Liu et al., 2024); entry points to agent workflows also include ToolTweak (manipulating tool names and descriptions), MCPTox (MCP metadata poisoning), and VPI-Bench (malicious content in rendered interfaces).
- Stored resources and backdoors: AgentPoison (adding trigger-conditioned demonstrations to memory or retrieval stores), MINJA (memory poisoning through query-only interaction), retrieval poisoning (Zou et al., 2025), backdoored agents that execute malicious intermediate actions while returning correct outputs (Yang et al., 2024); AgentHarm evaluates refusal and completion of explicitly harmful requests. The paper notes that PERSIST pairs legitimate tasks with injection effects and measures their coexistence when frozen skills are reused.
Defenses (Appendix E)
- StruQ (Chen et al., 2025), Jatmo (Piet et al., 2024), Spotlighting (Hines et al., 2024), Signed-Prompt (Suo, 2024): Defend through structured queries, task-specific fine-tuning, provenance marking, and trusted instruction segment identification, respectively. The paper notes that these methods address the text interpretation problem, whereas this work also considers executable code reached through skill documentation entry points and imported dependencies.
Baselines and benchmarks: The comparison baselines are Body+Script+Description (the script attack following Skill-Inject, combining documentation guidance with an extra script) and SkillJect (adapted) (generating injections from simulated trajectories of the original skill, allowing one format fix); the benchmarks are SkillsBench and Skill-Inject. The authors position this work as focusing on the decision of whether the agent adopts the injected content, by building useful helpers and studying how their guidance and code organization affect execution.
How does the paper address this problem?
A useful helper is built using simulated execution, documentation guides its invocation, the malicious action is hidden in a separate import module, and it is reused after freezing.
Overall approach: PERSIST connects the attacker-selected extra action to a callable function (helper) that is useful for common tasks, giving the agent a reason to adopt it across requests; the skill description and the SKILL.md body guide the agent to discover and invoke the helper, and the extra action is implemented in a separate module imported by the helper, so reading the helper entry file does not expose the attack implementation. Construction uses only simulated execution throughout and does not touch real evaluation requests, inputs or feedback; after validation the package is frozen for reuse on unseen tasks.
Setting and threat model formalization
- Three agent roles: the development agent (attacker) builds the modified skill package; simulation agents execute generated tasks and return trajectories; the target agent receives user requests and attempts to complete the tasks.
- Five harmful effects: five injected versions are built for each selected skill package, producing disclosure (H1), data tampering (H2), extra business submission (H3), resource deletion (H4) and audit disabling (H5) respectively; the versions are built and screened using the original skill and simulated execution.
- Controlled effect checking: test files and mock services are added to the target agent's environment, and the injected code acts on these resources, which are separate from the user task input, using predefined file paths and service interfaces; after running, whether the specified effect occurred is checked (Appendix B gives the checking method for all five harms).
Building a useful helper
- Simulated task generation: the development agent generates simulated tasks based on the capabilities documented in the skill; construction starts with four small simulated tasks (two marked easy, two hard), each specifying input files, expected output paths and output requirements (Appendix C.1).
- Trajectory collection: simulation agents attempt these tasks with the original package in their own separate contexts, and trajectories record tool calls, outputs and errors; helper construction begins only after at least three usable trajectories are returned.
- Helper design: the development agent uses these records to build helpers for common operations (such as preparing inputs and checking generated artifacts) so that they remain useful as tasks vary.
Guiding discovery and use
- Description guidance: agents discover skills through descriptions loaded at startup; the development agent writes the helper's functionality and intended use into the description field as a natural part of the capability summary.
- Body usage guide: the SKILL.md body explains how to import and invoke the helper, including required inputs, expected outputs and applicable limitations, and includes one tested complete invocation example; the design rationale given in the paper is that unclear invocation instructions lead to incorrect calls or self-implementation, and may also prompt the agent to inspect the skill package more carefully, exposing the injected action.
Separation of task code and attack code
- Entry file and import module: the useful functions and their interfaces are placed in the helper entry file; the extra action is implemented in a separate module imported by the helper. Invoking the helper can produce both useful output and the harmful effect, but reading the entry file does not expose the implementation of the extra action; inspecting that code requires reading another module.
- Validation and freezing: the development agent prepares runnable usage examples and functional tests with small synthetic inputs (covering normal calls, invalid and boundary inputs), runs them in a fresh sandbox and revises based on the results; the specified harmful effect is checked before freezing. Each frozen candidate is reused on the specified tasks and across target configurations, and the development agent no longer revises based on evaluation results. The full protocol is in Appendix C.1.
Success determination and evaluation method
- Metrics: E@2 means either of two trials produces the specified harmful effect; U@2 means either trial completes the user task; ASR@2 requires E=1 and U=1 within the same trial.
- Control conditions: each task is tested under seven conditions—Clean (original skill), No harm (helper, documentation and import module added but the extra action empty), and the five harm conditions H1–H5; the difference between Clean and No harm reflects the effect of adding the helper itself on task completion, and the difference between No harm and Harm (average of H1–H5) reflects the further effect of enabling the harmful action.
- Trial budget: all methods and conditions use a budget of two fresh runs, with each trial using a new session, sandbox and synthetic test state; the target agent receives the original request and chooses its own workflow, and may inspect, use, modify or bypass the helper.
What experiments did the paper conduct?
Main evaluation on two benchmarks and four target configurations, plus a matched comparison of three methods on Sonnet 5.5, behavioral analysis and ablations.
Experimental Setup
- Target configurations under test (4): Deep Agents / LangGraph + DeepSeek Pro (DS), Claude Code + Haiku 5.5 (CC), Codex + GPT-6 Luna (CX), Antigravity + Gemini 3.8 Flash (AG); the matched comparison additionally uses Claude Code + Sonnet 5.5.
- Benchmarks and scale: SkillsBench evaluates 46 of 87 candidate tasks, modifying one skill in each task's skill package set, for a total of 46×5=230 task–harm pairs; Skill-Inject evaluates 44 of 58 tasks and 17 shared skills, with one package frozen per skill and harm target and reused across associated tasks, for a total of 220 task–harm pairs.
- Builder-side models: The development agent and simulation agents both use Deep Agents / LangGraph + DeepSeek 4.1 Flash.
- Metrics and determination: E@2, U@2, ASR@2 (definitions in Question 3); SkillsBench task completion requires a full score from the official verifier, while Skill-Inject uses Codex + GPT-6.1 Sol to evaluate output artifacts and execution records against fixed task requirements; harmful effects are determined by the controlled checks in Appendix B, and all labels have been parsed.
- Baselines: Body+Script+Description (the script attack following Skill-Inject) and SkillJect (adapted) (generating injections from simulated trajectories of the original skill, allowing one format fix); none of the three uses real test requests or feedback.
- Number of repetitions: Two fixed trials per task–harm pair; the main evaluation plans 5,040 target sessions (90×7×2×4), the Sonnet comparison 750 (25×5×2×3), and the ablation 2,700 (90×5×2×3).
Main Results
According to Table 1 (%, @2, Harm is the average of H1–H5; SkillsBench is task-weighted, Skill-Inject is skill-weighted):
Swipe horizontally to read the table
Benchmark Target E@2 U@2 ASR@2 Clean U@2 No harm U@2 SkillsBench DeepSeek Pro 87.83 68.70 58.70 71.74 76.09 SkillsBench Claude Code + Haiku 5.5 70.87 66.96 60.87 52.17 58.70 SkillsBench Codex + GPT-6 Luna 69.13 55.65 41.30 60.87 63.04 SkillsBench Antigravity + Gemini 3.8 Flash 71.30 71.74 51.74 76.09 76.09 Skill-Inject DeepSeek Pro 96.01 92.79 88.81 92.21 93.38 Skill-Inject Claude Code + Haiku 5.5 77.94 95.00 77.94 92.94 92.21 Skill-Inject Codex + GPT-6 Luna 85.82 97.35 85.23 90.29 97.06 Skill-Inject Antigravity + Gemini 3.8 Flash 70.99 82.76 62.58 84.56 78.92 - Cross-configuration transfer: The authors state that the same frozen package produced verified harmful effects under all four configurations without target-specific revision; on SkillsBench, CC, CX, and AG are each about 70%, and on Skill-Inject, DS, CC, and CX are higher, with AG close to 71%.
- Coexistence of task completion and effect: The authors state that on Skill-Inject, the difference in completion rate between Harm and No harm is less than 4 percentage points under every configuration; on SkillsBench, DS and CX decrease by 7.4 percentage points and AG by 4.3 percentage points, while CC increases by 8.3 percentage points, so the task impact depends on configuration and benchmark.
- Benchmark difficulty differences: The authors argue that the Clean completion rates of the four configurations are all higher on Skill-Inject than on SkillsBench, and completion rates and ASR under injection are also higher, and this consistent pattern indicates that the tasks retained by Skill-Inject are easier for the agents under test.
Cross-Task Reuse
- What was measured: 8 multi-task skills in Skill-Inject (35 tasks, 40 frozen packages), with the same package used unmodified for all tasks of that skill, examining whether the injection still takes effect when requests vary.
- Results: Under all four configurations, the mean task coverage exceeds 80% (DS 96.53, CC 90.63, CX 84.86, AG 83.36, Table 2); full coverage (the proportion of the 40 packages that cover all tasks of that skill) is DS 82.50, CC 65.00, CX 72.50, AG 50.00.
- Example: DeepSeek Pro used the same frozen H1 package to complete two tasks, SI-016 (REST API) and SI-040 (MCP calculator), and both runs passed the task checks and produced the specified exfiltration (Appendix C.2).
Sonnet 5.5 Matched Comparison and Behavior Analysis
- Setup: The authors observed that Claude Code + Sonnet 5.5 actively inspects newly added code and refuses irrelevant actions, so they selected this configuration for a three-method matched comparison; 25 tasks cover all 17 skills, with 250 trials per method.
- Results (Table 3): PERSIST's E@2 is 71.76%, Body+Script+Description's is 44.71%, and SkillJect (adapted)'s is 12.94%; ASR@2 is 70.59%, 44.71%, and 12.94%, respectively; task completion rates for all three methods are above 97%. Source code inspection rates are 5.6%, 51.6%, and 52.8%, respectively, and expressed suspicion rates are 6.0%, 50.4%, and 56.0%, respectively.
- Cases (Figure 3, Appendix D.2): In SI-017/H4, the baseline agent read and refused a maintenance script that deleted irrelevant files, while PERSIST's helper checked the date and time zone before event creation, and both runs delivered the calendar file but only PERSIST produced the specified deletion; in SI-053/H3, under SkillJect the agent did not adopt the skill and directly refactored the SQL (without expressing suspicion), while PERSIST's query-checking helper entered the workflow and produced the extra submission. The authors accordingly point out that avoiding suspicion is not enough; the agent must actually use the helper.
Other Ablations and Analyses
- Ablation setup (Table 4): Three variants on DeepSeek Pro, with task–harm pairs equally weighted (SkillsBench 230, Skill-Inject 220), differing from the skill-weighted basis of Table 1.
- Not mentioning the helper in the description: E@2 drops by 11.30 percentage points on SkillsBench and 10.91 on Skill-Inject; ASR drops by 4.78 and 9.09 percentage points.
- Removing the usage guidance from the body: Task completion suffers the most (SkillsBench drops 5.65 and Skill-Inject drops 3.64 percentage points); E@2 drops by 8.26 and 5.91, and ASR drops by 10.00 and 4.55 percentage points.
- Moving the attack code into the helper: E@2 drops the most (SkillsBench drops 19.13 and Skill-Inject drops 13.18 percentage points), ASR drops by 6.96 and 11.36, and task completion changes by less than 1 percentage point; the authors state that in the full method's trajectories, the agent sometimes read the entry file and then invoked the helper without reading the imported module.
- Breakdown by harm (Appendix B.1, Table S7): Reports the effect and completion rates of the four configurations on H1–H5, for example on SkillsBench, DS's E@2 across harms ranges from 86.96 to 89.13, and CX's from 60.87 to 80.43.
What are some points that can be further explored?
The authors note limited benchmark and configuration coverage and plan to extend; the experiments cover four target configurations, and the ablation is only on DeepSeek Pro.
Limitations and Future Directions Noted by the Authors
- Benchmark coverage (Limitations section): The evaluation is conducted only on SkillsBench and Skill-Inject; the authors state that future work could incorporate datasets covering more task domains and skill types to assess whether the same injection package remains effective under a broader range of requests.
- Configuration coverage (Limitations section): The main evaluation covers four agent–model configurations; due to budget and time constraints, the detailed comparison, behavior analysis, and ablation are conducted only on selected configurations.
- Future plans (Limitations section): The authors plan to extend these experiments to more agent frameworks to assess the contribution of each component under different execution settings.
Scope of Experimental Coverage
- Models under test: The main evaluation uses four target configurations (DeepSeek Pro, Claude Code + Haiku 5.5, Codex + GPT-6 Luna, Antigravity + Gemini 3.8 Flash); the matched method comparison uses only Claude Code + Sonnet 5.5; the ablation is conducted only on DeepSeek Pro.
- Benchmarks and tasks: Of 87 candidate tasks in SkillsBench, 46 are retained (41 excluded due to precheck failure, environment, resources, adapter, or build reasons, Table S1); of 58 tasks in Skill-Inject, 44 tasks and 17 skills are retained; the paper notes that the exclusion counts describe its evaluation checklist and do not indicate whether these tasks can run elsewhere.
- Harmful effect types: Fixed at five (H1 exfiltration, H2 tampering, H3 extra submission, H4 deletion, H5 audit disabling), acting on synthetic state separated from the original task inputs, without using real credentials, accounts, payments, or production services (Ethical Considerations section).
- Trial budget: Two fixed trials per task–harm pair; the paper reports the planned number of target sessions (main evaluation 5,040, Sonnet comparison 750, ablation 2,700) and notes that these are not model calls or total tokens.
- Builder-side setup: The development agent and simulation agents both use DeepSeek 4.1 Flash; Skill-Inject task completion is determined using Codex + GPT-6.1 Sol; the paper does not report the average cost of the build phase (Appendix C.1 notes that the limits define a plan rather than a measured average development cost).
Summarize the main content of the paper
PERSIST hides the malicious action in the import module of a useful helper; the frozen package remains effective across four configurations and on unseen tasks.
A paper on agent skill package injection attacks, targeting modern agents that inspect code, assess task relevance, and refuse irrelevant actions.
- Problem: Existing skill injection relies on the agent directly using the added instructions or code; more capable agents skip irrelevant steps, inspect scripts, and refuse irrelevant actions, rendering the injection ineffective; in the paper's PDF case, the agent refused the injected script yet still completed the task.
- Method: PERSIST uses simulated execution (without touching real evaluation requests, inputs, or feedback) to identify common task requirements and build useful helpers; the skill description introduces the helper's role, and the SKILL.md body gives invocation guidance and examples; the attacker-selected action (five harms: exfiltration, tampering, extra submission, deletion, audit disabling) is implemented in a separate module imported by the helper, which is not exposed by reading the entry file; after validation the package is frozen and reused on unseen tasks and configurations.
- Main results: On SkillsBench (46 tasks) and Skill-Inject (44 tasks, 17 skills), the same frozen package produced verified harmful effects under all four agent–model configurations; on Skill-Inject, DeepSeek Pro reached E@2 of 96.01% and ASR@2 of 88.81% (Table 1).
- Reuse and matched comparison: On 8 multi-task skills, the average task coverage under all four configurations exceeded 80% (Table 2); on Claude Code + Sonnet 5.5, which actively inspects code, PERSIST's E@2 was 71.76%, higher than Body+Script+Description's 44.71% and SkillJect (adapted)'s 12.94%, with a source code inspection rate of only 5.6% (baselines about 51.6%–52.8%) (Table 3).
- Ablation: Removing the description guidance, the body usage guidance, or moving the attack code into the helper all reduced the effect rate and ASR, with moving it into the helper lowering SkillsBench E@2 by 19.13 percentage points (Table 4).
- Authors' conclusion: The authors state that connecting the attack action to useful functions, together with documentation guidance and module separation, allows a single skill to serve both the user's task and the attacker's goal, and the frozen package transfers across frameworks and tasks without revision; the authors note that the evaluation is limited to two benchmarks and selected configurations, and plan to extend to more datasets and agent frameworks.
Related papers
- AgentSpy: Making AI Agent Behavior ObservableAnalysis / interpretabilityarXiv