The buzz over proposals to tighten US visa rules caused a furore this week, with the move being interpreted as the death knell for India’s $150-billion IT outsourcing industry. However, for many Indian tech majors, this isn’t really breaking news because they’ve known for a while that US visa laws are a game of political roulette.

For nearly a decade, companies such as Tata Consultancy Services, Infosys, and Wipro, which get over 60% of their revenue from the US, have been bracing themselves for such tightening of laws. And in recent years, these efforts have intensified significantly.

In 2016, TCS, India’s largest IT outsourcing company, applied for only 4,000 new US visas, as against 14,000 in 2015, N Chandrasekaran, the company’s outgoing CEO and Tata Sons’ chairman-designate, said last month. TCS was granted only around 1,300 visas that year.

“There is a lot of commentary (recently) about the increase in the visa fee…(and) the number of visas one will get. We are addressing both very proactively. In terms of the number of visas that we will get, we decided more than a year ago that we have to operate in a visa-constraint regime,” Chandrasekaran said. “We are able to successfully execute (our orders) by making changes to our business model. So we believe that we are preparing ourselves well to handle the headwind should it arise.”

The hanging sword

Bills to tighten H-1B visa rules have been floated in the US Congress for years. The H-1B allows foreign workers to work in the US for up to six years. The programme has often been criticised for opening up a pipeline of cheap labor at the cost of US-bred engineers.

India’s IT outsourcing industry, which accounts for around 9.5% of the country’s GDP and employs nearly 3.7 million professionals, has in the past faced federal fines and investigations over its use of US visas. In 2013, Infosys paid a hefty $34 million to settle one such case. This was the largest payout by any company for an alleged civil fraud over visas.

Last week, the issue picked up steam again when a bipartisan bill, first introduced in 2007 and aimed at revamping the visa programme, was reintroduced. In addition, Democratic Congresswoman Zoe Lofgren submitted her own bill, called the High-Skilled Integrity and Fairness Act of 2017 (pdf), which, among other restrictions, called to significantly raise the minimum wage that applicants of such visas must earn in order to qualify.

On Jan. 30, reports of a draft executive order to revamp US immigration laws for foreign workers also surfaced. The order instructs the secretary of homeland security (pdf) to consider changes to the H1-B visa programme to “ensure that the beneficiaries of the programme are the best and the brightest.”

Restricting the visa programme is a blow to Indian IT companies, for long the main beneficiaries of H-1B visas (pdf). While there is so far no official word on any changes to the visa programme by the US government, these firms are already beginning to feel the heat with their shares taking a beating.

However, immigration experts say the number of H-1B applications filed does not necessarily reflect the real story.

The US grants only 85,000 such visas a year. Authorities receive almost three times as many applications and a random computerised lottery picks from the applicant pool. This means that less than 30% applicants actually secure H-1B visas.

“Even in recent years, it appears that IT companies did not really need all the H-1B visas that they were filing petitions for. Companies were prone to apply for more than what they needed in order to increase their chances of getting their petitions selected in the lottery system,” said Poorvi Chothani, managing partner at Mumbai-based LawQuest, a global immigration law firm.

At the same time, Chothani, who works with several Indian IT firms on immigration-related issues, notes that these firms have also been preparing for an alternative future.

Years of prep

To gradually reduce the impact of a change in US visa norms on their business, Indian companies have begun investing in “near-shore centers” – facilities close to the US – and also increasing local hiring in America.

By 2007, TCS had set up offices in Argentina, Brazil, Chile, and Uruguay, and a “global delivery center” in Mexico. Rival Wipro, too, opened a software development facility in Mexico that year. In 2013, Infosys said it will deploy fewer non-citizens in North America and, instead, put workers from near-shore centers on its projects.

In 2009, Wipro began ramping up hiring in the US. “We have already started to react (to proposed changes in visa norms). We anticipated this. We started ramping up our Atlanta center with local hires, fresh from campus. We’re doing the same thing in Troy, Michigan,” Wipro chairman Azim Premji said in a 2009 interview with BusinessWeek.

Fearing immigration reforms, TCS followed suit in 2013, saying it would make more efforts to hire American graduates. In recent years, Infosys has gone all out to attract American talent. In fact, its current CEO, Vishal Sikka, is a Stanford-educated American national.

In all, 100 Indian companies in the US – 40% belonging to the IT industry – had created more than 91,000 jobs there, a 2015 survey (pdf) by the Confederation of Indian Industry shows.

Indian IT companies have also been spending on acquisitions in the US to increase local manpower. In November 2016, Wipro’s chief financial officer, Jatin Dalal, and Tech Mahindra’s chief executive, CP Gurnani, both said they are on the lookout for possible acquisitions.

But one key challenge in this strategy is the shortage of skilled Americans. In December 2016, a survey of over 1,000 hiring managers and recruiters by jobs site Indeed revealed that almost nine in 10 respondents found it hard to discover and hire technical talent in the US.

TCS and Infosys declined to comment for this story. Wipro did not respond to an email from Quartz.

Changing business model

Another approach is to work virtually, which is becoming easier with the wider adoption of cloud services and greater digitisation, meaning fewer employees are required in the US. Indian IT companies have been pushing American clients to adopt more virtual services and that’s making a big difference.

“(Our) AI (artificial intelligence) platform is 5-6% of our revenues,” Infosys’s Sikka told Reuters last year. “Three years ago, it was zero.”

Over the last few years, Indian IT companies have also increasingly veered away from labour-intensive projects to more hi-tech virtual needs, such as cloud computing, automation, and artificial intelligence.

“The ‘Plan B’ would be to accelerate the trend…to reduce their reliance on people and increase their focus on delivering automation, leveraging the cloud for their clients,” said Partha Iyengar, Gartner’s head of research in India.

After all, Donald Trump could regulate the number of people allowed into the US, but legislating against bots in the cloud will be much tougher.

“You can only punish the legacy business for ripping out cost, but not the emerging business for building their global support infrastructure,” Phil Fersht, chief analyst at research firm HfS Research, wrote in a LinkedIn post.

This article first appeared on Quartz.