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.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 Washington 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 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.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 should abide by the law and testify if required. 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.