cGAS/DncV-like nucleotidyltransferase (CD-NTase) enzymes are immune sensors that synthesize nucleotide second messengers and initiate antiviral responses in bacterial and animal cells. Here, we discover Enterobacter cloacae CD-NTase-associated protein 4 (Cap4) as a founding member of a diverse family of >2,000 bacterial receptors that respond to CD-NTase signals. Structures of Cap4 reveal a promiscuous DNA endonuclease domain activated through ligand-induced oligomerization. Oligonucleotide recognition occurs through an appended SAVED domain that is an unexpected fusion of two CRISPR-associated Rossman fold (CARF) subunits co-opted from type III CRISPR immunity. Like a lock and key, SAVED effectors exquisitely discriminate 2′–5′- and 3′–5′-linked bacterial cyclic oligonucleotide signals and enable specific recognition of at least 180 potential nucleotide second messenger species. Our results reveal SAVED CARF family proteins as major nucleotide second messenger receptors in CBASS and CRISPR immune defense and extend the importance of linkage specificity beyond mammalian cGAS-STING signaling.