Scientists discovered how plants defend themselves against bacteria that try to flood leaf interiors with water.