We estimated the indirect protection that vaccine-derived and infection-acquired immunity provided to a roommate. We defined indirect protection as the change in risk of SARS-CoV-2 infection in an individual based on their roommate’s COVID-19 vaccine and prior SARS-CoV-2 infection status. We adjusted for age and risk of severe COVID-19 of both the case and control and their roommates. Residents in California state prisons were less likely to be infected by the Omicron SARS-CoV-2 variant if they co-resided with an individual with vaccine-derived and/or infection-acquired immunity. The mechanism of protection is likely that individuals with vaccination and/or prior infection are less likely to become infected (and then transmit infection) or are less infectious upon breakthrough infection or reinfection. Residents with hybrid immunity were more likely to be recently vaccinated than recently infected. The average time since last vaccine dose was more recent than average time since last infection. We plotted the mean (point estimate) and associated 95% confidence intervals (bars) for indirect protection from vaccine-derived immunity (green), infection-acquired immunity (orange), and hybrid immunity (purple). Separate regression models were fit for any vaccine and any infection (Supplementary Table 2 ), vaccination by dose (Supplementary Table 3 ), and hybrid immunity (Supplementary Table 4 ).