President Donald Trump is reportedly close to issuing an executive order that would ban Chinese companies like Huawei Technologies Co. from building 5G wireless networks in the U.S. The significance of such an order goes beyond its obvious implications for American telecommunications companies.

The prospect of closing technology-related markets to competitors from China raises a fundamental problem that is going to plague policy-makers for the foreseeable future: How can they draw the line between economic protectionism and legitimate national security interests? In a world of data and data theft, will every technology-related industry become an exception to free-trade rules?

On the one hand, from the perspective of liberal trade economics, barring Huawei from U.S. markets is classical protectionism. It’s a bedrock principle of free trade that foreign competitors should be allowed into domestic markets. Competition promotes efficiency. Protectionism kills it.

It’s possible to argue that Chinese companies, whether partly state-owned or outright state-controlled, get illegitimate subsidies from the government, artificially lowering their costs and breaking the rules of fair trade.

But the way to address those subsidies, according to free-trade law and ideology, isn’t to ban foreign competition altogether. It’s to use the tools of trade law to pressure the foreign country to stop the subsidies.

On the other hand, from the perspective of national security, technology infrastructure is a plausible candidate for the kind of industry from which a government should exclude competitors from adversarial countries.

There’s no doubt that it would be in China’s national interests to swipe data from 5G networks — so named as the fifth-generation of cellular wireless technology — that its companies built in other countries. That means it’s in U.S. national security interests to keep that from happening within our borders.

To be sure, the U.S. is probably no better than China in this regard. American companies are easy targets (or partners) for U.S. intelligence to steal the same kinds of data. When it comes to convincing third parties such as Hungary or Poland to buy American 5G infrastructure — a key purpose of Secretary of State Mike Pompeo’s current visit to Europe — the argument can’t be that your data is safe with American companies. No one would believe it. Instead, Pompeo is saying that the U.S. won’t want to build military bases in countries with Chinese telecommunications infrastructure in place.

Nevertheless, within U.S. borders (though not outside), federal law blocks the government from monitoring the communications of “U.S. persons,” meaning citizens and others who live in the country and are entitled to federal constitutional protections.

So it isn’t necessarily hypocritical to make a national security argument for excluding Chinese 5G providers within the U.S.

The upshot is that it’s very difficult to say whether a Trump administration order blocking Chinese competition in telecommunications infrastructure would be undesirable protectionism or a desirable national security precaution. Very possibly it might be both.

The contradiction matters — a lot. It lies in the very essence of the postwar liberal international trade order.

Historically, those who favor free trade have depended on being able to draw a clear line between protectionism (bad) and national security (good). And that line usually hasn’t been so difficult to draw.

When Trump imposed tariffs on foreign steel and aluminum based on the theory that U.S. national security demands a strong domestic industry, it was relatively easy to say at a conceptual level that this argument was unconvincing. After all, the same argument could be made about almost any big industry. In economic terms, the tariffs are protectionist. The national security rationale is a fig leaf at best. (A court challenge is pending.)

Indeed, the possibility of drawing the line between protectionism and national security is built into international trade treaties, which typically prohibit protectionist tariffs while allowing exceptions for legitimate national security interests. Article XXI of the World Trade Organization treaty carves out certain actions that a signing country “considers necessary for the protection of its essential security interests.”

The real worry about the 5G case is that it will set the terms for future technology-related protectionism. As the internet of things expands, what technology isn’t ripe for data theft? Your phone is made in China. So why isn’t it just as susceptible to data theft as the network on which it operates? What about your computer, your car, your smart thermostat, your washing machine, and so on and on?

The national security argument for protectionism in these domains won’t be ridiculous, any more than it is ridiculous for telecommunications networks.

This conflict isn’t going away. It’s just coming into focus. For proponents of free trade, 5G represents just the most obvious example of a major challenge that’s going to be salient for a while. Without a good answer, they might discover that the national security rationale has the capacity to kill free trade, a little bit at a time.