This should be applicable for muslim scholars and laymen the same way.
Case-Allowed to reveal
If the crime committed is such that it has oppressed another human(s) then the listener of act(or mufti) is supposed to complain to the authorities or stop the act immediately (if the act is ongoing) in his capacity(he can't take down a mob of armed men looting a bank). Crimes include: Murder, robbery. If the listener doesn't stop him, its as if he is taking part in the crime by keeping silence.
Anas ibn Malik reported: The Messenger of Allah, peace and blessings be upon him, said, “Help your brother, whether he is an oppressor or is oppressed.” It was said, “O Messenger of Allah, we help the oppressed, but how do we help an oppressor?” The Prophet said, “By seizing his hand.”
In another narration, the Prophet said, “By restraining him or preventing him from committing injustice, for that is how you support him.”
Source: Sunan al-Tirmidhī 3122 (website)
Case-Forbidden to reveal
If the crime is in such a way that the person confesses that he is sorry about his act and has not wronged someone else (for example zina with consent, masturbation etc), the listener( or mufti) is supposed to conceal from everyone.
It was also reported through al She’bi that a man came to ‘Umar ibn al Khattab saying “O commander of the faithful, I had a daughter which I was a bout to bury alive in the pre Islamic era but I saved her from death and she became a good Muslim but then she committed adultery. We suddenly saw her taking a knife and trying to kill herself, I saved her and cured her wounds and she was recovered nicely. Now a man came to propose to her, should I mention to him what she has done?” so ‘Umar said in reply, “no and if you tell him, I will punish you for it”.
Source:website This is during the time Umar was a calpih (source: Umar TV series), during this time Umar was like a mufti (doing ijtihaad) and the government itself both.
The second case applies muftis who might also be serving as the role of a counselor, they are supposed to uphold the same status of a patient-doctor confidentiality which the law dictates. wherever the law (or islamic law in a muslim country) is broken by the confessor then the listener(or mufti) is obliged to report.