Peptides designed by artificial intelligence restrict both drug-resistant bacteria and rapidly evolving viruses.