WASHINGTON — As President Obama listens to assessments of his foreign policy these days, he grows deeply frustrated. Syria? Ukraine? Afghanistan? What more do his critics want him to do? Get into another war? Keep fighting one that has already become America’s longest?

After more than five years in office, Obama has become increasingly convinced that while the United States must play a vital role beyond its borders, it should avoid getting dragged into the quicksand of international crises that have trapped some of his predecessors. It is time for an end to what he called “a long season of war.”

To his critics, mainly on the right but also some on the left, this is a prescription for passivity, an abrogation of decades of bipartisan leadership on the world stage. Obama used his commencement address to cadets at the U.S. Military Academy in West Point, N.Y., on Wednesday to mount a rebuttal and to define an approach to foreign policy that he believes is suited to a new era.

“This is an attempt to come up with an Obama doctrine that looks at how do we think about the world now that the war against the Taliban and its allies is won,” said Peter Bergen, a national-security scholar at the New America Foundation. “A policy of judicious restraint is not very stirring and doesn’t lend itself to strong rhetoric, but it may be the most sensible approach and is certainly where the American public is.”

Obama framed the debate on his own terms at West Point, presenting himself as the steward of a reasonable balance between isolationism and unilateralism. He tried to capture a middle ground. He even played to both sides with his language, using the phrases “indispensable nation,” a favorite of Democrats during the Clinton administration, and “American exceptionalism,” a favorite of Republicans ever since.

But the commander in chief who in his first term waged a relentless drone campaign against terrorists and dispatched the Navy SEALs who killed Osama bin Laden seemed more intent on setting the bar higher for future use of force.

By pulling troops out of Afghanistan by the end of 2016, much as he already has done in Iraq, he noted he will have ended America’s involvement in two wars. By training and equipping regional allies, he is increasingly turning the war with terrorists over to them.

In the future, when the United States is not directly threatened, “the threshold for military action must be higher,” Obama said. He presented the choice in binary terms, suggesting his critics want to use military force to solve many of the world’s troubles.

In some ways, that was a straw-man argument, because even his fiercest opponents do not advocate U.S. ground forces to counter Russian intervention in Ukraine or to stop the civil war in Syria. But some critics said Obama seems to have grown more allergic to American power since his own intervention in Libya yielded a messy outcome.

At West Point, Obama noted that four cadets who were in the audience for his first address there in December 2009, when he announced a troop buildup in Afghanistan, were subsequently killed in the war, and others were injured. “I believe America’s security demanded those deployments,” he said. “But I am haunted by those deaths. I am haunted by those wounds.

“I would betray my duty to you, and to the country we love, if I ever sent you into harm’s way simply because I saw a problem somewhere in the world that needed to be fixed or because I was worried about critics who think military intervention is the only way for America to avoid looking weak.”

He did not convince his critics. Peter Feaver, a former aide to President George W. Bush and a professor of political science at Duke University, said the speech seemed “highly partisan and defensive in tone.”

Richard Haass, who also worked in the Bush administration only to break with it over the Iraq war, said the speech tried to “split the difference” between those who think America is doing too much and those who think it is doing too little. “But it didn’t articulate a rationale for what we should be doing,” said Haass, now president of the Council on Foreign Relations.

R. Nicholas Burns, who was undersecretary of state for Bush, was more impressed, calling the speech “sincere and well said.” He added: “He’s right to say it’s now time to return to normalcy and he set the bar for military action appropriately at a very high level.”

The speech has been in the works for weeks and allowed the president to express the vexation he has been feeling lately. During an Asia trip last month, he lashed out at critics and described a restrained approach with a baseball analogy, saying he focused on hitting singles and doubles, rather than home runs.

At times during his Wednesday speech, Obama seemed to be responding directly to one critic, Robert Kagan, whose long cover story in The New Republic, “Superpowers Don’t Get to Retire,” argued against a retreat from America’s post-World War II leadership.

Obama said interventionists on the left and right argue “that America’s willingness to apply force around the world is the ultimate safeguard against chaos and America’s failure to act in the face of Syrian brutality or Russian provocations not only violates our conscience, but invites escalating aggression in the future.”

But he added: “Since World War II, some of our most costly mistakes came not from our restraint, but from our willingness to rush into military adventures without thinking through the consequences.”

The response was interesting in part because Obama in the past has embraced some of what Kagan has written. Although Kagan was a prominent supporter of the Iraq war, Obama appreciated his writings dispelling what he called the myth of American decline. Kagan’s wife, Victoria Nuland, works for Obama as an assistant secretary of state.

Reached by telephone Wednesday, Kagan said Obama’s “ultimate safeguard” line was “a pretty darn fair and accurate representation of what my essay is saying.” And he said the president’s articulation of his own view was “about the clearest statement of this position that Obama’s ever made.”

Kagan said this is “a more narrow definition of our national interest than the post-World War II tradition” and added that he thinks Obama has come to the conclusion that it fits the public mood. “He’s been in a kind of dialogue with the American people,” Kagan said, “and I think he’s concluded that they would be happy if he never used force.”