Many people assume that if a person wishing to buy drugs approaches an undercover police officer, the case will be dismissed if the officer lies and denies working for the police. But that is not generally true. Police may lie, but they may not be involved in “entrapment”.
Entrapment occurs when police induce or persuade someone to commit a crime they are not otherwise predisposed to commit. A person who approaches an undercover officer to buy drugs is predisposed to commit a crime; thus, even if the officer assures them he is not with the police, the person still may be punished for the crime.