A novel hydrogel dressing releases antibiotics only when harmful bacteria are detected, accelerating healing and limiting resistance.