To revive its sluggish economy, China set out this year to woo foreign investors and stabilize its ties with the West. But these goals are colliding with what China’s leader, Xi Jinping, considers the paramount priority: bolstering national security in a world he sees as full of threats.

Xi has warned that China must fight back against a campaign by the United States to contain and suppress the country’s rise. In this worldview, foreign rivals are using spies to weaken China’s economy; Russia is not treated as a pariah but a vital partner in blunting the NATO menace; and the diplomatic stage is a place to assert China’s influence and reshape the global order in its favor.

At home, authorities have sent a chill across foreign businesses by launching a nationwide crackdown on consulting firms with international ties. China’s state broadcaster accused Western countries of trying to steal sensitive information in key industries with the help of consulting firms that help investors navigate the murky Chinese economy.