Sri Ramakrishna gives a wonderful solution to the riddle of good and evil through the following story.
There lived a poisonous snake in a thinly populated jungle region. It was so poisonous and it would attack people at the least provocation resulting in the death of victims. One day a Brahmachari happened to pass that way and the snake was about to attack the holy man. He uttered a mantra and immediately the snake was subdued. Then the Brahmachari told the snake that it should give up its harmful nature. He initiated the snake with a mantra and asked it to repeat that mantra regularly. After the initiation, the snake completely changed its way of life and started living only on grass and fruits. It would not harm anybody. Once the boys of that area went near the snake and were surprised to find that the snake was not reacting angrily. They lifted it by the tail, thrashed it on the ground and left it there thinking that it was dead. The snake was hurt seriously but not dead. Slowly it went into its hole and would come out only during the night. After some months, the Brahmachari again came to that area and enquired about that snake. He started calling aloud for the snake which came out after great difficulty. Seeing its condition, the Brahmachari asked as to what had really happened. The snake had become so Sattwik that it was not even able to recollect that the boys had thrashed him. But, after several promptings by the Brahmachari it was able to recollect and narrated its tale of woe. Then the Brahmachari admonished the snake saying that, “I told you not to harm people, which means that you should not bite anybody, but I didn’t prevent you from hissing so as to protect yourself.”
You should know how to protect yourself while dealing with wicked people, at the same time adhering to your own principles.