Trump's immigration agenda faces serious legal hurdles, no matter who is homeland security secretary

Here's what to know about the border and immigration debate.

That means it’s unlikely the next head of Homeland Security will be able to move much faster than Nielsen.

“She got roundly criticized by the left for going too far, and roundly criticized by immigration hawks by not going far enough,” said Steve Yale-Loehr, who teaches immigration law at Cornell Law School.

“I don’t wish that job on anybody,” he said.

Here's what to know about immigration and the border:

The president can’t blow up the asylum system unilaterally

And what about revamping visa lotteries and other rules that Trump derides as “chain migration”?

“Not without getting Congress to rewrite immigration law that’s been on the books for 30 years,” said Aaron Reichlin-Melnick, a policy analyst with the American Immigration Council.

A wholesale rewrite of U.S. asylum laws is considered especially unlikely with Democrats in control of the House and Republicans divided on how far to go on immigration.

That leaves Trump with the legal reality that once people reach U.S. territory and make an asylum claim, that person has a right to run their claim past an immigration judge.

Trump has few options to detain families

Trump, like President Barack Obama, wanted the power to detain families who arrive at the border without documentation while their cases wind through court –- a process that could take months or years. But the federal courts have repeatedly said no, citing a previous court settlement not to detain children for longer than 20 days.

Trump tried to get around this mandate with “zero tolerance,” a policy that detained the adult and put the child in government custody. But he was forced to backtrack amid a public outcry and federal court ruling ordering that the families be reunited.

Since then, the government has had few options than to release the families. One option floated by Trump aides has been the idea of giving a parent a choice to be detained with their child, or agree to the child being put in government custody. But experts say that policy too would likely face legal pushback.

Trump’s ‘Remain in Mexico’ policy just got blocked by a federal judge

Under Nielsen, the administration has incrementally rolled out its “Remain in Mexico” policy, starting in San Diego and slowly moving east.

Under that policy, some asylum applicants from Central America were told to wait in Mexico while their immigration claims play out in court, a process that could take months or even years.

A California judge blocked the policy Monday following a law suit from advocacy organizations representing migrants who had been returned in recent months. The decision centered on the abrupt implementation of the policy that violated administrative procedures which require more planning and deliberation before a policy can go into effect.

The court order requires migrants to be returned to the U.S. this week. The Trump administration could challenge this decision in the 9th circuit court of appeals.

Mark Krikorian, director of the Center for Immigration Studies, a group which advocates for lower levels of immigration, said Nielsen actually deserved to be fired for not starting "Remain in Mexico" more quickly.

“They should have been doing this a year ago," Krikorian said. "It needs to be rolled out across the border and apply to more people.”

Trump’s best bet is probably to stop people from coming in the first place

Legally, Trump’s best option is probably trying to stop people from coming in the first place. His administration, under Nielsen, has proposed encouraging people to apply for asylum while they are still living in their home country.

Another avenue Nielsen tried was old fashioned diplomacy by meeting with Central American leaders to get their help to stop migration.

But so long as the option exists for people to travel north, the idea of applying for asylum at home probably won’t catch fire if people think their chances improve if they are physically inside the United States.

“If you’re not in the U.S. you have significantly less legal rights than if you take one step over the border,” said Sarah Pierce, a policy analyst at the nonpartisan Migration Policy Institute.