Overstayers could be on a fast track to deportation if they belong to a demographic group identified as being a burden on the country.
Immigration New Zealand has been modelling data - including age, gender and ethnicity - of overstayers to identify which groups most commonly run up hospital costs or commit crime.
It could then move faster to deport people instead of prosecuting them or allowing them to re-apply for visas.
Its harm team has been using information such as past overstayers' convictions and unpaid hospital debts to feed into its data modelling work.
Other work included which demographic groups made multiple failed immigration applications or made a large section of immigration fraud allegations.
INZ compliance and investigations area manager Alistair Murray said the work was a pilot and it has been operating for the past 18 months.
"We will model the data sets we have available to us and look at who or what's the demographic here that we're looking at around people who are likely to commit harm in the immigration system or to New Zealand," he said.
"Things like who's incurring all the hospital debt or the debt to this country in health care, they're not entitled to free healthcare, they're not paying for it.
"So then we might take that demographic and load that into our harm model and say even though person A is doing this is there any likelihood that someone else that is coming through the system is going to behave in the same way and then we'll move to deport that person at the first available opportunity so they don't have a chance to do that type of harm."
Mr Murray said the team would work closely with the police to offer deportation as an alternative to prosecution in certain cases if the data shows an individual fits the criteria in the harm model.
It will also look at the 7000 immigrants in the country who failed to get a visa and continued to put in applications. Another area of work is which groups were likely to face some of the 1300 allegations it received each year of fraud or migrant exploitation.
"Just to build a profile as to who's driving all that work," he said.
"We would couple that with all the information from that data with all the other information from the other data sets and then we would look at building a profile of the type of person that we want to remove at the earliest possible opportunity."
Mr Murray denied it was racial profiling and said peoples' gender, age and the type of visa they hold would all be fed into the data sets.
While its investigators look at individual allegations on a case-by-case basis, staff can use past data to model what harms someone poses based on past overstayers' behaviour, he said.
"We look at it as - this is the way these people have engaged in the system - if we leave you sitting in the system you could stay here for five, six, seven, eight years however long - and then we think you are going to do this, that's basically it.
"We want to intervene with them earlier in the process before they have the chance to cause harm. If we don't do something about them what do we think it's going to look like in five to 10 years.
"It's predicting how someone is most likely to behave based on how their predecessors have behaved."
Pilot programme like 'Minority Report' - lobby group
A spokesperson for the group Immigration New Zealand's Unfair Decisions, Chris Kelly, said it was reminiscent of the Tom Cruise film Minority Report where a specialised police department apprehends criminals based on psychics' predictions.
"I find it all a bit arbitrary, you might as well have a psychic trying to tell the future," he said.
"I don't know whether computer modelling or data collection for what people have done previously is a fair way to look at what people are doing or might do in the future."
Immigration lawyer Alastair McClymont said he had seen recent mentions of risk profiles in visa refusals.
It was a dangerous trend as it allowed immigration officers to base their decisions on race-based assumptions rather than assessments, he said.
"It's particular nationalities that get targeted, which get under particular scrutiny," he said.
"And that, coupled with the failure of any type of complaint or review process to look at the fairness of decision-making where that complaint process no longer exists, which then allows immigration officers to target people based on certain nationalities and ethnicities."
Some immigration officers seemed to be using risk profiles as a way of justifying their own bias, he said.
Certain nationalities were already being targeted for deportation and partners of different races were more likely to be refused relationship visas than single race partnerships, he said.
Immigration minister found out about programme this morning
Immigration Minister Iain Lees-Galloway said he was disappointed that he only found out this morning when he was contacted by Morning Report.
He told the programme the ministry was profiling people who were in the country illegally, but he would be calling officials for a full briefing.
They had assured him it was not racial profiling and a range of data was considered, he said.
Mr Lees-Galloway said the data was collected to determine which illegal immigrant officials should turn their attention to first and it did not breach the Human Rights Act.
"People who have been declined for a variety of visa applications [are] the people who place the greatest burden on the health system, the people who place the greatest burden on the criminal justice system.
"And I do support them using good data to make good decisions about where best to deploy their resources."
Mr Lees-Galloway has clarified that the data being collected is not being shared internationally.