Teenagers as young as 15 have been authorised as Covert Human Intelligence Sources, according to official figures, in conditions that campaigners claim breach their human rights.
As of March this year, a total of 17 children across 11 areas have been taken on by police and other UK investigative agencies since January 2015 - a majority of them aged 16 and 17.
In one case, a 17-year-old girl spy continued to be sexually exploited by the man she was gathering intelligence on, and she was even coerced into being an accessory to murder.
Children's rights charity Just for Kids Law has crowdfunded to bring the judicial review against the Home Office, claiming already vulnerable children are at risk of exploitation as well as long-lasting physical and emotional harm.
The campaigners claim that that under the current legislation (Regulation of Investigatory Powers Act 2000), 16- and 17-year-olds are not given access to an appropriate adult as they would be in a police station.
Their parents may not even know they are being used in this way, according to the charity.
It highlights that the UK-ratified UN Convention on the Rights of the Child, which states that all those under 18 are children and entitled to special protection under the law.
Enver Solomon, the charity's chief executive, called on the government to act "urgently" to protect children.
Solomon said that the children involved are "among the most vulnerable" and require protection.
"When the police identify a child who is being exploited, their first response should be to safeguard that child and help them to get out of that situation rather than put them at great risk of further exploitation and abuse," said Solomon.
Neil Woods, a former police officer who handled spies in drugs enforcement, said it was "completely inappropriate for children to be put in danger in this way", adding that he had witnessed first-hand the impact on spies of being forced to maintain a lie for long periods.
Woods said it can cause "severe long-term damage to mental health, especially for vulnerable people who are most likely to be used as informants".
He added: "Children recruited as informants are also highly likely to end up getting drawn back into criminality and feeling trapped in their situation."
Security minister Ben Wallace said that children are used as spies very rarely and only when there is no other less intrusive way to get the information needed to convict criminals such as drug dealers or terrorist suspects.
"Their use is governed by a strict legal framework and is overseen by the Investigatory Powers Commissioner," he said.
"Throughout any deployment and beyond, the welfare of the young person is the paramount consideration."
Mr Justice Michael Supperstone reserved his judgment, which will be handed down at a later date.