A company owned by Google has been given access to the healthcare data of up to 1.6 million patients from three hospitals run by a major London NHS trust.

DeepMind, the tech giant’s London-based company most famous for its innovative use of artificial intelligence, is being provided with the patient information as part of an agreement with the Royal Free NHS trust, which runs the Barnet, Chase Farm and Royal Free hospitals.

It includes information about people who are HIV-positive as well as details of drug overdoses, abortions and patient data from the past five years, according to a report by the New Scientist.

DeepMind announced in February that it was developing a software in partnership with NHS hospitals to alert staff to patients at risk of deterioration and death through kidney failure.

The technology, which is run through a smartphone app, has the support of Lord Darzi, a surgeon and former health minister who is director of the Institute of Global Health Innovation at Imperial College London.

However, the agreement on patient record sharing has caused concern among those who have already been concerned about Google’s moves in the healthcare sector.

A spokesperson for the Royal Free said patients would not be aware that data was being made available but it was encrypted and such an arrangement was standard practice.

It said: “Our arrangement with DeepMind is the standard NHS information-sharing agreement set out by NHS England’s corporate information governance department and is the same as the other 1,500 agreements with third-party organisations that process NHS patient data.

“As with all information sharing agreements with non-NHS organisations, patients can opt out of any data-sharing system by contacting the trust’s data protection officer.”

Sam Smith, of the health data privacy group MedConfidential, told the New Scientist: “This is not just about kidney function. They’re getting the full data.

“What DeepMind is trying to do is build a generic algorithm that can do this for anything – anything you can do a test for. The big question is why they want it. This is a very rich data set. If you are someone who went to the A&E department, why is your data in this?”

Dominic King, a senior scientist at Google DeepMind, told the BBC that access to timely and relevant clinical data was essential for doctors and nurses.

“This work focuses on acute kidney injuries that contribute to 40,000 deaths a year in the UK, many of which are preventable,” he said.

“The kidney specialists who have led this work are confident that the alerts our system generates will transform outcomes for their patients. For us to generate these alerts it is necessary for us to look at a range of tests taken at different time intervals.”