Organisms throughout biology need to maintain the integrity of their genome. From bacteria to vertebrates, life has established sophisticated mechanisms to detect and eliminate foreign genetic material or to restrict its function and replication. Tremendous progress has been made in the understanding of these mechanisms which keep foreign or unwanted nucleic acids from viruses or phages in check. Mechanisms reach from restriction-modification systems and CRISPR/Cas in bacteria and archaea to RNA interference and immune sensing of nucleic acids, altogether integral parts of a system which is now appreciated as nucleic acid immunity. With inherited receptors and acquired sequence information, nucleic acid immunity comprises innate and adaptive components. Effector functions include diverse nuclease systems, intrinsic activities to directly restrict the function of foreign nucleic acids (e.g., PKR, ADAR1, IFIT1), and extrinsic pathways to alert the immune system and to elicit cytotoxic immune responses. These effects act in concert to restrict viral replication and to eliminate virus-infected cells. The principles of nucleic acid immunity are highly relevant for human disease. Besides its essential contribution to antiviral defense and restriction of endogenous retroelements, dysregulation of nucleic acid immunity can also lead to erroneous detection and response to self nucleic acids then causing sterile inflammation and autoimmunity. Even mechanisms of nucleic acid immunity which are not established in vertebrates are relevant for human disease when they are present in pathogens such as bacteria, parasites, or helminths or in pathogen-transmitting organisms such as insects. This review aims to provide an overview of the diverse mechanisms of nucleic acid immunity which mostly have been looked at separately in the past and to integrate them under the framework nucleic acid immunity as a basic principle of life, the understanding of which has great potential to advance medicine.