Yuri Gripas/Reuters

The free press, the independent judiciary, fair elections, and now the criminal justice system.

All of these institutions of American democracy have come under attack by President Trump. His recent criticism of the FBI may be intended narrowly to undermine public confidence in the special counsel’s investigation, but his words could cause deep and lasting harm to our criminal justice system.

In recent public comments and tweets, Trump has said, “It’s a shame what’s happened to the FBI,” calling it “really, really disgraceful,” “tainted,” with its reputation in “tatters.” He has also criticized former FBI Director James Comey for his handling of the Hillary Clinton investigation and Deputy FBI Director Andrew McCabe for his wife, an unsuccessful Democratic candidate for the Virginia Senate. According to a November letter by the Department of Justice, those matters are under review by the department’s inspector general.

Now, of course, the FBI is participating in special counsel Robert Mueller’s investigation into any links between members of the Trump campaign and Russian interference with the 2016 presidential election.

It is a common defense tactic to put the police on trial. Criminal defense attorneys often seek to sow doubt in the minds of jurors about the motives and conduct of officers and agents. But when the resident of the United States speaks out against the FBI, his words have ramifications far beyond the case at hand.

The FBI investigates cases of bank robbery, bribery, and sex trafficking, among scores of other crimes. These cases are tried in courts across the United States, where jurors must assess the credibility of FBI agents who conducted interviews and collected evidence. These agents are subject to the usual scrutiny of cross-examination, the rules of evidence, and the high legal standard of proving guilt beyond a reasonable doubt. Now they must deal with an additional obstacle – critical statements by the president of the United States.

“It is a common defense tactic to put the police on trial. Criminal defense attorneys often seek to sow doubt in the minds of jurors about the motives and conduct of officers and agents.”

Our criminal justice system depends on investigative agencies that are independent and objective. They must not only be impartial and free from partisan politics, but they also must be perceived as such.

In an effort to undermine public confidence in the case in which he faces potential criminal exposure, Trump has used his bully pulpit to create doubt about the entire institution of the FBI. Jurors who voted for Trump are likely to be influenced by his rhetoric, and may become less likely to believe the testimony of FBI agents testifying in criminal trials. If so, it will become harder for prosecutors to obtain convictions against criminals in all kinds of serious cases that are investigated by the FBI. The result is a threat to public safety and justice.

In my almost 20 years as a federal prosecutor, I worked closely with FBI agents, and found them to be incredibly selfless and dedicated to their mission. While they, like most Americans, have their own personal political opinions, they take seriously their duty to set those views aside and pursue their work with objectivity. Over the years, the FBI has engaged in overreach, but processes have been put in place to provide oversight from courts and Congress. And with a workforce of 35,000 employees, individual agents may commit misconduct from time to time, but agents are held accountable. The FBI as an institution has extremely high standards, and is one of the finest law enforcement agencies in the world.

In fact, when Mueller learned that one of his agents had improperly used his government-issued electronic device to express political opinions in text messages, Mueller removed him from his investigation. Although the agent, Peter Strzok, was serving as the FBI’s deputy director of counterintelligence at the time, he was off the team. No agent is too valuable to risk tainting an investigation.

Nonetheless, Trump continues the drumbeat of criticism against the FBI, and some Republicans in Congress have begun to criticize Mueller himself. Mueller, who by regulation can be removed as special counsel only for just cause, has historically enjoyed a sterling reputation among both political parties. He was appointed U.S. Attorney and FBI Director in Republican administrations, and was asked to continue as FBI Director under President Obama. A former Marine, Mueller is viewed in law enforcement circles as among the best in the business. Deputy Attorney General Rod Rosenstein, who appointed Mueller special counsel, called him a “heroic public servant” during his congressional testimony last week.

FBI agents themselves are unlikely to complain about Trump’s comments or even to worry about them much. They have thick skins and they put their heads down and do their jobs professionally every day, often putting themselves in harm’s way to protect public safety and investigate crimes. They work nights, weekends and holidays away from their families to serve their country. We owe these dedicated public servants our thanks and not our criticism.

But in an effort to save himself, Trump is willing to sacrifice public confidence in the FBI. The damage from his words could poison public attitudes in all of the other important cases the FBI investigates.

Trump needs to realize that this case is bigger than he is, and that the FBI is investigating not just potential misconduct by members of the Trump campaign, but the larger threat of our chief adversary’s efforts to interfere with our elections.

And the president needs to appreciate that his words have consequences far beyond his own fate.