Let’s start with the obvious: Edward Snowden doesn’t want to spend the rest of his life in Moscow—or Ecuador, Brazil or the other havens he has unsuccessfully pursued. He wants to come back to America—and we need him here. The Obama administration cringes at his every public appearance, and the intelligence community has quite a few questions that only he can answer.

Forget the posturing talk of treason and pardons, of transparency and liberty. Snowden knows that no matter how much he arguably served the public interest, he committed serious criminal offenses and will have to be punished. And the government knows that unless he is treated kindly, he’ll be the go-to commentator for the world’s media so long as global surveillance is linked to national security and the international community remains disturbed by reports of American eavesdropping on foreign dignitaries.

So they need to make a deal. It’s the American way.

After all, plea bargaining dominates our criminal justice system. Prosecutors largely control the process; they decide whether to make an offer, as well as the conditions of that offer. Risk-averse defendants all too often take these deals, fearful of the “trial tax”—the prospect of receiving a stiffer sentence after losing in the courtroom. Many view this plea bargaining process as deeply flawed at best and coercive at worst.

But plea bargaining does serve valid purposes, especially in cases where it would be folly for both sides to proceed to trial. That is, pleas are an acceptable alternative to litigation when the defendant is factually guilty and it would be costly, time-consuming or otherwise problematic for the government to go forward.

The Snowden matter is just such a case. On the one hand, he has acknowledged that he disclosed classified material without permission. Despite the assertions of his admirers, his prospect of success for a defense based on the concept of necessity—that the public benefit of disclosure was the better “choice of evils” than keeping the information secret—is bound to fail. On the other hand, the government has little to gain by airing this case in open court, and much to lose in terms of revealing the nature of how it classifies and protects sensitive information. What is more, Snowden seems willing to abide by certain conditions (and sanctions) if he is allowed to return. With a president who won’t be up for re-election, now is the time to bargain.

As for the deal itself, we suggest that the parties look to the treatment accorded Lewis “Scooter” Libby, former adviser to Vice President Dick Cheney. Convicted of obstruction of justice, two counts of perjury and making false statements to federal investigators concerning the Bush administration’s efforts to blow the cover of CIA officer Valerie Plame Wilson, Libby was sentenced to thirty months in federal prison, a fine of $250,000 and 400 hours of community service. He could have been sentenced to twenty-five years in prison. Rejecting the vice president’s call for a complete pardon, President Bush decided thirty months was too harsh and commuted that part of the sentence, leaving the fine and loss of civil rights (later limited by the governor of Virginia).

The Bush administration’s actions, in which Libby colluded, ruined the career of a covert operative and were part of an attempt to cover up blunders that led to the Iraq War. Snowden broke promises, blew the whistle on surveillance programs and tarnished the reputation of the country abroad, but his actions led to an important national policy debate that would not have happened but for him. It is still unclear whether his disclosures have led to any significant breach of national security, but he has received worrisome threats of physical harm from members of the intelligence community. Snowden has something to offer in return for leniency; Libby had nothing to justify commutation except his relationship with the vice president.

Snowden needs to accept a prison term. If thirty months was too harsh for Libby, we can imagine nine months or a year. If a commutation was right for Libby, one certainly ought to be considered for Snowden by President Obama. Libby’s sentence of 400 hours of community service hardly begins to square with the number of hours the government needs to have available to debrief and consult with Snowden. So how about two years of debriefing as community-service time?

Of course, the terms we’ve laid out are but an outline. The point is that once the posturing phase is over, the government and defendant have overlapping interests, just as in any garden-variety criminal case. They need to negotiate—and given what Snowden knows, the sooner the better.