A protein structure-guided covalent scaffold selectively targets the B1 and B2 subclass metallo-β-lactamases.