As part of its tough stance against illegal immigration, Texas has been one of the few states requiring state agencies to use a federal system known as E-Verify to check job applicants.

The system checks Social Security numbers to make sure a prospective employee can legally work in the U.S.

But despite the state’s determined use of technology, it has no one in charge of making agencies comply with the law. It also does not require private employers to use the system if they are not working with the state.

And that, some immigration experts say, highlights a flaw in how states and the federal government combat illegal immigration.

E-Verify is supposed to weed out would-be workers in the country illegally, but its use is largely optional. In states that do require E-Verify, its use is inconsistent, even in a state such as Texas.

Some immigrant rights activists complain that governments, though eager to target workers in the country illegally, protect the employers who hire them. Texas Democrats have come up with a term to describe this situation — a twist on the phrase “sanctuary cities” — that JoAnn Flemming, executive director of the conservative group Grassroots America, says she can agree with.

“It’s called ‘sanctuary businesses/industry,’” she said. “That makes a lot of Republicans mad when you use that term, but the fact of the matter is that there is a strong cheap labor lobby in Texas, and they give a lot of money to candidates and they have a lot of influence.”

Sen. Claire McCaskill (D-Mo.), of the Senate Homeland Security and Governmental Affairs Committee, has long criticized government officials about the tendency to crack down on people in the country illegally while largely giving a pass to those who illegally hire them.

In March, she questioned the president of the National Immigration and Customs Enforcement Council during a congressional hearing about immigration enforcement.

“Why aren’t we going after the employers who are knowingly cheating?” McCaskill asked. “They are in fact a magnet that is in fact helping draw people over the border. I mean, most of these people aren’t coming for a vacation. They are coming to try to find work.”

The dueling desires to balance targeting immigrants without legal status while not hurting businesses that rely on them is partly embodied by the use of E-Verify.

Currently, the system is only mandatory nationwide only for employers that contract with the federal government.

Earlier this year, Sen. Charles E. Grassley (R-Iowa) introduced a bill that would compel every U.S. employer to use E-Verify when hiring new employees. Grassley has introduced similar measures in the past, but they never advanced far in Congress.

Only Arizona, Alabama, Mississippi and South Carolina require that all private and public employers use E-Verify within their borders. But enforcement is weak and punishment rare, according to immigration experts. The South Carolina law contains multiple loopholes that exempt housekeepers, landscapers, farm workers, nannies and fisherman working in small crews.

“The loopholes are exactly in the areas where they should be concerned,” said Frank Knapp, executive director of the South Carolina Small Business Chamber of Commerce, which opposes mandating the system on the grounds that it’s a burden on businesses.

But even if E-Verify were widely used, the system has some fundamental flaws, according to the Department of Homeland Security. It can’t, for example, detect borrowed or stolen Social Security numbers.

Mark Reed, an expert on immigration enforcement, said that each of the nearly 1,300 workers arrested in the 2006 Immigration and Customs Enforcement raids at Swift & Co. meatpacking plants in the Midwest had passed an E-Verify check. Reed, who consults with companies on immigration issues, was once a top official with ICE’s predecessor, the Immigration and Naturalization Service.

In 2009, an independent review of the E-Verify program for Homeland Security found that about 54% of unauthorized workers screened through the system were still approved for work.

And in the three states where E-Verify is required for all employers, only about half of new employees were checked against it by employers, according to data compiled by the Cato Institute, a libertarian think tank that opposes a nationwide push.

Critics of mandatory E-Verify argue that the failure of the states to gain wide compliance is a signal of what would happen if the system were mandated across the U.S..

“If these states can’t enforce E-Verify within their own borders, how can the federal government do so nationally?” said Alex Nowrasteh, immigration policy analyst at the Cato Institute’s Center for Global Liberty and Prosperity.

If E-Verify were made mandatory nationwide, the most far-reaching effects would be felt in two states that take drastically different approaches to immigration. Texas and California have by far the some of the largest numbers of people in the country illegally: 1.65 million and 2.35 million respectively.

In Texas, 8.5% of the labor force is made up by people without legal status, according to a 2016 Pew Research Center report. In California, it’s 9%. (Nevada takes the top spot in the nation at 10.4%, according to Pew.)

Six years ago, California barred municipalities from mandating E-Verify ordinances — even voiding a number of local laws in cities such as Temecula, Murrieta and Lake Elsinore. With the exception of federal government contracts, the program is voluntary in California.

But even in Texas, the use of E-Verify is limited. It was not mandated until 2014, issued by an executive order from then-Gov. Rick Perry.

Perry’s order applied only to state agencies under the governor’s purview — and businesses that they contracted with them. But because the order did not assign a specific agency to oversee its enforcement, compliance largely operates on the honor system.

In 2015, Perry’s successor, Greg Abbott, signed into law a bill that requires all state agencies to screen job applicants with E-Verify.

The law, however, spared companies contracting with the state from the same requirement, though a court later ruled that those companies had to use E-Verify too.

This year, a bill was introduced in the Legislature to put teeth into that court ruling; it called for penalizing state contractors who failed to use E-Verify. Once again, though, lawmakers declined to single out businesses for enforcement, and the bill died in the Legislature.

Cathy DeWitt, vice president of governmental affairs for the influential Texas Assn. of Business, argues that mandating E-Verify would devastate the Texas economy and push workers into the underground economy.

“I think the reality is that there are almost 2 million undocumented workers in Texas, so laws like that do get them to move, but then these are people who contribute to society,” DeWitt said. “Separate from the jobs, you have whole other things. They are buying homes. They are buying groceries. They have buying power in Texas. …They have become valuable citizens of Texas. For us just to kick them out of the states would be a huge economic blow.”

Fleming, of Grassroots America, called the state’s tough rhetoric against illegal immigration “the great Texas fairy tale” because lawmakers are unwilling to target big business that hire unauthorized workers.

In Arizona, another state with a recent history of pushing tough measures to combat illegal immigration, no agency is tasked with actively checking whether employers are complying and signing up for E-Verify, according to the attorney general’s office.

Since E-Verify’s inception, the attorney general’s office has investigated two E-Verify non-compliance cases. The agency can investigate only if a formal complaint is brought to its attention, said Mia Garcia, spokeswoman for Arizona Atty. Gen. Mark Brnovich.

The Legal Arizona Workers Act requires every business to use E-Verify and threatens to strip licenses from businesses that knowingly hire people who are in the country illegally. Even so, only 57% of employers in Arizona used E-Verify for new hires, according to 2014 data analyzed by the Cato Institute.

“It was the great hope that never was,” said former state Sen. Rich Crandall, a Republican from Mesa, of the Arizona law. “It was promised as the silver bullet to immigration problems. E-Verify was going to solve our challenges with immigration.”