“The enemy’s spies who have come to spy on us must be sought out, tempted with bribes, led away, and comfortably housed. Thus they will become converted spies and available for our service.” – Sun Tzu’s The Art of War
What does this mean? If someone is working for someone else, make them an offer they can’t refuse, gain all information you can, and have the spy work for you in the end. I’ll add an additional step to remind people almost anyone can be bought for the right price, and money is the one thing 99% of people want.
Spies can also be a metaphor, not always someone trying to gain information for malicious intent.
If someone is spying on you, first verify that’s what they’re doing. Second, find out what they want, why, and who they’re working for. Then make an offer that will force them to swap sides. Then instead of reporting to the original person they will report to you. Sometimes people will play double agent for personal gain – you’re just trying to figure out who’s spying and why. When in doubt, keep the spy within eye and ear reach.
The number one important factor – make sure there’s no way the spy can’t later use your bribes against you. If they do want to play the double agent, make sure nothing can be traced back to you by any (legal) means necessary.