I'm looking for a short story written before 2018, probably a few decades before. It has strong Randall Garrett vibes, but I've drawn a blank searching his works in Gutenberg and my collection. Niven is also a possibility.
A pioneering colony is operating in the asteroid belt. They mine asteroids for minerals and send scoop ships to collect gas from Jupiter's atmosphere. They are at least close to being financially self-sufficient, and the Earth government is worried they might declare themselves independent if they get too strong.
A naval spaceship pays them a friendly visit. The crew examine the colony's equipment and learn that their electronics don't yet have enough shielding to survive a large electromagnetic pulse, and that if they failed at this point the colony would be unable to continue operating.
The ship launches a missile containing a device that will create a large EMP. The captain claims to have lost control of the missile, which he says was part of a routine test. Conveniently, there is enough time to evacuate the colony before the device activates.
The colonists have a number of small ships towing containers of highly corrosive gas from Jupiter. They set these on a collision course with the navy vessel, reasoning that they are too small and numerous to be avoided or destroyed, but will cause expensive damage if they make contact. Their leader tells the ship's captain that he will divert the ships if the missile is deactivated. He explains that he doesn't believe the navy would launch a missile without some kind of failsafe, that he has a legal obligation to maintain peace and order in the region, and that the captain's action shows he is a threat to that peace and order.
The captain remotely deactivates the missile and returns home. It's mentioned that he doesn't get openly punished for his actions (or failure) but his career never advances again.