Bacteriophage is one of the severest threats to fermentation factories. To help solve the problem, we design a gene circuit which can both sense and defend against phages. We use the modified promoter pRM to sense the phage’s infection and initiate the defence. The lysis gene which can make bacteria lyse is installed to our circuit. When it works, the phage won’t be able to take advantage of its host to replicate any longer. To win more time for lysis to function well, we design an antisense RNA to prevent the phage from turning into lytic life cycle. Thus, when the lysis protein kills the host, the phage is still at lysogenic life cycle or the newly assembled phages are still immature. By using the quorum sensing system, the bacteria around the host can make well preparation to defend in advance. Attribute to these parts, our bacteria survive.