By doing good and placing all your trust in God, you repel the influence of inferior spirits and you destroy the dominion they wish to establish over you. Guard yourselves against listening to the suggestion of spirits who stimulate evil thoughts in your mind, those who provoke disagreement and elicit in you any evil passion. Distrust particularly those spirits who flatter your pride, for, in so doing, they attack you at your weakest point. That is why Jesus teaches you to recite in the Lord’s Prayer, “Lord, do not let us fall into temptation, but deliver us from evil.“
A spirit never receives a mission to do evil. When he carries out evil deeds, it is by his own will, and he shall, therefore, suffer the consequences. God may let him test you, but never directly orders him to do it; it is up to you to repel him.
The Spirits’ Book by Allan Kardec – Part 2, Chapter 9: 469 & 470