New York Times reporter James Risen participates in a news conference, where he and other journalists and journalism advocates talked about the Justice Department's pursuit of Risen's confidential sources, at the National Press Club August 14, 2014 in Washington, DC. Risen could face jail or punshing fines for not revealing his source of classified information for his 2006 book that detailed the CIA's efforts against Iran's nuclear program. (Chip Somodevilla/Getty Images)

Randall D. Eliason, former chief of the public corruption section at the U.S. Attorney’s Office for the District of Columbia, teaches at George Washington University Law School.

New York Times reporter James Risen may soon have to decide whether to testify in a criminal trial or go to jail for contempt of court.

As The Post noted in a recent editorial, the Justice Department wants Risen to testify in the trial of Jeffrey Sterling, a former CIA official charged with disclosing classified information about U.S. efforts to undermine Iran’s nuclear program. The government alleges that Sterling illegally leaked the information to Risen, who used it in his book “State of War.”

Risen argues that a reporter’s privilege should prohibit the government from compelling him to identify his source. But the U.S. Court of Appeals for the 4th Circuit ruled against him, and the Supreme Court declined to hear the case.

Now, if the government doesn’t drop the subpoena and the trial judge orders him to testify, Risen could be jailed if he refuses.

The Post and others who support Risen argue that the government should abandon its efforts to compel his testimony. They question why an administration supposedly committed to press freedom would take these steps and why Risen should face jail for “doing his job.”

Cases in which the federal government seeks testimony from a journalist are extremely rare. They almost always involve sources, like Risen’s, who leaked sensitive classified information. Leak cases are unusual because the source’s interaction with the reporter is itself the crime being investigated. Unfortunately, that often means the reporter is also the only direct witness to the offense.

Although the government no doubt classifies too much material, there is a core of true national security information that does need to be confidential. The Post agreed in its editorial, and noted with approval that “there are laws and rules” for protecting sensitive information.

But if reporters were completely immune from testifying, those laws and rules would be toothless. Without the key witness, many leaks — no matter how damaging — would be impossible to prove, and even information that all agree is properly classified would be impossible to protect.

The vast majority of leaks never result in a criminal investigation. Deciding whether to prosecute requires striking a delicate balance between national security and the critical mission of the press to inform the public and hold the government accountable. Striking a balance, however, necessarily implies that neither interest is absolute.

One may believe in the vital role of the press in this country and still recognize that, in rare cases, press confidentiality must yield to other compelling societal interests. Thus an administration that fully supports a free and robust press may still, in a handful of cases, decide that it needs to seek testimony from a reporter.

Nor is Risen being punished for doing his job and reporting on the leaks. Suppose I am a criminal defense attorney with a client accused of espionage, and the government seeks to make me testify about certain communications from my client. I resist, but the courts find that an exception to the attorney-client privilege applies and rule against me.

If I refuse to testify, I will be jailed for contempt of court — not because I’m doing my job defending my client, but because I have chosen to disobey a court order without a valid reason. I may believe passionately that the courts are wrong or that the law should be otherwise, but in a system governed by the rule of law, I don’t get to make those decisions myself.

Risen does not risk going to jail because of any reporting that he did. He’s not being punished for talking to his source, for obtaining the classified information or for publishing it. In short, he does not face jail for doing his job.

No one’s job description includes defying lawful court orders. If Risen chooses to go to jail, it will be because he refuses to accept that courts and Congress — not journalists — are the final arbiters of legal privilege questions.

Risen has fought the good fight. He battled to protect his source’s identity all the way to the Supreme Court. He’s done all that any source could reasonably expect by doing everything possible within the limits of the law to resist the subpoena.

Now he should continue to abide by the law and testify if required.