A deep learning-based framework can efficiently generate novel antimicrobial peptides with potent activities against both bacteria and viruses.