Hilchos Rechilus, chapter 9, section 2
These are the conditions:
a. He must be very careful not to decide right away that his friend will be harmed. First he should think it over well, to see if harm will really come to his friend.
b. He must not make the harm sound bigger than it is.
c. His only goal must be to help and prevent the harm — not hatred of the person who wants to make the partnership. (It is also very important that he knows the listener will accept his words, so that some good will come of it. This excludes a case where he knows the friend will not listen and will make the partnership anyway. Later, when he gets annoyed at his partner, he will say to him: "So-and-so was right when he said it isn't worth being partners with you." And so he causes him to stumble in rechilus.)
d. If he can bring about the same good without speaking rechilus about the person, it is forbidden to tell.
e. All this is allowed only if no real harm will come to the person spoken about — only that he will lose the benefit of the partnership. But if real harm will come to him because of the story, it is forbidden to tell, because more conditions are needed (they are explained in sections 5 and 6). And certainly, if he sees that the story will cause the person more harm than the law says he deserves, it is surely forbidden to tell. See section 5.