MSPs have voted to deny consent for a Bill which aims to protect undercover agents, saying greater safeguards are needed against lawbreaking.
The SNP, Labour, the Liberal Democrats and the Greens voted against granting consent to the Covert Human Intelligence Sources (Criminal Conduct) Bill, which is going through Westminster.
On Tuesday, MSPs voted by 92 to 27 against legislative consent for the Bill.
The vote will not affect its passage at Westminster.
Opponents, some of whom have referred to the legislation as the “spy cops Bill”, say it could permit abuses by police or security service officers.
Scotland’s Justice Secretary, Humza Yousaf, said greater safeguards were needed around rules which allow undercover law enforcement agents to engage in criminal conduct.
Yousaf has said he acknowledged the need for covert sources, but there should be judicial scrutiny of a criminal conduct authorisation (CCA) before any lawbreaking takes place.
During a debate on Tuesday, he told the Scottish Parliament: “I am disappointed to report that, despite very candid engagement with the UK Government, they have not brought forward amendments to the Bill that would satisfy my concerns.
“The Bill remains deficient in my view and I know members share that view.”
He said a forthcoming ruling from the Court of Appeal may require Holyrood to pass its own “legislative remedy” to the law around covert investigations.
Scottish Labour’s Neil Findlay said he had long raised the issue of undercover officers who had infiltrated protest groups, in some cases forming “intimate relationships” with women.
He said: “No longer will every citizen be equal before the law.
“We know the scandals that have emerged under the current system, where there is no immunity from prosecution.
“Imagine the abuses that will come if there is immunity from prosecution.
“This is a departure from any legal norms that we have, it is a human rights scandal waiting to happen again.”
Speaking for the Scottish Liberal Democrats, Liam McArthur said there was a need for new legislation but the Bill “overstepped the mark”.
He said: “Our Liberal Democrat colleagues at Westminster, working with other parties, have sought to make changes that would deliver a more proportionate but effective set of legal safeguards.
“While there have been successes, too often UK Government ministers have refused to budge.”
Scottish Greens MSP John Finnie said Amnesty International had called for expressed limits on the extent of lawbreaking allowed by undercover agents.
He said: “Greens don’t want the potential human rights abuses including murder and torture and torture, punishment shootings, kidnap, sexual offences or conduct that would interfere with the course of justice being rendered lawful.”
However, the Scottish Conservatives’ justice spokesman Liam Kerr said those who opposed the Bill were risking public safety.
If the Court of Appeal were to rule the current system of covert surveillance was unlawful, he said, it could halt investigations into terrorism, cybercrime, people trafficking or drugs smuggling.
Kerr said: “The UK Bill anticipates this, setting a statutory framework, allowing our security services and our police to continue to protect us.”
He continued: “This is vital legislation which provides a clear and consistent statutory basis for public authorities to keep the public safe.
“Failure to give consent risks leaving Scotland’s people exposed.
“That is deeply irresponsible and I cannot believe that any MSP would vote to countenance such a situation.”