The move comes as observers say North Korea appears to be preparing to resume nuclear testing for the first time since 2017, after historic summits with then-U.S. President Donald Trump and other world leaders in 2018 failed to convince Kim to abandon his weapons development.
The North's rubber-stamp parliament, the Supreme People's Assembly, passed the law on Thursday, according to state news agency KCNA. The law outlines when nuclear weapons can be used, including to protect the country's strategic assets and if it is attacked.
The law also bans any sharing of nuclear arms or technology with other countries, KCNA reported.
"The utmost significance of legislating nuclear weapons policy is to draw an irretrievable line so that there can be no bargaining over our nuclear weapons," Kim said in a speech to the Supreme People's Assembly.
U.S. President Joe Biden's administration has offered to talk to Kim any time, at any place, and South Korean President Yoon Suk-yeol has said his country would provide massive amounts of economic aid if Pyongyang began to give up its arsenal.
(Reporting by Josh Smith; Editing by Himani Sarkar and Lincoln Feast.)