Undercover agents do have immunity in most cases.
In the vast majority of situations, the police and undercover agents are immune from prosecution, so long as their actions lie within the scope of their official undercover role.
A legal justification called the “public authority defense” shields these activities from criminal liability.
Undercover cops do not have to identify themselves, so you'll have to use other clues to figure out if someone is a cop.
You could check their vehicle to see if it has nondescript plates or dark window tinting that looks like a cop car.
You could also check their appearance for hints.
When police set you up it's called entrapment.
Entrapment is when police officers coerce or induce someone into committing a crime.
Entrapment is a defense to criminal charges on the basis that the defendant only committed the crime because of harassment or coercion by a government official. Without such coercion, the crime would never have been committed.
The way a sting operation works is the police setup a deceptive operation to entice the criminal into buying something illegal such as drugs or to entice them to do something illegal such as prostitution enticing a minor, meeting up with a minor etc.
A Sting Operation is an operation designed to catch a person committing a crime by means of deception.
A sting operation is where the police or someone sets up a crime or a deceptive operation to catch someone or people committing crimes.
An example of a sting operation would be the police go undercover and try to sell drugs to someone and acts as a drug dealer.
Although the undercover officer is not really a real drug dealer they would be enticing the real drug user to buy the drugs.
So they would be catching a buyer of drugs by acting as a seller of the drugs and when the person buys the drugs from the undercover police officer the person buying the drugs commits the crime and then gets arrested.
However if the undercover officer hadn't been selling the drugs to the person then the drug buyer wouldn't have committed that crime.
However the drug buyer would also still commit a crime by buying the drugs from someone else but would not be caught.
In law enforcement, a sting operation is a deceptive operation designed to catch a person attempting to commit a crime.
Police have long engaged in “sting operations.” In a sting operation, the police create an opportunity for someone to commit a crime, and when someone does, the police nab them, and prosecution follows.
The Marshall Defense Firm mounts vigorous defenses in these especially challenging cases.