The Government is introducing legislation allowing undercover agents to participate in crime to protect their identity in long-term operations.

The Covert Human Intelligence Sources (CHIS) Bill, which will have its first reading in Parliament on Thursday, protects operatives from prosecution if they are forced to break the law.

The CHIS Bill aims to provide “clear and consistent statutory basis” defining circumstances in which operatives can commit crime, replacing various pieces of overlapping legislation used currently.

The bill will cover 13 law enforcement and government agencies, including the police, the National Crime Agency, the armed forces and the prison service.

Also included are Home Office immigration and border investigators, HMRC and the Competition and Markets Authority, as well as the Gambling Commission and Food Standards Agency (FSA).

But critics fear the bill will give these forces carte blanche to carry out human rights abuses with little external oversight.

Senior officers within each force will decide how far their agent can go to protect their cover with regular reviews conducted by Investigatory Powers Commissioner Sir Brian Leveson.

The Home Office emphasised that bill would be tempered by the Human Rights Act which protects right to life and prohibits torture and subjecting someone to degrading and inhuman treatment.

A spokeswoman for the Home Office said the bill would not contain an exhaustive list of what an operative would be allowed to do.

But she added: “In a sense it is explicit in the legislation that all public bodies are bound by the Human Rights Act and all activity will be limited in that context.”

She gave the example of counter terrorism police joining proscribed organisations such as National Action or Islamic State.

Police officers working to infiltrate paedophile networks would also be protected if breaking the law helped them gain the trust of the people running the ring.

Any criminality must be deemed “proportionate and necessary” by the undercover officer’s superior to be protected by the new bill.

But a consortium of human rights organisations headed by Reprieve want to see specific prohibitions on offences including torture, murder and sexual violence written into the bill itself – mirroring similar laws in the US and Canada.

Maya Foa, Reprieve’s director, said: “Our intelligence agencies do a vital job in keeping this country safe, but there must be common sense limits on their agents’ activities, and we hope MPs will ensure these limits are written into the legislation.”

Security Minister James Brokenshire said the new law was vital to protect undercover agents who are often placed in dangerous situations in the course of investigations.

“This is a critical capability and is subject to robust, independent oversight,” he said.

“It is important that those with a responsibility to protect the public can continue this work, knowing that they are on a sound legal footing.”

Ken McCallum, director general of MI5, cited the 27 terror attacks that have been thwarted since March 2017 with the help of undercover agents.

“In some situations, it is both necessary and proportionate to authorise agents to be involved in some managed level of criminal activity, in order to win or maintain the trust of those intent on harming the UK and gain the critical information needed to save lives” he said.

“This power, carefully used and independently overseen, is vital so we can continue to meet our duty to keep the public safe.”

Shadow home secretary Nick Thomas-Symonds said: “National security is the top priority for Labour and that means ensuring our security services are able to keep us safe, whilst operating within robust safeguards.

“We will look closely at these proposals in that spirit.”