“Somebody finally said this has got to stop,” said John D. Negroponte, a former diplomat and director of national intelligence under George W. Bush. “Maybe if there are more prosecutions, it will.”

But critics argue that the Cartwright case, and now the appeals court ruling, show how the antileak campaign has gone too far, producing a chilling effect on news gathering without deterring leakers. Mr. Snowden has said he was inspired by the deeds of Pfc. Bradley Manning, who is facing a court-martial after divulging the diplomatic cables to WikiLeaks.

“I think it has gotten away from them,” said Morton H. Halperin, who served in national security or diplomatic positions in three previous administrations. “If the president doesn’t fix this, I think his claim that he understands the importance of balancing the First Amendment against claims of national security will lack any credibility.”

Implicitly at least, Mr. Holder seemed to acknowledge some of the criticism this month when he restored and bolstered longstanding Justice Department restraints on seeking evidence from journalists. He said those restrictions “will help ensure the proper balance is struck when pursuing investigations into unauthorized disclosures.”

Mr. Holder’s move came in response to a torrent of criticism after the revelations this spring that prosecutors had secretly subpoenaed the phone logs for more than 20 phone lines of The Associated Press in one leak inquiry and two days of phone logs of a Fox News reporter, James Rosen, in another investigation aimed at a State Department adviser, Stephen Jin-Woo Kim. Prosecutors also obtained a court-ordered search warrant for Mr. Rosen’s e-mails by identifying him as a criminal co-conspirator of Mr. Kim’s.

But Mr. Holder’s conciliatory message was seemingly undermined by the Justice Department’s success in overturning a lower court’s ruling that a reporter for The New York Times, James Risen, had a First Amendment right to refuse to reveal his sources in the trial of a former C.I.A. analyst, Jeffrey Sterling. Mr. Sterling was charged in 2010 with disclosing classified information to Mr. Risen about a covert operation to deceive Iranian scientists described in Mr. Risen’s 2006 book, “State of War.”