Judge Michael Topolski said the man, known only as Kamal, had displayed "considerable resourcefulness and even greater courage", according to a BBC report.
ISIS cell leader, Mohammed Alamgir, 37, was jailed for six years for inviting support for the terror group at the Old Bailey court in London this week.
Speeches made by Alamgir and four other persons in Luton in the east of England were secretly recorded by the undercover officer.
While sentencing, the judge said, "You are in my judgment deeply committed to an extreme and violent jihad mindset. You are in that sense a dangerous man".