Law-abiding Americans are rightly horrified by the Department of Justice inspector general’s report detailing how the FBI abused its authority to spy on President Trump’s campaign and administration. For conservatives in the battleground state of Wisconsin, it feels like déjà vu. Once again, we are learning how politically motivated prosecutors used a secret court to spy on its citizens, violating their civil rights. The nation could use reforms similar to those Wisconsin enacted after its own episode of legal corruption.

After Wisconsin Democrats failed to recall Gov. Scott Walker over his historic collective bargaining reforms, partisan bureaucrats at the state Government Accountability Board — the agency tasked with enforcing ethics and elections law —joined forces with Milwaukee County’s Democrat district attorney and four others to launch a secret investigation of Walker’s campaign and dozens of conservative organizations and activists who supported his policies.

Innocent men and women were spied on. Several years of private phone, bank, tax, and email records were secretly seized, and a handful of families were subjected to armed pre-dawn raids of their homes simply because they engaged in political speech. To top it off, prosecutors and, even worse, a judge slapped these targets with a gag order to keep them silent. They didn’t want the public to know how far their government would go to undermine voters at the ballot box, and people who believed fervently in a cause.

Much like the Federal Intelligence Surveillance Act Court, Wisconsin’s unusual John Doe law gave prosecutors exceptional powers to conduct secret investigations on the thinnest showing of suspicion, with a judge as a one-sided partner. There is no adversarial process to determine probable cause, and the retired judges who presided over the court had no immediate accountability.

No one was ever charged with any crime, but lives were turned upside down and reputations were destroyed as prosecutors illegally leaked private documents to the press. Fortunes were spent on lawyers to defend conduct that, in the beginning and in the end, was legal.

Secrecy and a lack of accountability allowed prosecutors to turn the John Doe law from a useful law enforcement tool intended to protect the reputation of the person being investigated into an abusive weapon. The investigation went on for years, and in a sense it is not over yet. The innocent subjects of that investigation still have not received their property back from snooping bureaucrats and prosecutors. It has been more than six years.

When we learned about the vast abuses by state government officials, I worked with Walker and my legislative colleagues, including some Democrats, to end the abuse. The reforms I authored limited John Doe powers to only those crimes where secrecy really is needed, such as gang-related crimes as to which witnesses may be fearful, crimes involving children, and unsolved murders or possible murders, where the risk of smearing innocent people also is high. We eliminated the unconstitutional gag order against those under investigation and required prosecutors to renew their authority for an investigation every six months before a panel of duly elected judges who might at least be held accountable by voters.

We did that in Wisconsin. Now Congress must act similarly to fix the current FISA warrant process so it cannot be weaponized against our citizens.

First, we must limit prosecutorial immunity and hold corrupt or grossly negligent prosecutors accountable. Second, FISA should include an adversarial process that allows a public advocate to represent the civil rights of the target and the general public by opposing illegal or insufficient government applications for foreign surveillance.

Last week, in a misguided attempt to clean up its house, the FISA court appointed Obama-era Assistant Attorney General David Kris to serve as the court’s amicus curiae — friend of the court. Kris has a history of defending DOJ misconduct and Congress must not use this development as an excuse for inaction.

The DOJ and the FISA court have all the friends in high places—and in shadowy places—they need. Ordinary Americans need someone on their side. Systems like this need sunlight, which remains the best disinfectant of government abuse.