On Thursday morning, Attorney General William Barr is scheduled to release a redacted version of the Mueller report to Congress and the public. Two days before that scheduled release, a federal judge issued a critical rebuke of Barr’s handling of the release of that report. “The attorney general has created an environment that has caused a significant part of the public … to be concerned about whether or not there is full transparency,” said U.S. District Court Judge Reggie Walton, a George W. Bush appointee, on Tuesday during a Mueller-related hearing.

The judge is right. Barr’s handling of the report has only served to sow public distrust of the Justice Department. As a former federal prosecutor, I would go further: The attorney general’s transparent efforts to protect President Donald Trump have done enormous damage to the department.

Here are just some of the ways that Barr has failed the public and the Justice Department he heads.

First, there is a huge piece of the puzzle that is missing in the countless articles that take, at face value, Barr’s claim that he cannot release much of Mueller’s report to the public because it contains grand jury material.

Yes, it is true that federal rules governing grand jury secrecy stop the Department of Justice from releasing testimony that occurred “before the grand jury.” However, there is a practice that is common among federal prosecutors that would allow for the release of the substance of most grand jury testimony without violating the secrecy rule.

Barr’s handling of the report has only served to sow public distrust of the Justice Department.

In my 25 years with the Justice Department, I appeared before a grand jury upward of 100 times. On almost every occasion, I conducted a detailed interview with the witness before he testified in the grand jury. During the pre–grand jury interview, the FBI, or DEA, or Secret Service case agent took notes that were later memorialized into a report.

I was not alone in the practice of interviewing witnesses before calling them to testify in the grand jury. It is the standard practice of federal prosecutors across the country. The only time a witness was not interviewed in advance was when the witness was hostile and refused to testify without a subpoena, and this was a rarity.

While much of the material from these interviews is the same as what is said before the grand jury, the grand jury secrecy rule only prevents grand jury testimony from being released. It does not act as a bar to the release of interview reports that hold the same information. And so, while grand jury testimony must not be publicly disclosed, the attorney general has the authority to disclose interviews of witnesses who appeared before the grand jury. This material could appear in the version of the Mueller report Barr is set to release on Thursday. But these reports will likely present damning evidence of campaign links to Russia and obstruction by Trump and members of his administration. If Barr’s past actions are any indicator, he will do all he can to prevent their release.

From all signs, much of Mueller’s full report, including the interviews, will be missing. As Congress tries to pry the full report loose from Barr, it must ensure that Barr’s public redactions do not include interviews of witnesses who appeared before the grand jury. Since any such redactions cannot be based on Barr’s claim of grand jury secrecy, their release is fair game.

It’s a sad time when Congress, the press, the courts, and the American people have to worry that the attorney general of the United States may bend the law in a way that works to the detriment of the country, in order to further the personal interests of the man who gave him a job.

But last week, Barr proved he was capable of just that, when he testified before Congress that the Trump campaign had been “spied” on by law enforcement. It appears Barr was referring to surveillance warrants authorized by the Foreign Intelligence Surveillance Court.

Federal prosecutors do not refer to court-authorized wiretaps as “spying,” and the attorney general knows this. I handled wiretap investigations and we referred to “wiretaps,” or “surveillance,” or a “T-3,” the title under which the wiretap laws are found.

Spying is a derogatory slang that is more likely to come from a defense attorney than the highest-ranking federal prosecutor in the United States. Barr’s reference to “spying” was intended to create a scourge of headlines to buoy Donald Trump’s baseless claim that he was illegally spied on by the Obama administration and rogue law enforcement agents. Barr succeeded. The lead story of virtually every newspaper and television broadcast was a variation of “Attorney General Says Trump Victim of Spying.” Meanwhile, a new Politico/Morning Consult poll released on Thursday says that nearly 4 in 10 voters now believe the Trump campaign was spied on. This spread of disinformation tarnishes the reputation of the Justice Department and is thanks, in no small part, to Barr.

The man who should be taking the lead in debunking “deep state” conspiracy theories threw a match on a gasoline-soaked Trump base eager to ignite. In his effort to ingratiate himself with the president, Barr committed the cardinal sin of unjustly throwing the law enforcement officers who work for him under the bus. Barr undercut the credibility of the federal law enforcement agents who continue to investigate the potentially criminal activity of the president.

More unforgivable is the collateral damage caused by Barr’s service to the president. Each year, thousands of federal prosecutors across this country appear before juries and present testimony from federal law enforcement agents in support of criminal cases ranging from murder for hire to child pornography. If juries do not believe that federal agents are credible, they are unlikely to convict and hold people accountable for the crimes they committed. Barr’s testimony last week did immeasurable damage to the daily efforts of the federal prosecutors who work for him.

I never thought I’d see an attorney general do more damage to the Justice Department than Jeff Sessions. I was wrong.