Cyclic adenosine diphosphate (ADP)–ribose (cADPR) isomers are signaling molecules produced by bacterial and plant Toll/interleukin-1 receptor (TIR) domains via nicotinamide adenine dinucleotide (oxidized form) (NAD+) hydrolysis. We show that v-cADPR (2′cADPR) and v2-cADPR (3′cADPR) isomers are cyclized by O-glycosidic bond formation between the ribose moieties in ADPR. Structures of 2′cADPR-producing TIR domains reveal conformational changes that lead to an active assembly that resembles those of Toll-like receptor adaptor TIR domains. Mutagenesis reveals a conserved tryptophan that is essential for cyclization. We show that 3′cADPR is an activator of ThsA effector proteins from the bacterial antiphage defense system termed Thoeris and a suppressor of plant immunity when produced by the effector HopAM1. Collectively, our results reveal the molecular basis of cADPR isomer production and establish 3′cADPR in bacteria as an antiviral and plant immunity–suppressing signaling molecule.