You mean other than a policy of neutrality, much like Switzerland and Finland (and, to a lesser extent, Ireland) have pursued?
This would mean training a defensive army with the clear message that the cost of invasion would be so high as to dissuade such imperialist endeavours. The Swiss developed this half a century ago [1].
This is not a new, untried or crazy idea.