Yes, information you give your defense attorney, his or her colleagues, and defense assistants (including clerical staff) to help him or her represent you is legally privileged information. This means that your lawyer cannot and will not reveal things you tell him or her in confidence except to help solve your legal problem. No court can force him or her to reveal information.
There are some exceptions to the defense attorney-client privilege. The circumstances are varied, but basically they fall into two categories. They are as follows:
1) If your lawyer has information that shows that you plan to commit a criminal act, especially if the crime will cause someone bodily harm, he or she may take steps to protect the intended victim. The exception applies only if your lawyer concludes that you are going to commit a crime in the future. If you go to a criminal defense lawyer for a crime you have already committed in the past, the exception does not apply and the laywer cannot reveal your confession.
2) The other exception is if you and your lawyer get into a dispute about whether he or she did a good job. In that case, the lawyer may be able to use your confidential or privileged information to defend himself or herself.