The Government has passed legislation to make sure a smoking ban in prisons does not break the law.
The High Court last year found in favour of an inmate who took a civil case against the ban in Auckland prison, finding it unlawful.
Corrections Minister Anne Tolley added a change to the Corrections Amendment Bill during the committee stages to enshrine the smoking ban in law.
She said she did so to remove any potential uncertainty about the lawfulness of the policy.
Labour MP Chris Hipkins said it is not okay to retrospectively fix the mistake, without any public scrutiny.