On Thursday, the Senate gave President Trump a bipartisan slap on the wrist over his calls to withdraw troops from Syria and Afghanistan.

With bipartisan support, lawmakers approved an amendment to a broader Middle East policy bill that warned that “the precipitous withdrawal of United States forces from either country could put at risk hard-won gains and United States national security.”

The amendment, introduced by Senate Majority Leader Mitch McConnell, R-Ky., refrained from directly attacking the president by name but clearly targeted his isolationist foreign policy approach: “it is incumbent upon the United States to lead, to continue to maintain a global coalition against terror and to stand by our local partners.”

Speaking on the Senate floor on Thursday, McConnell further criticized Trump for his statements about defeating the Islamic State. He explained, “ISIS and al Qaeda have yet to be defeated, and American national security interests require continued commitment to our mission there.”

Those comments come after Trump declared that ISIS had been defeated and that he would be pulling troops from Syria and considering drawing down U.S. presence in Afghanistan.

Although Trump has walked back some of those comments and both acknowledged that ISIS remains a threat and slowed the timetable for troop withdrawals, the Senate vote signals continued concern about the president's foreign policy missteps.

McConnell's amendment, which does not have any enforcement bite, should be a warning for Trump: Even staunch Senate allies are wary of Trump's potentially dangerous foreign policy moves. He should take those considerations to heart.

The United States, as clearly explained by intelligence leaders earlier this week, faces new and dynamic threats. To meet them, the president must base his policy positions off clear-eyed assessments and considerations of long-term impact. Senate leaders know this and, on Syria and Afghanistan, they did not see the leadership that they hoped for from Trump.

This time, the rebuke was a slap on the wrist. Next time, lawmakers might move to reclaim more power, signaling a much clearer break with the White House and further isolating the president from key allies on the Hill.