Much speculation on this one, there are quite compelling arguments for that are well documented now.
Brief summary here by Liam Clarke:
Liam Clarke on Martin Ingram and Martin McGuinness[I]McGuinness in new spy claims
Martin McGuinness denies spying for MI6. So how has he survived when those around him have been shot or jailed, asks Liam Clarke
RAYMOND GILMOUR, the supergrass who infiltrated the IRA in the early 1980s, used to wake up screaming following nightmares that Martin McGuinness was about to shoot him. But now he suspects his life was protected by his former IRA commander and that McGuinness, like him, was a British agent.
More from FAIR:
That's the case for, I'd be interested to hear some arguments for the case against, surely alot or at least some of this stuff can be explained away?[I]10 FACTS about the "charmed existence" enjoyed by Martin McGuinness. There are several reasons for suspicion falling on Martin McGuinness for he survived when those around him have been shot or jailed. Derry IRA informants coughed up more secrets, leading to more arms finds, than any other part of the IRA.
1. The first and biggest find of arms imported from Libya in the mid 1980s - 100 AK47 and five medium machineguns were found at Five Fingers Strand in north Donegal, and the information came via an RUC informant in Derry.