It's not entrapment to pose as a "John" to catch a prostitute.
It has a track record of being a defense against criminal charges, if the person is found to have been induced to commit an act that he/she would not otherwise have done.
"Skip" Humphrey, son of the late Senator and VP candidate, Hubert Humphrey, helped screw up his political aspirations for governor by executing an ill-conceived sting operation while AG of MN. Here are traces from my failing memory of the event. Anyone wanting the exact version can dig for it
It seems they went to great lengths to set up phony hazardous waste handling service. One of the calls, to a local cabinet shop landed them a "prize" bust, when the part time bookkeeper, senior citizen grandmother
answered the phone and fell for the sales pitch.
Why yes, we have a barrel full of used paint remover and solvents. Your quote is better than the last place. I think the owner will be happy to save money.
Oops! It was 20 years ago or so, and granny forgot to scan the house and senate index for new legislation criminalizing businesses that use haulers without checking to see if they had some sort of hazardous materials license.
Cuffs for the owner, cuffs for grandma, off to jail to see the judge. Splash goes the story on the paper, local TV. Released, no charges filed by the DA, apparently the first adult in authority on the scene
Of course, the appraiser is probably not a sympathetic character