you start with a military force that is enough to prevent another sovereign nation from doing something bad like cutting off your comm link, or forcing or freezing your bank account...
A small and geographically distributed nuclear arsenal would also be a good starting point if you wanted to avoid having the large standing army needed for conventional deterrence.
Still doesn’t solve the banking issues, but one problem at a time I suppose.
There is a limit to that. North Korea does a lot of things that no government likes, but so far they are okay. There are a lot of bigger countries that have even more immunity to targeting.
I have no idea how to pull that off.