How about not attacking countries and then you don't have to worry about them attacking you?
Ukraine didn’t attack anyone, but that did not keep them safe from being attacked. Clearly not attacking anyone doesn’t mean you don’t have to worry about being attacked.