Bacteria use diverse immune systems to defend themselves from ubiquitous viruses termed bacteriophages (phages). Many anti-phage systems function by abortive infection to kill a phage-infected cell, raising the question of how these systems are regulated to avoid activation and cell killing outside the context of infection. Here, we identify a transcription factor associated with the widespread CBASS bacterial immune system, that we term CapW. CapW forms a homodimer and binds a palindromic DNA sequence in the CBASS promoter region. Two crystal structures of CapW reveal how the protein switches from a DNA binding-competent state to a ligand-bound state that cannot bind DNA due to misalignment of dimer-related DNA binding domains. We show that CapW strongly represses CBASS gene expression in uninfected cells, and that CapW disruption likely results in toxicity due to uncontrolled CBASS expression. Our results parallel recent findings with BrxR, a transcription factor associated with the BREX anti-phage system, and suggest that CapW and BrxR are the founding members of a family of universal anti-phage signaling proteins.