The world is a better place for China’s emergence from behind the bamboo curtain where it hid for half a century. Economic and market reforms have led to the greatest reduction of poverty in world history. For some western manufacturers, competition from low-cost China has sometimes proved fatal, yet the overall economic effect has been beneficial, helping to deliver years of global growth without the inflation which once acted quickly to snuff out the boom times.

All this arouses a protectionist backlash, especially in America, but the American case against Huawei, the largest Chinese tech company, shows how many of these concerns are well-grounded. It demonstrates what ought not to be a surprise: that the Chinese Communist party does not operate within capitalist norms, and prefers a kind of piracy.

Charges levelled by US prosecutors give a detailed account of exactly how it behaved towards T-Mobile, its US client. Huawei is accused of smuggling one Chinese engineer into a T-Mobile lab in order to take pictures without permission and deploying another to steal a part of a handset-testing robot. The US says it can prove that Huawei even instituted a bonus scheme to reward employees for stealing more information. Other serious charges relate to alleged attempts to circumvent sanctions against Iran.

Chinese companies have long complained about what they see as bias, even bigotry against them. They dislike the assumption that every major Chinese firm will bend the rules. The problem is that this suspicion is so often well-founded. For too long, there has been an expectation in Beijing that a debt-addled West will overlook all kinds of problems — from intellectual property theft to human rights abuses — to avail itself of 5G networks and various cheap goodies. But Huawei’s behaviour does now risk a far greater, and justified, backlash.

All this said, there is a political element to trade with China — as there is with Saudi Arabia or any other country under the control of an autocratic regime. There are certain goods and services which are sensitive from a security point of view. It would be daft, for example, to buy military aircraft from a country with which we have reason to fear we might one day be in armed conflict with: it would render our planes all but useless as we found ourselves unable to source spare parts and at the mercy of systems which our enemy knew how to hack.

There are similar and ever-increasing issues with civilian technology. Telecommunications are an area in which the opportunities for espionage are immense, and, as technology advances, are becoming ever more subtle and hard to detect. It has taken years for outsiders to understand how companies such as Facebook have been using data harvested from its users.

It is not hard to imagine the potential for foreign powers to use mobile phones and other devices to spy on us. Privacy, after all, means something else in China, where the government is not even trying to hide its ambition to give each of its own citizens a ‘social credit’ score based on, among other things, their internet searches.

For too long, our own government — and many other institutions — has been complacent about these risks. For years, the Cameron government went cap in hand to China for finance for infrastructure projects without asking the right questions. Chinese money lies behind the Hinkley Point C nuclear power station, which is being built by French company EDF. That is as sensitive as civilian engineering projects go, and yet was initially approved with little regard to the security issues — although Theresa May did order a review of the project for that reason after becoming prime minister in 2016.

Huawei is much more than simply a manufacturer of phone handsets. It is working with UK universities to develop the next generation of mobile phone networks — 5G. Two weeks ago, however, Oxford university suspended all new funding from the company. This followed a rare intervention in December by the head of MI6, Alex Younger, who made the point about China’s prowess in the engineering of data. China, he said, has ‘a different legal and ethical framework’ whereby they ‘use and manipulate data sets on a scale that we can only dream of’. A hunger for Chinese investment should not blind government to this basic fact.

Day by day, China is challenging the US for world hegemony but in many ways it still thinks like the hungry Third World player it was in the 1970s. Today’s China is the world’s second-largest economy and keen to be seen as a respectable, if Machiavellian, adult around the table. It is no longer poor and is fully capable of investing in its own research, yet its companies still try to steal other people’s secrets by using shameless and even criminal techniques. T-Mobile now looks naive for having thought things would be different when it partnered with Huawei. Other companies and governments — including Britain — will now be asking if they have also been naive.

China has travelled in the right direction since the horror of Tiananmen Square 30 years ago, but it is not a democracy and it is still a long, long way from decent standards of human rights. Until it does come close to meeting those standards, we should be welcoming to its food, textile and general manufacturing exports but it will be some time before we should trust Chinese firms with anything that might pose a security risk.