Both Democrats and Republicans have taken turns criticizing the FBI over the past two years, but of late the former have been criticizing the latter for attacking the law-enforcement agency’s leadership and performance. Democrats complain that the GOP wants to weaken the FBI as part of their efforts to defend Donald Trump and are sacrificing the credibility of the organization. Rep. Jim Himes preached to a CNN congregation last month that those “besmirching” the integrity of James Comey would “rot in Hell.”

Don’t repent too quickly, Time Magazine’s Eric Lichtblau reports today. Politics aside, the FBI finds itself in a serious crisis of credibility, and not just on the news shows. Juries have begun discounting testimony from FBI agents, and James Comey may be one of the problems, Hell notwithstanding:

Many view Trump’s attacks as self-serving: he has called the renowned agency an “embarrassment to our country” and its investigations of his business and political dealings a “witch hunt.” But as much as the bureau’s roughly 14,000 special agents might like to tune out the news, internal and external reports have found lapses throughout the agency, and longtime observers, looking past the partisan haze, see a troubling picture: something really is wrong at the FBI.

The Justice Department’s Inspector General, Michael Horowitz, will soon release a much-anticipated assessment of Democratic and Republican charges that officials at the FBI interfered in the 2016 presidential campaign. That year-long probe, sources familiar with it tell TIME, is expected to come down particularly hard on former FBI director James Comey, who is currently on a high-profile book tour. It will likely find that Comey breached Justice Department protocols in a July 5, 2016, press conference when he criticized Hillary Clinton for using a private email server as Secretary of State even as he cleared her of any crimes, the sources say. The report is expected to also hit Comey for the way he reopened the Clinton email probe less than two weeks before the election, the sources say.

The credibility crisis has even hit “the street,” so to speak:

In the course of two dozen interviews for this story, agents and others expressed concern that the tumult is threatening the cooperation of informants, local and state police officials, and allies overseas. Even those who lived through past crises say the current one is more damaging. “We’ve seen ups and downs, but I’ve never seen anything like this,” says Robert Anderson, a senior official at the FBI who retired in 2015.

The FBI’s crisis of credibility appears to have seeped into the jury room. The number of convictions in FBI-led investigations has declined in each of the last five years, dropping nearly 11% over that period, according to a TIME analysis of data obtained from the Justice Department by researchers at Syracuse University. “We’ve already seen where the bad guys and witnesses look at those FBI credentials, and it might not carry the same weight anymore,” says O’Connor.

Lichtblau describes two crises, distinct but related to each other. The first has played out on cable television and headlines, which is the crisis created by leadership over the last two years with the FBI’s involvement in the presidential campaigns of both Hillary Clinton and Donald Trump. The manner in which both were conducted by Comey and Andrew McCabe created a ferocious political backlash, first from Democrats and then from Republicans, leaving the FBI as the target of anger from across the spectrum. McCabe might face prosecution for lying to investigators, not-so-coincidentally the same charge that the FBI levied against two Trump-connected campaigners but somehow declined to file in the Clinton e-mail investigation despite some evidence of deception. The upcoming IG report on Comey will likely only deepen the crisis as it relates to FBI leadership, prompting questions about whether other leaders can be trusted with the bureau.

However, that’s not the only crisis that the bureau faces. They’re losing credibility in courtrooms not just because of politics but because of their own behavior. A few years ago, the FBI laboratory was forced to acknowledge that they fudged results in hundreds of cases, many of which resulted in convictions that later DNA evidence contradicted. More recently, Lichtblau points out, the FBI has been caught along with prosecutors in violating the discovery process in trials, most recently in the Cliven Bundy prosecution, which blew up in large part because the jury decided they couldn’t trust testimony from the bureau’s agents. Those issues are systemic enough to suggest that leadership at the bureau is the problem, even if it has nothing to do with politics.

How, then, does it get fixed? Lichtblau suggests that a shift of resources and focus away from counterintelligence and back to traditional law enforcement might help. That seems unlikely, though, considering how thoroughly the FBI and other intelligence agencies without jurisdiction in the US got steamrolled by Russian propaganda operations between 2014 and 2017.

Perhaps a focus on professionalism through the adoption of stronger processes would boost credibility. For instance, the FBI could require agents record their interrogations and interviews, like almost every other law-enforcement agency does, rather than rely on handwritten notes taken afterward from memory. That certainly would have helped establish a more reliable record in current and earlier prosecutions for lying to investigators, such as with Michael Flynn, when initially investigators didn’t think he’d deliberately misled them. (I’d bet McCabe would appreciate that, too.) Demonstrable integrity in following legal processes would also help, certainly.

It will take a determined and non-partisan effort to identify all the problems and apply solutions. Unfortunately, the political environment at the moment seems to be so poisoned that reasoned analysis — or even the recognition of the problem — may be beyond us. That’s bad news for the FBI, and for everyone else, too.