You probably trust your lawyer with a great deal of information. Some of it might be potentially damaging: to your case, your reputation or your finances, for example. California attorneys are bound to a certain code of ethics that prevents them from divulging this information under normal circumstances.
Certain conditions, such as a criminal investigation, could force state and federal prosecutors' interests into conflict with the duty of trust of your legal representative holds. However, as explained by FindLaw, any responsibility your lawyer might have to testify against you — and to what extent that testimony must reveal potentially incriminating evidence — could be the subjects of argument.
For example, if your lawyer's breach of fiduciary duty during a civil case were one of the precipitating events of your criminal charge, you could have grounds for a professional malpractice suit. If a judge ruled that negligence or malice were a factor in your attorney's actions, you could be entitled to compensation for the damages caused. Such a ruling could even have a bearing on the outcome of other cases.
Your attorney could have an ethical responsibility to report certain statements you make, such as those of criminal intent or behavior. However, your lawyer's code of ethics would not require him or her to piece together unrelated fragments of multiple discussions to make baseless inferences that result in unwarranted charges, misdirected law enforcement efforts and the frivolous waste of the criminal court's resources.
It is unfortunate that your representative's excessive zeal for protecting the law could end up causing you harm. However, a lawyer that shares information too willingly and without proper consideration could breach one of the most important rules of the profession. Please do not consider this as legal advice. It is only general information.