As a massive caravan of migrants treks north, US officials have been negotiating with Mexico about how to handle the caravan should it reach the US border.

Officials are weighing the legality of certain steps the Trump administration could take and looking at whether any processes could be changed to speed up the removal of migrants who have no legal basis to remain in the US, according to a senior Department of Homeland Security official.

The official says the administration hasn't made any "firm decisions" about how to respond if the caravan reaches the border.

Among the topics being discussed with Mexico is whether migrants from the caravan could be held there before entering an official port of entry, the DHS official said. The official said this is already being done to some extent, and described this as a more official process of what is known as "metering," when Customs and Border Protection officers keep immigrants in Mexico to limit the flow into the US. This process has been sharply criticized by advocates, who accuse officials of illegally trying to block immigrants from claiming asylum.

A spokesperson for Customs and Border Protection referred all questions on the caravan to DHS.

Additionally, the US is negotiating with Mexico about whether migrants from the caravan could be deported there, regardless of their country of origin. This process, known as "return to territory," which was included in President Donald Trump's January 2017 executive order on border security, isn't currently carried out by Immigration and Customs Enforcement, because Mexico would need to agree to take foreign nationals back.

"A lot of these (options) depend on cooperation and discussions with Mexico," the official said.

There were 401 claims for asylum from the caravan that made its way to the US last spring, with 374 of those receiving "credible fear referrals," which is the initial screening to ensure a claim could have merit, according to Citizenship and Immigration Services data.

ICE has been talking with contractors to discuss the possible need for additional detention capacity, according to the DHS official. ICE is also preparing for the possibility that it might need more officers at the border, the official said, stressing that while officials are preparing for various possibilities, they have not taken action.

DHS has not responded to a request for comment on these policy considerations, but on Tuesday, DHS spokesperson Tyler Houlton tweeted that "stopping the caravan is not just about national security or preventing crime, it is also about national sovereignty and the rule of law. Those who seek to come to America must do so the right and legal way."

On Tuesday, another senior administration official said the "administration wants the ability to return whole entire Central American families and also minors after apprehension."

This official called the asylum system the "world's largest immigration loophole."

"You simply come up to the border, you make a totally fraudulent assertion and it puts you into a legal system that takes more time to play out than we can detain you for, and so it becomes a ticket to catch and release," said the official on Tuesday.