LAST THURSDAY, TEXAS senior senator John Cornyn stood before an audience of wonks at the Council on Foreign Relations in Washington, DC, and warned that America’s openness to investors looking for new ideas in technologies like artificial intelligence was putting it in danger. “Most of what China wants to invest in these days is leading-edge US technology that’s a key to our future military capabilities,” he said. “Unless the trend line changes, we may one day see some of these technologies incorporated in China-made equipment that can be used against our country in the event, heaven forbid, of a military conflict.”

Cornyn highlighted China’s interest in robotics and artificial intelligence as particularly concerning. His warning—and pledge to introduce legislation that could restrict Chinese investment in technology companies—came the week after Reuters reported, citing unidentified Trump administration officials, that the administration is considering a similar policy, also motivated in part by fears of China gaining access to valuable AI knowledge.

However, Cornyn’s diagnosis and proposed cure could lead to a result opposite to the intended one. America’s military does need to harness machine learning and artificial intelligence to keep up with China and other nations. But restricting China from investing in US technology probably wouldn’t make much of a dent in the country’s progress—and could make America less competitive. “I think the US should focus on accelerating its own AI rather than slowing down anyone else’s,” says Andrew Ng, a high-profile machine learning researcher who has worked at Stanford and Google, and was until recently chief scientist at Chinese search engine Baidu.

China is far from an AI delinquent. Baidu, Tencent, and other leading Chinese internet companies have spent heavily to build up large, skilled research teams in machine learning and AI, both at home and abroad. The Chinese government has put the technology at the heart of several initiatives under its latest five-year plan. It recently worked with Baidu to set up a new national lab dedicated to keeping China competitive in deep learning, the technique behind recent progress in areas such as image and speech recognition, and a program called Artificial Intelligence 2.0 will funnel billions to develop AI for commercial and military use. A White House report last October revealed that China overtook the U.S. as the world’s most prolific producer of research papers in deep learning publications sometime in 2013—and that the gap is widening. “This is not like us having stealth technology and Soviets not having it. China has made artificial intelligence a clear priority area to both its economy and military,” says Peter Singer, a senior fellow who studies technology and national security at non-partisan think tank New America. “Even if this proposed legislation went through, it wouldn’t stop them from continuing to engage successfully with this technology—they’re a superpower and the world’s second largest economy.”

Nor do Chinese AI researchers need to embed in Silicon Valley to keep up with the latest ideas in machine learning. Much work on deep learning takes place out in the open. Companies such as Google and Facebook not only publish numerous papers detailing their latest ideas but also open source the software and hardware they use to put it in action. “The cat is out of the bag at this point because of open research,” says Raj Reddy, a professor at CMU and pioneer of AI who in 1999 chaired a report cosponsored by the Pentagon that compared Japan’s capabilities in digital information to those of the US.

America’s best hope of staying ahead in artificial intelligence is to keep alive the vibrant, open, R&D culture that has made it the global hub for the recent blooming of ideas and investment in the field. But Silicon Valley companies are already worried that the Trump administration’s posturing on immigration and other matters are deterring foreign talent and money from coming to US shores. Peter Lee, corporate vice president for AI and research at Microsoft, says any new restrictions on who can invest in what could exacerbate the problem. Meanwhile, other countries are laying out the welcome mat to outside talent and capital in AI. Canada, which has universities that are crucial to the rise of deep learning, is using various federal and regional programs to build up artificial intelligence industry and research through immigration and foreign investment.

Back in America, the government doesn’t go in for the kind of large-scale, top-down programs China is using to support work on advancing AI. But some important funding mechanisms that do exist are set to go into retreat. Ng and other leading researchers who helped bring about the deep learning boom, such as Yann LeCun, a professor at NYU and now director of Facebook’s AI research, did so with help from government agencies such as Darpa and the National Science Foundation. The Trump administration’s budget proposal would give Darpa a slight increase, but is set to cut funding to other military research, as well as to the NSF.

“You can argue about whether they’ll be able to really implement it or not, but the Chinese have strategy and industrial policy and the US does not,” says Adam Segal, director of the digital and cyberspace policy program at the Council on Foreign Relations. America needs some kind of plan for how to support and benefit from artificial intelligence, but believing that limiting what Chinese investors do in Silicon Valley will slow down the country isn’t it.