The US aerospace firm SpaceX was co-founded by South African inventor Elon Musk, who also heads California-based Tesla Motors. Credit: Ben Baker/Redux/eyevine

Immigration has become a toxic subject. In the United States, President Donald Trump is trying to ban or block the entry of refugees and of people from Mexico and parts of the Middle East. Other nations, from the United Kingdom, France and Germany to Australia and Thailand, face political pressure to curb numbers of incomers.

Anger at the erosion of national competitiveness is the root of the rage in the United States, in my view. Increasing financial inequity, changing racial and ethnic demographics and a widening knowledge gap between technology haves and have-nots are other factors. Immigrants and global trade have become the scapegoats.

Nature special: Human migration

Blaming foreigners is not new; it happens when people feel disenfranchised. Throughout US history, each wave of immigrants has forced preceding generations to compete. Newcomers often achieve great success, and face resentment. Chinese engineers helped to build US railways in the nineteenth century, but faced riots and even massacres because they were hired on cheap wages preferentially over whites. The Italian immigrants who came after them were blamed for everything from domestic radicalism to organized crime. Then it was the Poles, the Japanese and the Germans who faced abuse.

The United States has gained tremendously from foreign-born inventors. From Alexander Graham Bell, the Scot who invented the telephone, and Nikola Tesla, the Serbian who invented the laser and radio remote control, to Albert Einstein and the wave of scientists fleeing Nazi Germany, immigrants have made the United States the world's leader in technology. Indian and Chinese entrepreneurs fuelled the dot-com boom in the late 1990s. A South African, Elon Musk, founded Tesla Motors and the aerospace firm SpaceX.

But in the past decade, skilled immigration has stalled. Flaws in the US visa system make it hard for well-educated and experienced immigrants to stay. Rather than set up companies and create employment in the United States, foreign-born scientists and engineers have been returning home, taking their ideas and inventions with them. As a result, innovation has become global and the technology playing field has levelled across the world (see go.nature.com/2kmqmjq).

Credit: Source: Crunchbase Unicorn Leaderboard

Now, as dark clouds of nativism swirl around Capitol Hill, the country's leaders face an important choice. They can play the populism card, close the doors and watch US global competitiveness fall — or they can welcome the world's best and brightest to boost innovation and create jobs. Technology will advance with or without the United States. The nation needs to decide whether it wants the innovators on its side. Other countries seeking to limit immigration should ask themselves the same question.

Global innovation

Today, Internet companies in China, such as Alibaba, Baidu and Tencent, are among the most innovative and valuable in the world. Facebook has mimicked features of their products; Apple has been accused of copying Chinese innovations in the iPhone 7; and search engine Baidu's artificial-intelligence system is more advanced than Siri. Chinese scientists will soon lead the pack on applying CRISPR–Cas9 gene-editing technology (see, for instance, Nature 539, 479; 2016 ). India has sent an orbiter to Mars and launched a record-breaking 104 satellites from a single rocket. Its new platform for digital currencies, India Stack, may allow its financial system to leapfrog that of the West. Chilean scientists have built cheap technologies that sanitize water by temporarily changing it into a plasma phase. South Korea has built autonomous cars that it aims to have on its roads before the Pyeongchang Winter Olympic Games in 2018.

Nature special: Science in China

One measure of globalization is the number of 'unicorns', technology start-up firms valued at US$1 billion or more. As recently as 2000, nearly all of these were in the United States; other countries could only dream of creating a Google, Amazon or Facebook. By February 2017, of the 213 unicorns in the world, China had given birth to 55 and India 10. The United States is home to only 110 (see 'Global entrepreneurship' and go.nature.com/2fqy5qw); half of those have at least one immigrant founder1 (see 'Foreign talent'). The US share of unicorns is shrinking, and Silicon Valley is facing unprecedented competition.

Gone are the days when, owing to the high costs of the core technologies, US and European research labs held a monopoly on large-scale innovations. Whereas early generations of supercomputers cost tens of millions of dollars, today's smartphones, which outperform them, cost as little as $30. Sensors, artificial intelligence, robotics, genomics and 3D-printing technologies are globally available and inexpensive. Anyone, anywhere, can use these to build world-changing products. Government-built walls of visas and travel restrictions are no barriers to innovation, only to economic growth.

Credit: Source: Ref. 1

Brain drain

