Changes to espionage laws will allow New Zealand to keep up with the "serious threat" of foreign interference, the government says.