Police leading undercover stings will be forced to disclose more details to prosecutors after a damning report into a high-profile case collapse.
Both senior lawyers and officers were to blame for failures to declare surveillance evidence during attempts to convict protesters accused of plotting to shut Ratcliffe-on-Soar power station, an inquiry said.
Director of Public Prosecutions Keir Starmer QC said the findings were a "watershed" moment as he ordered disciplinary action against Crown Prosecution Service lawyer Ian Cunningham.
He also wrote to the Attorney General expressing concern about communication between prosecutors and police.
"To avoid any recurrence of similar issues, I propose that a police/CPS memorandum of understanding be prepared that makes it absolutely clear that in any future cases, the full extent of any authorisation and activity of an undercover officer must be shared between the police and the CPS as soon as a criminal prosecution is contemplated," Mr Starmer wrote.
Critics claim the independent report had not gone far enough to expose an "institutionalised corruption of the legal process".
The No Police Spies campaign group identified a string of other cases where prosecutors failed to fulfil obligations to declare activities of officers.
Michael Schwarz, of law firm Bindmans, added: "I think it is unacceptable that the CPS should produce the Rose report to hide behind."
Mr Cunningham could be sacked after retired High Court judge Sir Christopher Rose outlined a catalogue of individual failings during attempts to prosecuteprotesters.
Sir Christopher said Mr Cunningham should have done more to establish the extent of Pc Mark Kennedy's undercover involvement during the investigation.
The lawyer "relied too heavily on what he was told by police in relation to the undercover officer and failed to probe what material there was in relation to the undercover officer's activities", Sir Christopher said.
Although there were individual failings, "at no stage of the prosecution was there a deliberate, still less dishonest, withholding of information", the report said.
The case sparked widespread concern after it emerged that Mr Kennedy, a former Scotland Yard officer, spent years posing as an activist known as Mark Stone.
Six protesters accused of planning to invade the power station in Nottingham, the second largest in the UK, claimed prosecutors dropped charges against them after Mr Kennedy offered to give evidence on their behalf.
And 20 people have had their convictions quashed after previously being convicted of conspiracy to commit aggravated trespass.
Disclosures were not made during the case because of "failures, over many months and at more than one level, by the police and the CPS", Sir Christopher said.
"The failures were individual, not systemic and not due to any want of printed guidance," the retired judge wrote.
He recommended changes to the prosecution disclosure manual to make it "explicit" about activities of undercover officers.
"The general picture of what occurred is that, at several stages, there was a failure between police officers and between the police and CPS to pass on such information," he wrote.
Much of the blame for the lack of disclosure rests with police officers who "were anxious to limit the dissemination of that knowledge in order to protect the source", the report said.
But Mr Cunningham "failed to ask pertinent questions" to obtain the information, it added.
"In consequence, charges were laid which would not have been and the defence were later prejudiced because potentially helpful material never reached them, as it should have done, long before the trial of the justifiers."
Sir Christopher also concluded "there could and should have been a meeting between the police and the CPS before charging decisions were made at which the sensitive material, particularly the undercover officer's authorisations and the content of his audio recording, could have been made clearly known to all present and their significance discussed".
He added: "If there had been such a meeting, it is highly unlikely that anyone would have thought it in the public interest for charges to be brought."
Mr Starmer, who asked Sir Christopher to conduct an independent inquiry following concerns about the non-disclosure of material over the summer, said the events "cannot be allowed to happen again".
"It has to be seen as a watershed in the way cases involving undercover officers are dealt with," he added.
The top prosecutor also wrote to Sir Hugh Orde, the president of the Association of Chief Police Officers, seeking his agreement to the police/CPS "memorandum of understanding that makes it absolutely clear that, in any future cases, the full extent of any authorisation and activity of an undercover officer must be shared".
"I take very seriously the findings of individual failings on the part of the CPS, including failures properly to comply with disclosure obligations, failure to ask questions of the police and failure to oversee the case effectively," Mr Starmer added.
Sir Christopher published his report despite the postponement of the findings of a separate review into what went wrong.
The review, launched by Her Majesty's Inspectorate of Constabulary (HMIC) in January, was reportedly set to rule out tough judicial oversight of the deployment of undercover officers, wanted by some police chiefs.