Chris Andrew, president of Corpus Christi college and Cambridge's professor of modern history, has just taken the Queen's shilling - actually worth about £40,000 a year - and become a part-time spook. His operational activity for the security service, MI5, will be limited to devilling in the archives and conducting interviews with retired staff, but nonetheless heavy folds of state secrecy will fall round the shoulders of a scholar normally dedicated to shining a light on dark places.

And that aspect of Professor Andrew's commission as official historian of M15, writing a "warts and all" history in time for its centenary in 2009, worries some of his academic colleagues. History, they say, is a critical discipline. You keep a fellow historian on the straight and narrow by the threat that she or he would be found out if colleagues checked the same archives and disputed the evidence. That is what Andrew's Cambridge colleague Richard Evans, the regius professor, did so memorably in the case of David Irving and his allegations about Hitler, the Nazis and the Holocaust.

For many historians, the unparalleled access Professor Andrew will have is worth donning a cloak, sporting a dagger and accepting some limitations. The big story about British intelligence, in other words, is worth a measure of silence on MI5 procedural details and personnel. According to Evans, it all depends on the terms set. "Chris Andrew is a consummate professional; he already knows more about MI5 than anyone else in the world. Besides, the word 'official' is an open invitation to be on the lookout for whitewashing."

One or two have their doubts. Anthony Glees, of Brunel University - like Professor Andrew, one of the small, but growing band of specialists in intelligence and security in British universities - says that it is a "strong principle of a free society that the people who write its history should be entirely free and unfettered. I don't think governments should write their own history. Academics should not become ambassadors or politicians, or work for the secret service." Glees was himself a candidate for the official historian's job.

After 30 years, domestic Whitehall departments, including the Ministry of Defence, are required to release their papers to the Public Record Office and hold documents back only in strictly defined circumstances. The rule is inverted for security and intelligence: they have blanket approval to hold everything back for ever, but may choose to release material when they think fit. That is why the MI5 paper trail is so coveted by historians.

To be fair to the security services, that trail of material released into the public domain has been thickening. Some think we probably now know as much about the pre-second world war activities of M15 as we are ever likely to know. There are few bulging files yet to be uncovered. Much material has been published on intelligence and special operations during the second world war. But Professor Andrew will get to feast his eyes on the intelligence treasures (and scandals) of the period since 1945, Philby, prime ministerial bugging and all. Was Harold Wilson right when he said he was the object of a concerted campaign by intelligence agents? Was renegade agent Peter Wright right? Professor Andrew's inquiries will stop well short of allowing us to gauge the truth of the claims made by MI5 operative David Shayler, jailed last November for breaches of the official secrets acts.

What he is going to write, says one rival specialist, is less an official than an internal history. "Chris has become a sort of court historian. They picked him for Gordievsky then for Mitrokhin" - references to Professor Andrew's collaboration, with security service sup port, in writing up the tales of Soviet defector Oleg Gordievsky and KGB renegade Vassili Mitrokhin. He published volume one of the Mitrokhin archive four years ago. There are fears among fellow historians that Professor Andrew has got too close to the security service. "It looks like Professor Andrew has been singled out and rewarded by the security service," says one.

Professor Andrew responds that such fears ignore the dialectic of his discipline. "Posterity and postgraduates are breathing down my neck. I tell my PhD students: I know you can only get on in the profession by assaulting teachers. You are not going to make a reputation by saying 'Look, Professor Andrew was right all along the line'." Sooner or later, MI5's files are going to be open to others to inspect. He has to get it right, for his own name's sake.

Besides, there is nothing new in historians submitting themselves to vetting. Professor Richard Aldrich, an intelligence historian at Nottingham university, notes that others who have dealt with national security, defence and nuclear histories have been "positively vetted" - subjected to special background checks by Special Branch and the security service.

On one level, Professor Andrew's appointment is a remarkable sign of how an anally retentive institution has loosened up. At the end of his path-breaking unofficial history, Secret Service: The Making of the British Intelligence Community, published in 1985, he fantasised about intelligence becoming mentionable in parliament, a security scrutiny committee and a peacetime history of British intelligence. Those "unacceptable propositions" have now come to pass, along with the official outing of MI5's chief, currently Eliza Manningham-Buller.

Intelligence history is now a thriving sub-discipline, with about 50 practitioners in the UK - mustering more than enough expertise, says Professor Aldrich, to know whether the wool was being pulled over their eyes. "We are trained to be sceptical about intelligence documents. We are hyper-tuned to their authenticity."

But for all that the historian who gets first cut does have the chance to influence thinking for many years, and that is Professor Andrew's privilege. "He has a reputation for belonging to the 'ho ho' school," says a fellow historian. "His Mitrokhin book served a key function for both MI5 and the Secret Intelligence Service [M16] by making it seem like a great British intelligence success."

But some historians dispute that official historians are unconsciously inclined to apply white paint. The beauty of doing an official history of the security service now, says Professor Aldrich, is that it will allow Professor Andrew to identify and interview agents and personnel as well as combing the paper archives - talk to them, he means, before they die. Chris Andrew notes sadly how he would have loved to talk to the late Roy Jenkins who, as home secretary in the 1960s and 1970s, had ministerial responsibility for MI5.

Yet even Professor Aldrich wonders if the interests of history might not have been better served if MI5 had chosen to let a team of historians have access rather than a single writer. The official history of the second world war, edited by Harry Hinsley, won applause because it was a plural, multi-skilled effort. How can we properly "do" MI5 without bringing to bear specialist knowledge of the rest of Europe, especially the eastern bloc countries, or Irish nationalism - to cite a preoccupation of the security service for the past 35 years?