Rules letting MI5 informants commit crimes are "critical" to national security, lawyers for the Security Service have told a court.
MI5 is fighting an attempt to disclose secret guidance its officers can authorise informants to take part in crimes and not tell prosecutors.
Campaign groups told the Investigatory Powers Tribunal the policy is unlawful and could be hiding serious abuses.
MI5 said it does not authorise activity that would breach human rights.
The unique case, large parts of which will take place in secret, comes a year after the government confirmed the existence of a previously secret document, dubbed the "Third Directive".
Signed by former Prime Minister David Cameron, the directive confirmed for the first time that MI5 officers could allow their recruited informants and agents to commit crimes in the national interest, without any duty to tell police and prosecutors what had happened.
But the accompanying detailed guidance on how the policy works in practice remains largely secret.
The disclosed elements stress that any authorisation must be in the interests of preventing a more serious offence, protecting an informant's cover or to protect national security.
Four campaign groups - two of which are from Northern Ireland - are now seeking to have the guidance disclosed and ruled illegal.
In submissions to the tribunal, they say that "grave abuses" in Northern Ireland showed the public had a right to know.
They include allegations that the state covered up its involvement in the 1989 murder of Belfast solicitor Pat Finucane and a massive investigation into suspected crimes committed by the UK's most valuable agent at the heart of the IRA, codenamed "Stakeknife".
Ben Jaffey QC, for the four campaign groups, told the court "the agents in question are not officers of the Security Service, but they are recruited and given directions by MI5".
However, he said those MI5 officers could become criminally liable as an accessory.
Mr Jaffey said MI5's policy amounted to the Security Service deciding for itself that it could brush aside criminal law.
"They are trying to do by the back door what Parliament won't give them by the front door," he said.
"The practical effect of the policy is to grant the immunity that they wanted but were not prepared to ask Parliament to give them."
But in legal papers disclosed on Tuesday morning, government lawyers for MI5 said: "It would be impossible [for MI5 to fulfil its functions] effectively without covert human intelligence sources. They are indispensable.
"The Security Service does not, and does not purport to, confer immunity from criminal liability. It is not able to authorise activity which would breach... the European Convention on Human Rights. The case is that they do not do so."
"The Security Service has, since its inception, run agents; and agents have had to participate in conduct that might be or would be criminal as an integral part of their ability to operate," the lawyers said.
The tribunal was told MI5 had reviewed all available records of agents being involved in crimes since October 2000. The result of that secret audit has been given to the tribunal - but not disclosed to the public.
"This is not a 'nice to have power'... it is critical," the Security Service's lawyers said.
"The whole point of the agent involvement is to avoid loss of life and limb."
The tribunal is due to hear submissions over four days and is expected to reserve its judgment.