Implant related infections are the most common cause of joint arthroplasty failure, requiring revision surgeries and a new implant, resulting in a cost of $8.6 billion annually. To address this problem, we created a class of coating technology that is applied in the operating room, in a procedure that takes less than 10 min, and can incorporate any desired antibiotic. Our coating technology uses an in situ coupling reaction of branched poly(ethylene glycol) and poly(allyl mercaptan) (PEG-PAM) polymers to generate an amphiphilic polymeric coating. We show in vivo efficacy in preventing implant infection in both post-arthroplasty infection and post-spinal surgery infection mouse models. Our technology displays efficacy with or without systemic antibiotics, the standard of care. Our coating technology is applied in a clinically relevant time frame, does not require modification of implant manufacturing process, and does not change the implant shelf life.