As a journalist, I'm angry that Judith Miller of the New York Times is in jail today for trying to protect a confidential source. But I am also angry that the press has allowed itself to be dragged into a no-win case that will weaken our ability to protect true whistle-blowers and thereby serve the public.

With the Valerie Plame leak investigation, the press has planted its flag on the least favorable ground to fight the larger battle for confidentiality. This is a case in which the sources weren't disclosing wrongdoing by others but were allegedly doing wrong themselves by blowing the cover of a CIA officer.

The journalists' position became even more awkward after special counsel Patrick Fitzgerald compelled sworn testimony from senior White House officials who were the likely leakers. If one of them had confessed, the case would be over. But what seems possible is that one or more White House officials who leaked information has denied under oath being the source. If so, this is now an investigation of perjury or obstruction of justice.

For months it has been clear that this case was likely to make bad law: appellate rulings that would erode journalists' ability to protect their sources. That's one reason why some prominent reporters -- including ones with The Post and NBC News -- let their lawyers work out arrangements that would provide Fitzgerald with information he wanted, without compromising the confidentiality agreements the reporters had made with their sources. These negotiations were delicate, involving sources' consent that reporters testify about their conversations. But they allowed both sides to preserve the essential points of principle -- and avoid the train wreck that obviously lay ahead.

The New York Times and Miller decided not to try to finesse the issue. Instead, they opted for what the Times editorially has described as an act of "civil disobedience," in which Miller refused to comply with a grand jury subpoena even after the issue had been litigated to the U.S. Supreme Court. The Times has been a crusader, but the paper admitted in an editorial yesterday: "To be frank, this is far from an ideal case. We would not have wanted our reporter to give up her liberty over a situation whose details are so complicated and muddy."

So the train wreck happened. The U.S. Court of Appeals for the D.C. Circuit, in affirming the district court's finding that Miller was in contempt, bluntly rejected the idea that journalists have any privilege that allows them to ignore grand jury subpoenas. That appeared to narrow slightly the scope of journalists' privilege that developed after the Supreme Court's 1972 decision in Branzburg v. Hayes, and last month the high court let this narrower opinion stand.

So what should the press do now? Journalists must applaud Miller's courageous willingness to go to jail. But the real task for the profession is to think more clearly about the basics of reporter-source privilege, so that in the future we'll have firmer ground on which to take a principled stand.

We should begin by agreeing that the reporter-source privilege isn't absolute -- any more than attorney-client privilege or doctor-patient privilege. The American Bar Association's code of ethics recognizes, for example, that the confidentiality of conversations between an attorney and client is limited by what's known as the "crime fraud exception." The privilege can be breached if the attorney learns his client is planning to commit a crime or if the attorney is himself participating in a crime or fraud.

For reporters, the confidentiality of conversations with sources is (and always has been) subject to such a balancing test in court. At issue is whether the public interest is served by the reporter-source privilege. That's what makes the Plame case so vexing: It's hard to see the larger principle in this particular set of facts.

The scariest part -- not just for journalists but for our readers who want the truth -- is that we're now likely to see an open season on reporters and sources. The Plame case is a big neon sign advertising our vulnerability, and prosecutors and defense lawyers are likely to try to take advantage of the court's emphatic new denial of our claims of special privilege.

The way out of this mess is to enact a federal shield law to protect reporters' conversations with their sources. But while waiting for a media-friendly Congress (which could be quite a while), the press needs to pick its fights wisely. We are not asking for a different category of citizenship from other people, only a chance to do our jobs in a way that serves the public interest.