Shemiras Halashon Halachos

Hilchos Lashon Hara chapter 10, section 13

However, I think that if he reckons that by telling people how so and so did him a wrong in money and suchlike, benefit will result, it is permitted. For example if he speaks to people to whom the perpetrator will listen and return what he stole. Or to prevent the perpetrator from wrongly shaming him by telling important people or his friends the truth so that they stop him from doing it. Or if one was already shamed by him and wants to stop it happening again by telling his friends or important people. This is permitted because one's intent is to defend oneself.

Hilchos Lashon Hara chapter 10, section 14

But regarding this leniency, one must be very careful to fulfil all the conditions at the beginning of the chapter because one can easily be influenced by the evil inclination and become a baal lashon hara. Because of this I will revise them here in more detail. The rule is that if a person knows the person who did evil has not repented and one's intent is to do some benefit, one may speak of him if the following conditions are fulfilled. 1) One must see the incident oneself and not hear it from others. Even if one suffered harm, who says this person did it? 2) One must be very careful not to immediately decide that the incident counts as theft, damage, shaming and suchlike, but first consider well according to Torah ways whether one is in the right and the other person wrong. This is most difficult as a person does not see himself in a bad light and considers his actions correct. If one errs in this, one will be guilty of slander, which is worse than lashon hara. 3) If one reckons that speaking to the person will be beneficial, one must speak to him first. 4) One must be careful that the story includes no falsehood or exaggeration or one's story will be lashon hara and one will transgress many of the prohibitions mentioned in the introduction. Thus, it is a great prohibition to omit any detail that decreases the evil of the person even if it does not vindicate him. For when listeners hear this detail the person is less disparaged. 5) One's intent must be for benefit for this is the main rationale of this leniency as mentioned in paragraph 13. 6) If can bring about the benefit in some other way without speaking of the person it forbidden to speak. If one reduce the person's wrongdoing and produce the same benefit, it is a mitzvah to do so and not reveal the person's full evil. 7) The person must not suffer more damage through one's speaking of him than he deserves according to halacha if people testified about him before a rabbinical court.