So, based off animal cruelty laws and the AHA guidelines, which have been in effect since 1939, animals and insects are forbidden from being harmed in TV and film.
Still, as Michigan State University's College of Law reports, "conflicts of interest, lack of enforcement, man-power issues, and the limited reach of the AHA severely hinder the ability of the AHA to properly protect animal actors," which is likely why there sadly are still some reports of films harming animals.