A resident spy in the world of espionage is an agent operating within a foreign country for extended periods of time.
Other famous Soviet and Russian "illegals" include Richard Sorge,[4] Walter Krivitsky, Vasily Zarubin, Alexander Ulanovsky, and Anna Chapman, who was also known as a sleeper agent.
However, conversely, illegal resident spies have easier access to a wide range of potential sources who would be put off by having to approach and deal with an openly foreign official.
Espionage agencies may arrange to pay a host country organization or corporation to allow the illegal resident spy to pose as a member of its staff and be nominally paid by that organization/corporation.
[6] A legal resident spy has full and aboveboard access to embassy facilities for secure communications, meetings, and other services.
A legal resident spy may be at risk by having an official biography that documents their diplomatic career and provides useful clues to counterintelligence services about their intelligence activities and connections.