The coroner in the Westminster inquest has called on Scotland Yard to station armed officers at all of the gates of parliament on a permanent basis to prevent another attack and told MI5 it should be keeping better records.
In a report quietly issued to a government judicial website, without notice, Mark Lucraft QC, the chief coroner said he had heard "matters giving rise to concern" and that there was a "risk that future deaths could occur unless action is taken".
"In the circumstances, it is my statutory duty to report to appropriate persons who may be able to take remedial action," he added.
He issued 18 recommendations, including one that the Parliamentary and Diplomatic Protection Command at Scotland Yard should be subject to external audit from another department within the police and receive better training for marauding terrorist attacks.
The coroner also recommended Transport for London assess the height of parapets and railings after two of the victims fell from Westminster Bridge when they were struck by Masood.
He also recommended the coastguard could issue guidance on how to retrieve unconscious bodies from water and that the Department for Transport and the car rental industry look at a code of practice on checks before vehicles are rented.
Khalid Masood ran down five people on Westminster Bridge and stabbed PC Keith Palmer to death on 22 March last year.
After a three-week inquest, Mr Lucraft made a finding of unlawful killing on the death of PC Palmer, 48, and on American musician Kurt Cochran, 54, retired window cleaner Leslie Rhodes, 75, school administrator Aysha Frade, 44, and Romanian designer Andreea Cristea, 31.
Michelle Palmer, the policeman's widow, asked how her husband could have been left "alone and unarmed" and John Frade – Mrs Frade's husband – called on MI5 to learn lessons.
MI5 faced similar complaints made after the 7 July and Woolwich killings that they were not keeping good enough records to explain why they had closed investigations.
At the inquest, they complained that it was "not practicable" to record reasons for every decision by its officers "not to do something".
But the coroner disagreed, saying in his report: "It strikes me that closing a person as an subject of interest is a positive decision that further investigation is not justified or necessary.
"It is not obvious to me that such decisions are so numerous that recording each one with a short rationale would be impracticable.
"Furthermore, I can see clear operational benefits to corporate memory in having such reasoning recorded which could assist in the fight against terrorist activity."
He asked that the security service "considers whether it would be practicable and beneficial to introduce a procedure to record with brief reasons the decision to close a person as a subject of interest (SOI)."
Mr Lucraft also said it was a "matter of concern that, at the time of the attack, one of the most vulnerable and public entrances to the parliamentary estate was not protected by armed police".
If armed police officers had been stationed at Carriage Gates at the time of the attack "it is possible that they may have been able to prevent PC Palmer suffering fatal injuries," the coroner added.
He said there was a "recurring feature" of reviews of parliamentary security that public entrances, including Carriage Gates, where Masood entered, presented vulnerabilities.
The coroner recommended that the Metropolitan Police Service consider imposing a "standing order" that there should be armed officers stationed at "all open public entry points to the Palace of Westminster, and possibly to some other buildings on the parliamentary estate".
They should also introduce a provision that the standing order could only be varied with the written approval of an officer of "very senior rank".
The order would provide "clarity" and a "minimum level of protection," the coroner said.
"Given the nature of terrorist threats to this country and its parliament, it is difficult to imagine circumstances in the near future when an open public entry point to the palace should not be protected by armed guards," Mr Lucraft added.
The coroner also highlighted "shortcomings" in the supervision of police officers at the Palace of Westminster and said it was a "matter of concern" that officers were unaware of their post instructions.
He suggested "regular supervisory audits" of policing at the Palace of Westminster, and perhaps other parts of the parliamentary estate, preferably by officers outside the Parliamentary and Diplomatic Protection Command.
"It appeared that many armed officers in an important area of the palace were regularly patrolling in a way which was not compliant with their instructions, and that this was not being effectively corrected by their supervisors," the coroner said.
"It strikes me that there could be real benefit in having a periodic unannounced audit or review by an officer from outside the command, who could check practical compliance with post instructions and other standing orders."
"As in other fields of life, assurance is often best carried out by somebody outside the body or department under scrutiny," the coroner added.
The sisters and parents of PC Palmer had expressed concerns about the training of police officers at the Palace of Westminster and the coroner called on Scotland Yard to review the adequacy of training for "lone actor" and "multi-actor" marauding attacks.
He also suggested that Scotland Yard considered a "periodic audit" of tactical firearms reviews because no new review had been carried out for eight months, despite the fact that the threat level had been raised.
The inquest heard that despite warnings of other vehicle attacks around Europe, no protective barriers were put on Westminster Bridge, where five people were killed by Masood.
The coroner warned that it was "not clear from the evidence" what work was being done at the national level to deliver wide-ranging advice on protective security measures, especially for roadways and public areas in urban areas.
More from Westminster Attack
"It would obviously be unsatisfactory if such work is limited to a limited group of areas designated as crowded places and crowded spaces," he added and recommended that "consistent and up-to-date national advice" should be provided.
Organisations which have been asked to make changes were given until 12 February next year to respond.