Caught up in policy changes are potentially hundreds of immigrants already in the Army’s recruiting pipeline, and thousands more who would have followed. Many have prioritized military service with the goal of gaining fast-tracked citizenship — a perk the Army can offer as it competes with the private sector for talented applicants.

The Pentagon defends this and related measures implemented in recent months, claiming they’re necessary to prevent terrorists and foreign agents from infiltrating the American military.

Critics deride the moves as potentially unlawful, and that they’ll turn away prospective troops who possess language and medical skills desperately needed throughout the armed forces. The piecemeal, secretive manner in which these new rules have been adopted has caused widespread confusion for recruits and recruiters alike, opponents say, and sends a terrible message.

“It looks like we’re now afraid of foreigners in the military. And that means mission failure,” said Margaret Stock, a retired Army officer who created an immigrant recruitment program for the military. “If you’re going to be deployed in more than 100 countries to fight a global war, you can’t be afraid of foreigners.”

Other new regulations also extend the waiting period for military green-card holders to become naturalized U.S. citizens. Previously, that could occur just weeks into basic training. Now active-duty recruits must wait at least 180 days.

The dramatic policy changes have eroded confidence among recruits closely monitoring every development. One Army Reserve recruit, a green-card holder from Haiti, told The Post on Wednesday that his training date was suspended with no indication when he can expect to resume the enlistment process.

“We had a contract and now they’re not going to respect the terms,” said the recruit, who spoke on the condition of anonymity out of fear of reprisal.

“It’s confusing. There is no explanation. Even the recruiter doesn’t know what is happening,” he said.

Since the 9/11 terrorist attacks, more than 100,000 immigrants have been naturalized through military service. Turning away immigrants, who make up more than 13 percent of the U.S. population, will dry up a reliable recruiting pool at a time the Army, pressed to reach quotas, is enlisting some men and women with weak qualifications, Stock said.

Moreover, because U.S. law says permanent residents are permitted to enlist, the new policy may violate the law; it also may violate treaties with the independent island nations of Micronesia, the Marshall Islands and Palau. Those citizens have a legal right to enlist, said Stock, who is an immigration attorney.

First reported by Mic, the policy change immediately sparked panic among recruits confused by the barrage of new regulations. The same was true for recruiters. A Facebook information page used by thousands of current and potential recruits featured a post Tuesday with multiple recruiters giving contradictory and inaccurate assessments of the directive.

The program Stock created in 2009, called Military Accessions Vital to the National Interest, or MAVNI, traded fast-tracked citizenship to immigrants who possess valuable skills that are in short supply among U.S.-born service members — Arabic and Chinese fluency or expertise in trauma surgery, for instance. More than 10,400 troops joined this way before the program was shuttered in late-2016 amid security concerns and complaints that enhanced background checks started by the Obama administration overwhelmed resources.

As The Washington Post first reported in June, 1,000 foreign-born recruits awaiting orders had lost their legal immigration status as a result. At the time, the Pentagon said any cancellation of enlistment contracts could expose immigrants to deportation.

In response, lawmakers pledged to block that decision. Some recruits fled the country, and last month, the Army killed contracts for hundreds of immigrants — in many cases prematurely and without warning.

The MAVNI program’s suspension was a factor in the Army’s failure to meet its goal of bringing in 14,400 reservists this year, Stock said. There was a shortfall of more than 1,000 recruits, Army officials said. The Pentagon estimated 2,400 had passed previous security check benchmarks and were waiting to train when officials recommended canceling the bulk of those contracts.

Defense Secretary Jim Mattis said Friday that he believes the MAVNI program can be saved, but he stressed the need to harden the military from “espionage potential” among immigrants.