The chairman of the Grenfell Tower inquiry has backed a request from firms that refurbished the building that evidence they give should not be used against them in criminal prosecutions.
Some firms had threatened to stay silent in the inquiry into how Grenfell was covered in flammable cladding.
Sir Martin Moore-Bick said he had asked Attorney General Geoffrey Cox for the assurance "as a matter of urgency".
The fire at the west London tower block in June 2017 killed 72 people.
Representatives from organisations including cladding company Harley Facades, building contractor Rydon and the Kensington and Chelsea Tenant Management Organisation had asked for a guarantee that anything they say in the hearings would not be used as part of any potential future prosecutions.
The inquiry - which is in its second phase - was paused while Sir Martin considered the firms' application, which was vigorously opposed by lawyers representing a group of the bereaved, survivors and residents.
The Metropolitan Police is conducting its own investigation into possible crimes ranging from gross negligence manslaughter and corporate manslaughter to health and safety offences.
In its ruling, the inquiry panel said it would immediately write to Mr Cox - who will make the final decision - in order to secure the terms under which evidence will be given when the inquiry resumes.
It added that the deal must ensure that no "oral evidence given by a natural or legal person before the Inquiry in Modules 1, 2 and 3 will be used in evidence against that person in any criminal proceedings or for the purpose of deciding whether to bring such proceedings".
The BBC's home affairs correspondent Tom Symonds said this deal - if it is backed by the Attorney General - would not provide immunity from prosecution, as the police can still gather their own information.
But he added: "They couldn't use what a witness said at the inquiry as evidence at a trial."
Campaign group Grenfell United has criticised companies involved in the tower's refurbishment for "passing the buck and minimising their own role in the disaster".
The inquiry's second phase, which began last week, is looking at how the building came to be covered in a flammable type of cladding during its refurbishment between 2012 and 2016.
Emails disclosed to the inquiry suggested that companies knew a planned cladding system would fail in the event of a fire.
The investigation has heard that - with the "sole exception" of the Royal Borough of Kensington and Chelsea, which accepted that the tower's refurbishment should not have been signed off - all organisations involved in the work have denied responsibility.
The first phase of the inquiry heard how the fire on 14 June 2017 spread quickly up the 23-storey tower in west London, claiming the lives of 72 people.