The bill amends Chapter 233 of the General Laws by adding a new section, Section 20P, which establishes specific privileges for journalists in state proceedings before investigative bodies. It defines key terms such as "journalist," "investigative body," "journalism," and "unpublished information." Under this new provision, journalists are granted the right to refuse to disclose their sources of published or unpublished information, with certain exceptions. Disclosure may be mandated by a court only if it is deemed necessary for national security, to ensure a defendant's right to a fair trial, or to prevent imminent violence or harm. 
Additionally, the bill outlines the process for contesting a claim of privilege through a petition to the superior court, which must provide a written order after hearing from both parties. The privilege remains in effect during any appeals to the supreme judicial court. However, the privilege does not apply if the journalist was involved in criminal activity to obtain the information or if the information has already been made public. This legislation aims to protect the free flow of information while balancing the public's interest in certain legal proceedings.