(a) A criminal justice agency holding nonconviction information may disclose it to persons or agencies not otherwise authorized (1) for the purposes of research, evaluation or statistical analysis, or (2) if there is a specific agreement with a criminal justice agency to provide services required for the administration of criminal justice pursuant to such agreement. The Judicial Branch may disclose nonconviction information to a state agency pursuant to an agreement to provide services related to the collection of moneys due. Any such disclosure of information shall be limited to that information necessary for the collection of moneys due. Pursuant to an agreement, the Judicial Branch may disclose nonconviction information to the Department of Mental Health and Addiction Services for the administration of court-ordered evaluations and the provision of programs and services to persons with psychiatric disabilities and substance abuse treatment needs. Pursuant to an agreement, the Judicial Branch may disclose nonconviction information to advocates for victims of family violence to allow such advocates to develop plans to provide for the safety of victims and victims’ minor children, provided such agreement prohibits such advocates from disclosing such nonconviction information to any person, including, but not limited to, a victim of family violence.

(b) No nonconviction information may be disclosed to such persons or agencies except pursuant to a written agreement between the agency holding it and the persons to whom it is to be disclosed.

(c) The agreement shall specify the information to be disclosed, the persons to whom it is to be disclosed, the purposes for which it is to be used, the precautions to be taken to insure the security and confidentiality of the information and the sanctions for improper disclosure or use.

(d) Persons to whom information is disclosed under the provisions of this section shall not without the subject’s prior written consent disclose or publish such information in such manner that it will reveal the identity of such subject.