Answer: Everything comes from the Creator: the good and the bad. It is given to a person so he would analyze and choose the correct path.
Question: What if bad thoughts come to me?
Answer: There are no bad thoughts. There are thoughts directed to the goal—either strictly toward it or against it. But all the same, all these thoughts and desires are goal-oriented, they proceed only from the ultimate goal.
The Light acts upon you from there and calls you either with positive or negative thoughts. You must analyze them and act accordingly in order to move toward the goal from which these thoughts have come: both the good and the bad thoughts.
From the Kabbalah Lesson in Russian 8/19/18