Microsoft does not want to move jobs out of the United States but certain decisions out of Washington could potentially force its hands, the company's President and Chief Legal Officer Brad Smith warned.

The Trump Administration's tough stance on immigration has attracted a lot of criticism from big technology firms, which rely heavily on skilled foreign workers from around the world.

Smith previously spoke out against efforts to stop the Deferred Action for Childhood Arrivals (DACA) program — an Obama-era policy that provides legal protection for young immigrants brought to the U.S. illegally as children.

Microsoft has advocated the protection of DACA and more broadly supported immigration as a way to make sure U.S. companies are hiring talented people.

"We do worry about a couple of the very specific immigration questions that people appear to be debating in Washington," Smith told CNBC's Akiko Fujita in an interview on Wednesday.

He pointed to two particular examples. The first is another Obama-era rule that allows some spouses of people who have a non-immigrant H-1B visa to take on paid work. The Trump administration has proposed revoking that type of work authorization last year but a lack of update has left many in limbo, according to reports.

The second is a rule that allows international graduates in science, technology, engineering or mathematics from U.S. universities to continue working while they're trying to apply for a work visa.

Already, the administration has tightened some of the requirements for that program, but Smith said further changes could affect "hundreds of employees who would lose their ability to work in the United States." That could leave Microsoft with no choice but to help those affected employees work somewhere else, according to Smith.

"We don't want to move jobs out of the United States and we hope that we don't see decision making in Washington that would force us to do that," he said, adding that Microsoft has been openly speaking to people in Congress, at the White House and even the Canadian government to safeguard the interest of its employees. Microsoft has a development center in Vancouver, which Smith described as a "bit of a safety valve."

"We're not going to cut people loose. We're going to stand behind them,” he added. That includes representing affected employees in court or helping to retain or pay for their legal fees. “In the world of technology you better stand behind your people because your people are your most valuable asset.”