We estimated the strength and durability of indirect protection that COVID-19 vaccine-derived and SARS-CoV-2 infection-acquired immunity provided to a close social contact (roommate). Residents in California state prisons were less likely to be infected by the Omicron SARS-CoV-2 variant when residing with an individual with infection-acquired or vaccine-derived immunity; both sources of indirect protection waned over time, but infection-acquired immunity yielded stronger and more durable indirect protection. We estimated indirect protection based on time since last vaccine dose (green), time since last SARS-CoV-2 infection (orange), and time since most recent vaccine or infection (purple). We plotted the mean (point estimate) and associated 95% confidence intervals (bars) for indirect protection. We fit separate models for vaccine-derived immunity, infection-acquired immunity, and most recent vaccine or infection (Supplementary Table 5 ).