australia
Entrapment of itself, is not illegal
However, it is likely that in using entrapment, police may commit other crimes
The leading case on point is Ridgeway v The Queen. Unlike the US, evidence obtained though state wrongdoing, including entrapment, is not automatically excluded but may be excluded at the discretion of the judge.
When deciding the matter of Ridgeway, the High Court of Australia held that there was no practical defence of entrapment. However, the court did recognise that as a matter of public policy, courts need to exercise their discretion to exclude any evidence of an offence that was brought about by the unlawful conduct of law enforcement officers. This discretion exists to discourage unlawful conduct by police and to preserve the integrity of the administration of justice.
In the Ridgeway decision, the High Court ultimately held that the evidence which established that the heroin had been illegally imported should be rejected. Their Honours drew attention to the ‘calculated’ and ‘grave’ nature of the AFP’s actions, especially that:
their actions constituted an offence in that they allowed the heroin to be imported;
the police officers involved had not been prosecuted despite having also committed an offence;
there was no evidence of any official disapproval or retribution; and
the AFP’s objective would have been achieved if the evidence were admitted.
The court weighed these factors up against the public interest of a finding of guilt against Ridgeway. It determined that the public interest could be satisfied by the availability of a variety of offences that the offender could be prosecuted for that did not involve illegally importing the drug.
As you can see, it was open for the police to be charged with importing heroin but not with entrapment.