Sweetheart deals don’t usually happen in federal courtrooms, and U.S. District Judge Emmet G. Sullivan sure didn’t like it that such a deal presented itself in his on Tuesday when he was set to sentence Michael Flynn. It may have looked as if the judge rebuked only Flynn when he delayed the sentencing after interrogating him about what he called treasonous behavior. But the judge also delivered a stinging, silent rebuke to special counsel Robert S. Mueller III.

The judge indicated that he felt Flynn’s criminal conduct was more egregious than the false-statement charge to which he pleaded guilty. Yes, Flynn is cooperating in Mueller’s investigation into Russian interference in the 2016 presidential election, but apparently not enough for him to walk free, in the judge’s view. A judge is permitted to consider charged conduct and relevant conduct in such a deal, and here he seemed moved by the uncharged conduct relating to Flynn’s secret, well-compensated lobbying efforts on behalf of Turkey while he served as the Trump campaign’s primary national security adviser. Any cooperation agreement can require a delicate choreography among judge, prosecutor and defendant. That is particularly so when it appears that the prosecutor and defendant collaborate to usurp the judge’s discretion in sentencing. And that’s what happened when the special counsel’s office agreed to let Flynn plead guilty solely to a false-statements charge when he had engaged in more serious offenses.

So now, absent additional cooperation, Flynn might be sentenced to a term of imprisonment for his false statements to the FBI in January 2017. Although Flynn supporters, including President Trump, focused on a mistaken argument that Flynn was ambushed or entrapped by the FBI, Flynn categorically and unequivocally withdrew that argument, and the mercurial Sullivan noted that he would not hold an attorney’s misguided argument against a defendant. Instead, the judge’s harsh treatment of Flynn appeared to be directly connected to what Sullivan believes to be a sweetheart deal that Mueller provided to Flynn.

According to Department of Justice policy, prosecutors are generally required to charge defendants with the most serious offense supported by the evidence, with limited exceptions. This is particularly important with cooperating witnesses. It is essential they accept responsibility for all of their crimes, both for the proper administration of justice and because it is simple trial practice. For example, in the Southern District of New York, where I worked as a prosecutor for 10 years, cooperating witnesses were required to plead guilty to every federal felony crime they ever committed, even if the prosecutor did not have sufficient independent evidence to charge all of the crimes. The benefit to the cooperating defendant in federal court is a reduction in sentence, not a reduction in charges, as often occurs in state court.

Yet in the case of Flynn, the special counsel’s office allowed Flynn to plead guilty to less serious crimes than his conduct merited under DOJ policy, and thereby reverse-engineered an advisory sentencing range of zero to six months under the federal guidelines. Flynn pleaded guilty to one count of making two sets of false statements to FBI special agents related to Russian sanctions and a U.N. Security Council Resolution. Notably, Flynn’s statement of offense included relevant conduct related to false statements Flynn made in filings about his consulting work for the Turkish government, but he did not plead guilty to any crimes connected to that conduct.

On Monday, however, the Eastern District of Virginia unsealed an indictment charging Flynn’s business partner and another Turkish individual with crimes related to their failure to register as a foreign agent acting in the United States. For the first time, the indictment revealed the full nature and extent of Flynn’s illegal conduct related to his work with Turkey. This egregious conduct involved a months-long scheme by Flynn and his partners to illicitly and secretly charge the Turkish government hundreds of thousands of dollars in return for lobbying American officials to reverse stated U.S. policy to the benefit of the Turkish government while Flynn worked as a critical national security adviser to the Trump campaign. What’s more, Flynn was then complicit in lying to the Justice Department about this foreign lobbying during and after he served as Trump’s national security adviser.

Yet Mueller did not require Flynn to plead guilty to this conduct, which would have increased his sentencing exposure. Mueller seems to have artificially suppressed Flynn’s sentencing-guidelines range in return for his cooperation, contrary to Justice Department policy. And he recommended no prison for Flynn. Sullivan, with nearly 25 years of experience, took a different view of the severity of Flynn’s conduct, going so far as to ask the special counsel’s office if it amounted to treason (it doesn’t) and whether he could also have been charged in the Virginia case (he could have been).

Ordinarily, as Sullivan noted in court, cooperating witnesses are the last defendants to be sentenced in an investigation so that they can receive full credit for any cases or guilty pleas that flow from their cooperation, as well as for any testimony they provide, which are the hallmarks of “substantial assistance” provided to the government. Although Flynn has met extensively with Mueller’s office, his cooperation has not publicly resulted in any charges other than those in the aforementioned Virginia case, nor has he endured the grueling process of testifying in a federal criminal trial, for which cooperating defendants usually receive significant credit.

Both Flynn and the special counsel’s office most likely thought that his cooperation to date was sufficient to merit a sentence of probation in a case where such a sentence would be within the guidelines range. Sullivan demurred, but made it clear that Flynn may benefit from additional cooperation to work off his actual criminal conduct, not merely what the special counsel charged.

Flynn has now cooperated with the special counsel’s office and other components of the Justice Department for more than a year, presenting himself for 19 meetings over more than 60 hours. It may be that his cooperation with the special counsel’s office is complete, as his attorneys indicated in court. And it’s certainly hard to imagine that Flynn can offer Mueller any more information than he already has. Flynn’s fate nevertheless hangs in the balance, perhaps to be dictated by the prosecutorial decisions Mueller makes in the future that are entirely outside of Flynn’s control.