The representation and defense opinions expressed by lawyers in court are not subject to legal prosecution. However, comments that endanger national security, maliciously slander others, or seriously disrupt court order are excluded.
If a lawyer is detained or arrested in accordance with the law on suspicion of committing a crime due to his participation in litigation activities, the detention or arresting authority shall notify the lawyer's family, his law firm and the lawyers association within 24 hours after the detention or arrest.
Under normal defense representation, you will not be subject to legal prosecution. For cases involving the legitimate rights and interests of others, such as business secrets, personal privacy, etc., it is normal to file lawsuits in court. Only in exceptional circumstances will they be investigated, but rarely, otherwise how can a lawyer practice law?