Universities and polytechs will face a $100,000 fine if they are found to be responsible for the serious harm or death of students in their care, from next January.
There will be two law changes in response to the death of 19-year-old Mason Pendrous, whose body lay undiscovered in his hostel room at the University of Canterbury for at least a month.
At the moment tertiary providers follow a voluntary Code of Conduct, but Education Minister Chris Hipkins said that was not enough.
"The recent death at a student hall of residence in Christchurch exposed the limitations of our current system," he said.
"Halls and hostels charge a premium for their accommodation and parents have every right to expect a high level of care for their sons and daughters."
A new mandatory Code will come into effect in January 2021.
The government would work with providers to develop the new code, said Mr Hipkins, and in the meantime an interim code setting out expectations would be in place for the start of the next academic year.
While there were high standards of pastoral care for international students, as set out in the Code for Pastoral Care of International Students, the same could not be said for domestic students, he said.
Mr Hipkins said any fines for breaching the code will fall to the relevant University or Polytechnic and not third party providers.
"I want to be clear here the institutions can't contract this out, they have the duty of pastoral care and if they're using third party providers to provide student accommodation, they still need to be making sure there is adequate pastoral care in place," he said.