The atypical and clandestine nature of the work essentially means that ranks don't make much sense for spies. KGB operatives, especially those operating outside the USSR, would need a diverse set of skills, of which rank would be the least important. Skills like general familiarity with the country they would operate in, good or even expert knowledge of the foreign language, at least some vague physical resemblance with the natives. Anything that would help them blend in and not get noticed, really.
KGB's modus operandi abroad would typically involve a legal and an illegal resident spy. The legal resident would be a member of the consular staff, thus having diplomatic immunity, and the illegal resident would be as difficult to connect with the KGB as possible. This sometimes meant the KGB would recruit a local, or at least a non Soviet national, who obviously would have no military rank. And if the illegal resident spy was a Soviet national and a KGB officer, then it would make sense for them to be low ranking. Advancing in rank tends to produce a paper trail, and an illegal resident spy would need to have as low a profile as possible (even within the USSR). On the contrary, legal residents would typically be high ranking, as for their placement in critical consular positions to not raise any red flags.
To make matters even more complicated, other than the typical military ranks (the KGB was a military service after all), there were several central and local offices, directorates and units. Foreign operations operatives would mostly be affiliated with the First Chief Directorate, and their position within the directorate was probably more important than their military rank. Unsurprisingly, there are extremely little information in the wild, but from what I've managed to gather there seems to be a very wild variation in ranks when it comes to agents operating abroad. Some examples:
- Boris Karpichkov was a Major in the 80s, before he deflected to the UK
- Oleg Kalugin was a General in 1978 when he (allegedly) assassinated Bulgarian writer Georgi Markov in London
- Vladimir Kryuchkov was Deputy Chairman of the FCD when he operated in Afghanistan during the mid-1980s.
- Stanislav Levchenko was a major when he defected to the US in 1979, while on a mission
- Vladimir Kuzichkin was also a major when he defected to the Tehran Station of the British Secret Intelligence Service in 1982
- Vitaly Yurchenko was the deputy chief of intelligence operations in the US and (supposedly) the 5th highest official of the KGB when he defected to the US, during a mission in Rome, in 1985. Astonishingly, he re-defected to the USSR shortly afterwards.
As for illegal resident spies, the KGB's tendency to recruit locals is almost as old as the agency itself. The more infamous example is Aldrich Ames, a US national and CIA officer and analyst. Another example is the Cambridge Five. Although the Five operated mainly in the 1950s, the fifth member has not been conclusively identified and may have operated for as late as the late 1970s - early 1980s. None of them were or ever became ranked officers of the KGB. Other examples that show KGB's preference in foreign nationals as spies abroad are:
- Edward Lee Howard, CIA
- Harold James Nicholson, CIA
- Robert Hanssen, FBI
- Richard Miller, FBI
- Earl Edwin Pitts, FBI
- David Sheldon Boone, NSA
- Ronald Pelton, NSA
- James Hall III, US Army
- Robert Thompson, US Air Force
- John Anthony Walker, US Navy
- Clayton J. Lonetree, US Marine Corps
- Christopher John Boyce & Andrew Daulton Lee, civilians
- Thomas Patrick Cavanaugh, civilian
Lastly, information on sleeper agents are even more sporadic and even less trustworthy. Up until 2010, there were no confirmed cases of Soviet or Russian sleeper agents in the US. In June 2010 however 10 individuals were arrested and identified as Russian agents, a network that has been since known as the Illegals Program. They were operating as illegal resident spies, continuing the long tradition of the (now defunct) KGB. None of them were ranked officials, they were all civilians, however some were alleged to have family ties with members of the FIS or former members of the KGB.