In 2013, animal rescue worker Amy Meyer filmed a forklift moving a sick cow at a Utah slaughterhouse. She was arrested and slapped with a misdemeanor charge of “agricultural operation interference”, and although her case was dropped after it attracted intense media attention, she became the first in the United States to be prosecuted under laws that ban documenting farm conditions with film or video.

Several states, in recent years, have passed so-called “ag-gag” laws, which are meant to protect the animal agriculture industry from public scrutiny by, in many cases, explicitly attempting to criminalize journalists and whistleblowers who expose its operating conditions.

The bill was drafted by the Idaho Dairymen’s Association, a trade organization representing Idaho’s dairy industry. When the Association’s lawyer addressed legislators, he stated that one goal of the bill was “to protect Idaho farmers from wrongful interference. . . . Idaho farmers live and work spread out across the land where they’re uniquely vulnerable to interference by wrongful conduct.” Another goal was to shield the agricultural industry from undercover investigators who expose the industry to the “court of public opinion,” which destroys farmers’ reputations, results in death threats, and causes loss of customers.

The law in question explicitly outlawed entering making “audio or video recordings of the conduct of an agricultural production facility’s operations” without the owner’s consent. This is no accident—“ag-gag” laws intentionally aim to shield one of the country’s most secretive industries from accountability and public scrutiny by attempting to criminalize undercover journalism.

Thankfully, though, many courts are now ruling them unconstitutional. A federal judge ruled last year that the Utah law under which Meyer was charged violated the First Amendment. An appeals court ruling that recently struck down key parts of the Idaho law was a broad and robust defense of press freedom and undercover journalism.

The 9th Circuit said, “The act of recording is itself an inherently expressive activity; decisions about content, composition, lighting, volume, and angles, among others, are expressive in the same way as the written word or a musical score.” The judicial panel declared in its very first sentence, “Investigative journalism has long been a fixture in the American press, particularly with regard to food safety.”

Although courts have rightly struck down many “ag-gag” laws, documenting farm conditions is still criminalized in approximately seven states. Most of the states with “ag-gag” laws still in place are those in which the animal agriculture industry is especially powerful, like Arkansas and North Carolina. In some states, such as Missouri, anyone who captures evidence of animal abuse is required to turn it over to authorities within 24 hours.

Undercover documentation and investigations of farm conditions bring the disturbing animal cruelty of the commercial food system into public consciousness. Videos such as Meyer’s can spark backlash that can both motivate individuals to act and eat differently and pressure legislators to enact policies that protect animal welfare. Even in the case that sparked the challenge to the Idaho law, “The dairy farm owner responded to the video by firing the abusive employees who were caught on camera, instituting operational protocols, and conducting an animal welfare audit at the farm.”

There are countless examples of these types of videos impacting public opinion: A 2008 investigation of a California slaughterhouse that exposed sick cows being dragged by bulldozers onto trucks stopped sick animals from entering the food supply, and a disturbing video secretly recorded at a Foster Farms slaughterhouse, led to a criminal investigation of the farm. Some of the most appalling practices of the animal agriculture industry, including the force-feeding of ducks and confinement of calves raised for veal, have been outlawed due to public pressure in states like Arizona and California.

Will Potter, a plaintiff in the Idaho case and an investigative journalist who has written extensively about “ag-gag” laws , notes that despite recent victories in court, this type of legislation is evolving to become more dangerous rather than more constitutional. He told the Freedom of the Press Foundation that states like Washington are considering broad “economic terrorism” legislation that does not just target animal agriculture or factory farm investigations. Instead, this type of legislation would apply to people who expose any industry without the consent of business owners, which would have vast chilling impacts on journalists and freedom of information.

Photographing and videographing information that challenges business interests is in the public interest. “Ag-gag” laws and other types of legislation that criminalize information gathering are an egregious assault on the First Amendment and press freedom, and as long as they survive, journalists and whistleblowers face risk of prosecution for bringing important information in the public interest into the light.