Legislation that would shield thousands of court cases from public view could violate the First Amendment right of access to judicial records.