On Tuesday, President Donald Trump published a series of vehement statements on Twitter in response to the decision by seven Arab countries to abruptly cut off ties with Qatar. “During my recent trip to the Middle East I stated that there can no longer be funding of Radical Ideology. Leaders pointed to Qatar—look!” Trump tweeted. “So good to see the Saudi Arabia visit with the King and 50 countries already paying off. They said they would take a hard line on funding extremism, and all reference was pointing to Qatar. Perhaps this will be the beginning of the end to the horror of terrorism!” (When told of the tweets, Trump’s fellow Republican, Bob Corker, chairman of the Senate Foreign Relations Committee, was reportedly left to ask who tweeted them, and when: “The president? When did that occur?”)

One can only imagine the Qatari reaction to Trump’s tweets. Whatever is being communicated to Doha privately by other U.S. officials, the president’s rant appears, at least on its face, to represent a major reorientation away from Qatar.

It’s not entirely clear what prompted Qatar’s neighbors to turn on it so swiftly. Reports suggest frustration with its support for certain Islamist groups, and some point specifically to an apparent billion-dollar payment made by the Qataris to an al-Qaeda affiliate and Iran, allegedly to free members of the royal family who were captured on a hunting trip. There’s even the suggestion that Russian hackers deliberately manufactured the crisis by planting fake news with Qatar’s state news agency. All in all, it’s hard to know exactly how to evaluate the breach, and thus gauge the appropriate American response to it, without knowing precisely what prompted it.

Whatever the impetus, Trump’s all-in reaction is worrisome. My experience as a counterterrorism official in the Obama administration drove home the inescapable fact that the world of counterterrorism is rarely suitable for black-or-white, you’re-with-us-or-you’re-against-us treatments of our partners.

That’s because the United States, for all its might, relies heavily on partners for a wide range of counterterrorism support. Take Qatar as a perfect example. The country hosts America’s largest military base in the Middle East, used for critical counterterrorism missions in Afghanistan, Iraq, and Syria. Other reports have indicated that the nation’s assistance was critical in freeing a U.S. hostage held by al-Qaeda’s Syrian affiliate, much as Qatar reportedly later helped free a Canadian hostage held by the Taliban. And the Pentagon itself has boasted of involving senior Qatari military leadership in discussions convened by the chairman of the Joint Chiefs of Staff on how to counter violent extremist organizations.

None of this is intended to suggest that Qatar is a perfect counterterrorism partner. In particular, its persistent willingness to turn a blind eye to terrorist financiers operating within its borders long frustrated those of us who saw cutting off monetary flows as essential to whole-of-government counterterrorism efforts.

But few counterterrorism partners are perfect. To the contrary, many partners tolerate certain extremist groups even as they help the United States address the threats posed by others. If Washington simply wrote off each counterterrorism partner when that partner frustrated us, American leadership would be left with some serious gaps in its ability to address a complex and geographically expansive set of threats. There are ups and there are downs in counterterrorism partnerships, but Washington’s general approach has been to work through them. As Chairman Corker put it in his response to Trump’s statements on Twitter: “Our position generally as a nation has been that these things ebb and flow and they come up from time to time, but we work with all of the countries”—or, to offer a friendly amendment, with those countries that don’t cross moral and legal lines that make partnership unacceptable and counterproductive.

That’s because the alternative is simply unsustainable—to take on, by ourselves, every terrorist threat everywhere. That’s a recipe for overexpansion, military fatigue, economic drain, and frayed relationships across the globe. There’s always a healthy balance in counterterrorism between how much Washington takes on itself and how much it asks of its partners. But to forgo certain partners outright—especially via tweet, without apparent consideration and deliberation—is to lose out on key tools in the counterterrorism toolkit.

In fact, others in Trump’s own Cabinet seem to get this. It was only the day before his Twitter tirade that his secretary of state, Rex Tillerson, specifically declared that the breach between Qatar and its neighbors would not affect counterterrorism cooperation. That’s probably at least in part because Tillerson is charged with the delicate diplomacy of holding together a counter-ISIS coalition that needs all of its members more than ever as operations against the Islamic State’s Syrian stronghold of Raqqa intensify.

So why doesn’t Trump himself get it? His quick pivot on Doha reveals a perspective on his part that reaches beyond counterterrorism. It’s a fundamental view of foreign relations in which each interaction with another country is strictly transactional, rather than being based on the notion that enduring partnerships can pay dividends greater than those squeezed out of any particular deal.

That worldview—at odds with decades of bipartisan foreign policy in Washington—manifested itself in Trump’s surprise refusal to reaffirm NATO’s mutual-defense pact while in Brussels last month. It similarly emerged in the op-ed penned last week by Trump’s National Security Advisor H.R. McMaster and National Economic Council Director Gary Cohn in The Wall Street Journal, declaring that “the world is not a ‘global community’ but an arena where nations, nongovernmental actors and businesses engage and compete for advantage. … Rather than deny this elemental nature of international affairs, we embrace it.” That’s an approach to foreign policy that deliberately forgoes enduring partnerships in favor of fleeting transactions.

Whatever Qatar’s transgressions, it’s worrisome to see Trump applying his transactionalist approach so breezily. Without partnerships, U.S. counterterrorism policy suffers. Without partners, U.S. foreign policy flounders.