Mr Guy said it would bring New Zealand's systems into line with those in Australia where boat people are a long-standing issue.
Mr Key said the changes were intended to make it clear to people smugglers that New Zealand was not a soft target and deter attempts to "queue jump" in as refugees.
He said it would also help authorities cope if there was a sudden mass arrival of asylum seekers, rather than get bogged down dealing with them individually in court.
"This is because a mass arrival group would likely include people whose identities are unknown or are in doubt and who may have criminal backgrounds or connections with criminal or terrorist groups, and could pose a security risk for New Zealand."
Mr Key said although no boats had made it to New Zealand so far, there had been some close calls.
Last month, 10 Chinese nationals arrived in Darwin on a boat and said they were headed to New Zealand. They have now claimed asylum in Australia.
"That further affirms that it may just be a matter of time before a boat of people seeking asylum try to come to New Zealand or even get here."
Last year, Indonesian authorities had also stopped a boat carrying 85 Sri Lankans holding New Zealand flags and signs reading "We need New Zealand". He said distance did not make New Zealand immune - in 2010, about 500 illegal immigrants from Southeast Asia had landed in Canada after a 1300km journey.
Labour's immigration spokeswoman Darien Fenton said it was important New Zealand's borders were secure but the proposals were an over-reaction. She said New Zealand had taken far less than its annual quota of 750 refugees in recent years.
"There will be a lot of debate about the mass detention. It sounds to me like Australia and everyone can see how divisive that has been.
"There has been awful stories coming out of those detention centres and I'd hate to see something like that in New Zealand."
The legislation to make the changes to the Immigration Act will be introduced in Parliament this week and Mr Guy expected it to pass by the end of the year.
Mr Key said officials would begin an exercise this week - Operation Barrier - to practise for such a situation.
The exercise had been in planning for 12 months and would involve up to 17 government agencies over its eight-week duration.
The exercise would include a simulated mass arrival, the actors from which would be processed at Devonport Naval Base in June.
LAW CHANGES
The Boat People law changes:
* will apply to illegal immigrants who arrive in a group of 11 or more.
* will be detained under a group warrant, rather than individual warrants.
* if accepted as refugees, will not get residency for at least three years after their refugee status is reviewed.
* will only be able to sponsor immediate family members to NZ, not extended family such as adult siblings or parents.