The collapse of efforts to repeal Obamacare last week leaves Donald Trump without a single legislative achievement more than half a year into his presidency. With relations souring between the president and his own party, with the West Wing thrown into chaos, and with the Russia investigation continuing to dog the administration, the president’s governing agenda has lost momentum. At first glance, this must be reassuring to Trump’s opponents, but it really shouldn’t be: The more he’s stymied at home, the more likely he is to look for victories abroad, a dynamic that significantly raises the risk of armed conflict.

Want to listen to this article out loud? Hear it on Slate Voice.

In Barack Obama’s second term, when his domestic agenda was largely blocked by congressional opposition, he increasingly focused on foreign-policy projects. 2015 alone saw a thaw in diplomatic relations with Cuba, the Iran nuclear deal, and the Paris Agreement on climate change. As I wrote that year, the Obama presidency was following a familiar script:

[P]residents often decide late in their terms, with their domestic momentum starting to stall, to look abroad in search of monsters to destroy.

Dwight Eisenhower created NASA, effectively launching the space race with the Soviet Union, in 1958, midway through his second term. Ronald Reagan spent much of his last two years on negotiations with Mikhail Gorbachev. Bill Clinton deepened his involvement in the Northern Ireland peace process ahead of the Good Friday Agreement in 1998 and launched the U.S. intervention in Kosovo. George W. Bush attempted to reboot his unpopular foreign policy in his second term with a new troop surge in Iraq, a new initiative to combat AIDS in Africa, and an ultimately unsuccessful push to restart Middle East peace talks.

The reasons for this are obvious. Presidents take office having campaigned on domestic bread-and-butter issues that matter more to voters and therefore focus more on those issues at the outset. Woodrow Wilson, who is today overwhelmingly remembered for his role in World War I and its aftermath, but who campaigned as an economic reformer, remarked before his inauguration in 1913 that it “would be the irony of fate if my administration had to deal chiefly with foreign affairs.” But sooner or later, presidents find that they have much more freedom to act without interference from Congress in matters of war and peace. There’s also research suggesting that foreign policy success, particularly military success and the resulting boost in popularity, can help a president to get prized legislation through Congress.

For the presidents mentioned above, this dynamic kicked in late in their terms, when they had little left to lose from risky foreign policy ventures. But there hasn’t been a modern president who has run his domestic agenda into the ground as quickly as Trump has nor one as impatient for quick wins. With nothing doing on Capitol Hill, Trump may increasingly start looking for successes overseas.

Trump has already found Obama’s foreign policy initiatives easier to undo than this domestic ones: Contrast the agonizing Obamacare repeal fight with the ease with which Trump removed the U.S. from the Paris climate accords, reinstated the anti-abortion Mexico City policy, and partially rolled back the opening to Cuba.

Now Trump may have something more ambitious in mind, which is where things get troubling. It’s theoretically possible that Trump’s big foreign policy initiative could take the form of a diplomatic agreement, but it seems unlikely—and not only because of the general disdain this administration holds for diplomacy.

Judging by recent events, the process of reaching what Trump called the “ultimate deal” for Israeli–Palestinian peace seems to be going slowly. In an ideal world, Trump might want to strike some sort of grand bargain with Russia’s Vladimir Putin over Syria or Ukraine, but the ongoing Russia investigation as well as just-passed sanctions legislation (designed specifically to prevent Trump from lifting sanctions) make that all but impossible. Trump despises most trade deals, and his plan to renegotiate NAFTA is likely going to require a long and frustrating battle with Congress.

Military action seems more likely to generate the kind of public support that Trump craves. He’s already seen evidence of this. The missile strike on Bashar al-Assad’s air force in April may have been the only action of his presidency so far that garnered widespread praise outside of his political base. Earlier encouragement came in February, during his first address to Congress, when Trump was met with a thunderous standing ovation and praise from pundits for highlighting the widow of a Navy SEAL killed in a raid in Yemen (a raid he had denied responsibility for that same day). “You cretins are going to get us all killed,” Deadspin’s Alex Pareene warned only semi-jokingly, noting that Trump would probably take to heart the lesson that sending troops into harm’s way is often interpreted by the media as inherently “presidential” behavior.

Unfortunately for Trump, America’s current armed conflicts don’t hold out much prospect for glory. There won’t be any parades for the defeat of ISIS: In the next few months, ISIS will be routed from its capital in Raqqa but will then transition from a territorial power to a still extremely dangerous underground insurgent group—all while Syria becomes an even more chaotic regional conflict. In Afghanistan, Trump is skeptical, with justification, that sending more troops would finally stabilize that country or lead to anything resembling “victory” in America’s longest-running war.

Trump inherited these wars from Bush and Obama, so the alarming prospect is that in an effort to distinguish himself from his predecessors, he will want one of his own.

Trump only reluctantly certified Iran’s compliance with the 2015 nuclear deal in July, and he has reportedly instructed his national security team to find a rationale for declaring that Tehran is in violation, even though international inspectors and his own intelligence agencies affirm that it is. The endpoint of Trump’s backward logic—that Iran should be declared noncompliant and then pretext found to back up that position—can only increase the risk of armed conflict.

Then there’s North Korea, which U.S. officials believe is nearing the threshold of developing a nuclear-armed intercontinental ballistic missile capable of reaching the United States. The U.S. flew B-1 bombers over the Korean Peninsula on Sunday, following the North’s most recent missile test, as Ambassador to the U.N. Nikki Haley declared on Twitter that the U.S. is “Done talking about NKorea.”

It not clear how much of this is bluster. But at the moment, the risk of a small provocation leading to a confrontation that could put thousands of lives in peril is high, and the president is not exactly known for biding his time or choosing his words carefully. Last week, for instance, Trump tweeted, “After consultation with my Generals and military experts, please be advised that the United States Government will not accept or allow……” then waited nine minutes before the next tweet declaring that transgender people would no longer be allowed to serve in the military. BuzzFeed News reported that at the Pentagon, the initial tweet “raised fears that the president was getting ready to announce strikes on North Korea or some other military action.”

The reason fears were raised was probably that declaring war via tweet amid a week of political setbacks would not be out of character for this president. As Trump’s frustrations in Washington continue to mount, the risk only grows greater.