Corneal infection is an important cause of corneal damage and vision loss. In this work, polyhydroxy antibiotics were grafted onto polymer brush-modified contact lenses through dynamic chemical bonds between polyphenolic hydroxyls and phenylboronic acid. Both in vitro and in vivo antibacterial tests demonstrated great promise in the prevention of bacterial keratitis, which could be attributed to the enhanced retention time and drug bioavailability.