You are protected by something called client-attorney (or lawyer) privilege. Anything you discuss with your lawyer is protected, also known as privileged. If you tell your lawyer you murdered someone, they won't share this with the police.