The right of self-defense under customary international law is the right of a state to use military force in order to protect its citizens from an attack by another state. This doctrine stems from the premise that states are generally expected to act in accordance with their own self-preservation, and will use force, if necessary, in order to defend themselves against such attacks.
As a general rule, self-defense requires an act of aggression by the defender against the attacking state. In many cases, this may involve pre-emptive action - striking before an attack takes place - but it may also involve emergency measures taken in response to an imminent threat. While self-defense is not invariably triggerless, generally it must be exercised reasonably - that is, with due care to avoid unnecessary bloodshed or destruction. In some cases, however, it may be justified on grounds of necessity - for example, where there is no other available way to protect citizens from imminent threat.