An MI5 contractor passed on secrets to a foreign state in a bid to expose 'grievances' about the Security Service which he felt were being 'silenced', a court heard today.