MI5’s National Protective Security Authority issued the warning to MPs, peers, councillors, candidates and parliamentary staff.
The Conservative peer and Spectator editor had challenged the Labour front bench over the decline in the number of teachers in state education.
Security minister Dan Jarvis said the Government made every effort to support the prosecution of alleged spies.