A handful of nuclear weapons won't keep a country safe. They would also need a credible second-strike deterrent.
Relations between sovereign states are fundamentally anarchic. There are no world police. The UN and other international institutions have little or no real power, and the Non-Proliferation Treaty is only enforceable through kinetic action by other countries when it suits their interests.