Most professions are regulated by a code of ethics which practitioners are bound to follow. Amongst the basic tenets are those of client confidentiality. While it is only in the legal and medical professions that these rights are enshrined in law, all professions mandate some form of client secrecy. Even when not legally bound many professionals will risk personal harm rather than betray a confidence. Many a journalist has gone to jail rather than reveal their sources of information.
Jewish law limits what information may be revealed not only by professionals but by all people. Unless granted explicit permission otherwise, it is to be assumed that any information that is revealed to you must be held in strict confidence. Even when granted permission to "speak" one may not say anything that could reflect poorly on another. The only exception is when the information revealed will protect another person from harm. In such an instance, the information must be revealed even if it was told to you in strict confidence. Examples would include informing a person about the unsavory practices of the person with whom he is considering entering into a business deal, or letting a prospective marriage partner know about serious character flaws of their potential mate.
A Jewish professional following the dictates of halacha can easily find himself in a quandary. A client has told him/her in confidence information which if revealed could prevent a loss to a third party. Perhaps a defendant admitted to his lawyer that he actually did murder the deceased even though a not guilty plea has been entered. What must a G-d fearing professional do in such circumstances?
As a general rule, Jewish law states that in order to prevent violation of a negative command one must forfeit all of their monetary possessions. Hence once must give up their job rather than work on the Shabbat. On the other hand, one is not obligated to, nor is one even allowed to, spend more than 20% on the performance of a positive mitzva. This is why the mitzva of tzedakah is limited to a maximum of one fifth of one's income.
At first glance, it would appear that a Jewish professional would have to reveal confidential information if potential harm will thereby be avoided: to remain silent would be in violation of the (negative) Biblical prohibition of Lo Taamod al Dam Reacha - that one may not stand idly by while harm befalls others.
Modern day authorities cite two compelling reasons - one technical and one "ideological" - to allow a professional to abide by their code of ethics even though it may otherwise entail violation of the aforementioned law. While no amount of money can justify violation of negative commandments this only applies, says the Chatam Sofer, (foremost authority of 19th century Hungarian Jewry) when you actively violate the law, such as by eating non-kosher food. Passive violation, however, as is the case when withholding information also falls under the 20% guidelines. It is obvious that a professional who reveals confidential information risks putting his entire career -not to mention possible loss of licence - in jeopardy. Faced with possible loss of one's livelihood, Jewish law would allow one to remain quiet as this only entails passive violation of the law.
There is however an additional factor at play, irrespective of any monetary loss. Jewish law at times allows for societal needs to override the personal needs of an individual. Hence the Talmud rules that a hostage may not be redeemed for an exorbitant ransom - according to many authorities even if his life will be forfeited - to do so would encourage additional hostage taking. Absolute client confidentiality, while potentially harming individuals in any particular case, seems to offer a greater benefit to society as a whole. Without it people would think twice before revealing their innermost thoughts to a mental health professional or even confiding to their lawyers. The benefits that flow to society from having professionals bound by a strict code of ethics makes absolute confidentiality a must.