Actually it is, you are probably thinking of only one specific subsection of the prime directive.
In reality however it's actually a complicated legal document that covers a number of different things up to an including "Interfering in the internal affairs of a society".
You're being silly. The Prime Directive doesn't stop Starfleet engaging in offensive action against a hostile force to defend itself or others.
The Prime Directive concerns affecting the development of alien races/societies, particularly those who haven't achieved interstellar spaceflight.
Everyone knows this.