The contributions of immigrants to tech companies are well documented. In 1999, regional economist AnnaLee Saxenian at the University of California, Berkeley, found2 that Chinese and Indian executives were at the helm of 24% of the businesses started in Silicon Valley between 1980 and 1998. That proportion doubled the following decade. My research team worked with her to show that between 1995 and 2005, foreign-born innovators founded 52.4% of technology companies in Silicon Valley and 25.3% nationwide3. We also showed that immigrants generated $52 billion in revenue and employed 450,000 workers in 2005. They filed the majority of patents at technology companies such as Qualcomm (72%) and Cisco (60%), and more than 40% of US government-filed international patent applications had foreign authors4.

Then things changed. A backlog of applications built up for employment-based visas that allow permanent residency (green cards). With sociologist Guillermina Jasso of New York University, we analysed this backlog. As of 1 October 2006, there were almost half a million applicants (more than one million when family members were included). Because only about 120,000 visas are available each year, getting a green card can take a decade5. We forecast that this wait would increasingly frustrate highly skilled workers, leading to a 'reverse brain drain'.

Indeed, by 2012, my team found that immigrant entrepreneurship had stalled. The proportion of companies founded by immigrants fell nationwide to 24.3% and in Silicon Valley to 43.9% (ref. 6). We believe from anecdotal evidence that highly skilled workers are returning to their home countries in even larger numbers today.

Canadian-born chemist Michelle Zatlyn co-founded the US Internet company CloudFlare. Credit: Steve Jennings/Getty

These are the people who set up the unicorns in countries such as China and India. Each of those companies has one or more US returnees in senior leadership positions, and restrictive US immigration policies put them there.

Two decades ago, it was the norm for students who came to the United States from China and India to want to stay. No longer. On graduating from engineering courses, most overseas students say that they will work for a short time to gain experience, then return home7. Human-resource directors of companies in India and China tell me that they are flooded with CVs from students from US universities. Working for an exciting start-up such as Baidu or Alibaba is more enticing than being locked into a menial US position for a decade awaiting your green card.

When I visit technology centres in China and India, and increasingly in places such as Mexico City or Santiago in Chile, I see a beehive of start-up activity. As well as social-media and Internet applications, overseas entrepreneurs are designing wearable medical devices, robots, drone-based delivery systems, microsatellites and agricultural-automation systems. They are building self-driving cars, solar technologies and 3D-printing systems to solve global problems.

Meanwhile, the US visa backlog is climbing. I estimate that there are more than 1.5 million skilled workers in immigration limbo in the United States today. Each one is a lost opportunity and a waste of talent.

Nature special: Tracking the Trump White House

Everyone loses. The precarious position of foreign-national staff leaves them open to mistreatment by their employers. Rules prevent employees from changing jobs while waiting for their green cards — even to other jobs in the same company. H-1B visas for temporary stays allow employers to replace US workers with people who are paid less than they should be, given their skills. This is one of Silicon Valley's darkest secrets — and it is why tech companies lobby for more H-1B visas rather than more green cards. Skilled people become frustrated as their careers stagnate. The jobs that would have been created in start-ups go overseas.

Unless it changes its immigration outlook, the United States will forgo economic benefits and jobs in a misguided effort to protect both. It will have to watch as the rest of the world leaps ahead. It doesn't have to be this way.

Embrace outsiders

The United States needs to expand the number of permanent-resident visas and clear the backlog. These people are already working in the country legally, and have the experience and skills needed. Retaining them will boost the economy. Accelerated granting of permanent residency could be contingent on buying a house, making investments or starting companies that create jobs. Imagine the benefits of 10,000 new technology start-ups.

The United States needs to decide whether it wants the innovators on its side.

We need to make it easy for entrepreneurs abroad to bring start-up firms to the United States. One solution is to provide a 'start-up visa' as a path to permanent residency. This would perhaps be valid for five years, with an upgrade to permanent residency dependent on the firm's employment of US workers. The Kauffman Foundation in Kansas City, Missouri, has estimated that such a visa would create 1.6 million jobs within 10 years and boost the US economy by $224 billion a year8.

The solution to the mistreatment of foreign workers is easy: untether the H-1B visa from the employer. Let people change jobs, and let the market decide what their salaries should be. This would remove the financial incentives for companies to replace Americans with cheaper foreign workers, and would encourage them to hire the best talent.

By becoming the best place in the world for entrepreneurs to study and work in, the United States could again be in the driving seat of technology innovation. Then we can share the resulting prosperity in a more equitable way to mitigate the anger of the electorate.