OpenSAFELY is a secure analytics platform for electronic health records (EHR) in the UK’s National Health Service, to efficiently share health records and results from patients during the Covid-19 pandemic. It delivers analyses of over 58 million patients’ pseudonymised primary care NHS records; all data analysis is conducted inside secure environments of participating EHR software companies. This data collaboration is spearheaded by the DataLab at the University of Oxford, the EHR group at the London School of Hygiene and Tropical Medicine, and other EHR software companies.