I don't know a GM who hasn't had a player want to do this. They think it will be fun to play someone who is working against the PCs, but secretly. It's an understandable desire. The hidden agent is a character trope with a lot of drama, flair, and looks very interesting on TV, in books, and in movies. Unfortunately, in game, it tends to be a bit messier.
My question to day for you is, have you let it happen in your games? If so, how did you handle it? How did it play out? Would you do it again?
Personally, I've only allowed something close to it to happen before. Less an agent against the PCs, I allowed some players in a game I ran to play characters with big secrets they needed to hide from the other PCs because exposure could get them killed. In this case, the PC was a peasant with kolat leanings posing as a samurai, not directly against the PCs but against the way the samurai viewed the world and such. The secret didn't last long. The player exposed themselves, and a lot of work that had gone into setting them up was suddenly worthless.
Since then I've been wary about it. Even with groups I trust implicitly, it brings up a lot of tension and requires a lot of work I'm not always sure I want to have to put in just for one PCs story.
How about you?