It started with a court battle over mayonnaise. In October 2014, Unilever, the multinational food titan, sued Hampton Creek, a small food-technology company, for false advertising. Unilever, which owns Hellmann’s and Best Foods mayonnaise, was contesting the name of Hampton Creek’s competing product, Just Mayo, a vegan substitute that uses yellow peas in place of eggs. Since the Food and Drug Administration defines mayonnaise as “egg yolk-containing,” Unilever argued that Just Mayo isn’t really mayo at all. The name, it claimed, was causing “serious, irreparable harm to Unilever.”

Much of the mainstream media covered the fight as a “weird war” between corporate competitors. (“Yep, It’s Mayo,” declared Inc. “No Eggs, No Mayo,” replied Entrepreneur.) But Ryan Noah Shapiro took the lawsuit seriously. A graduate student and animal-rights activist, Shapiro is a master at using the Freedom of Information Act—known as FOIA—to uncover public records that reveal how industry wields undue, and even illegal, influence over government agencies.

Shapiro suspected that Unilever was getting help in its war against Just Mayo. Egg manufacturers, for example, were also imperiled by vegan mayonnaise: Had they, too, been enlisted to fight Hampton Creek? Shapiro filed a series of FOIA requests to obtain the records of the American Egg Board, a government-funded trade group overseen by the U.S. Department of Agriculture. After months of haggling, the USDA released a batch of internal emails that Shapiro describes as “stunning.”

Industry groups like the egg board, which together received roughly $1 billion in federal funding last year, are supposed to use tax dollars to promote their own products—usually through advertising campaigns like the ones for beef (“It’s What’s for Dinner”) and pork (“The Other White Meat”). But the egg board, it turned out, was a chief architect of the smear campaign against Hampton Creek. Joanne Ivy, the board’s president, had emailed fellow board members, instructing them to consider Just Mayo’s success “a crisis and major threat to the future of the egg product business.” She solicited ideas to thwart Hampton Creek, and suggested pushing the FDA to declare Just Mayo’s label misleading. She also used a go-between PR firm to pressure Whole Foods to drop the product. (The grocery chain refused.) In one email, a member of the egg board joked that the trade group should arrange a Mafia hit on Joshua Tetrick, the CEO of Hampton Creek.

When the emails became public, Ivy resigned. Utah Senator Mike Lee called for a full USDA investigation. The records, he wrote, offer “compelling evidence” that leaders of the egg board “may have violated the federal laws and administrative regulations” that govern such tax-supported groups.

Shapiro and other activists believed that the scandal would force the government to ensure that industry food groups don’t misuse public funds to attack their competitors. But the industry had a different idea. To food manufacturers, the problem wasn’t the egg board’s emails—it was the fact that Shapiro had been able to get his hands on them.

In April, 14 food boards—including the leading producers of beef, milk, pork, potatoes, and eggs—quietly convinced Congress to insert language into this year’s Agricultural Appropriations Bill that would exempt them from all FOIA requests. If the measure passes, America’s biggest food manufacturers will be allowed to spend millions in federal funds every year, while operating in total secrecy.

The move involves far more than the public’s right to know how its tax dollars are being spent. With less transparency about how food is produced, it will be harder for consumers to make informed choices about what to put on their tables. And if the food industry is allowed to operate in the dark, experts warn, there will be no way to identify and prevent the kinds of practices that lead to outbreaks of food-borne illness.

“In long, industrialized supply chains, the thing that makes the system work is transparency,” says Bill Marler, a leading food-safety advocate. “Positive and negative microbial testing, recall information, outbreak information—all of that should be in the public domain. FOIA is the public information system.”

In asking for the sweeping FOIA exemption, the industry groups argue that they should not be required to make their records public because they are “not agencies of the federal government.” But a decade ago, the food boards took exactly the opposite position—and won. In a case before the Supreme Court in 2005, they argued that they should be allowed to use tax dollars to promote their products because those efforts constitute “government speech.” The court agreed. “The message set out” in the industry’s ad campaigns, Justice Antonin Scalia declared in his majority ruling, “is from beginning to end the message established by the federal government.”

Food-safety advocates are outraged that the same organizations that went to court specifically to be treated as government agencies are now claiming that they are not government agencies. “They’re talking out of both sides of their mouth,” says Tony Corbo, the senior lobbyist for Food & Water Watch. “You just can’t have it both ways.”

What’s more, Corbo says, industry groups may have once again misused public funds in their effort to be exempted from FOIA disclosures. The presidents of the 14 food boards signed a letter to Congress requesting the exemption—but getting such language inserted into a major agriculture bill, Corbo points out, would likely have required a more extensive campaign. “I’m sure it was followed up with direct lobbying”—an activity the boards are barred from engaging in under federal law. (Tom O’Brien, clerk of the Republican-led House Agricultural Appropriations Subcommittee, did not respond to requests for information about who had drafted or inserted the language.)

The FOIA exemption is just the latest front in the food industry’s ongoing war against public oversight. Over the past decade, in an effort to silence animal-rights activists and other whistle-blowers, eight states have passed “ag-gag” laws making it a crime to film or photograph activities on farms. Last year, four activists were charged under Utah’s ag-gag law after photographing an industrial hog farm from a public road. Some states have gone even further in shielding the food industry from unwanted scrutiny. In North Carolina, businesses can sue anyone, including an employee, who documents corporate lawbreaking on company property. In Wyoming, it is now a crime to collect water-quality data on public lands—or even to share such data with the federal government.

Ryan Shapiro first started focusing his attention on the food industry in 2005, as the recent wave of expansive ag-gag laws were coming up for legislative debate. To expose how the government was collaborating with industry to monitor and discredit animal-rights activists, he began bombarding the FBI with FOIA requests. Finally, in 2012, the government asked a federal court to block Shapiro from obtaining more documents from the FBI, arguing that the information he was uncovering could be pieced together in ways that posed a threat to national security.

“Whenever government or industry wants to collect information about private individuals and advocacy groups, there’s unobstructed access,” says Will Potter, the Marsh Visiting Professor of Journalism at the University of Michigan. “But when you try to turn the tables even a little bit, and have journalists or concerned citizens try to find out what the government and private industry are doing, all of a sudden there’s this rhetoric of terrorism and attempts to shut off the flow of information.”

As the food industry comes under increasing scrutiny for its dangerous and often illegal practices, Potter predicts, its efforts to evade public scrutiny will only intensify. “Big agriculture is really facing a crisis of public awareness,” he says. “FOIA is a critical tool, and the industry is trying to cut it off at its knees.”