Sir David Hare, a genial man who wears his knighthood lightly, could talk fluently and engagingly for England, Scotland or any other country that offered a flag of convenience.

He proves it over the course of an interview punctuated by laughter and waspish comments on every subject from Bafta and the BBC to his alleged Marxism and what he sees as a growing right-wing tendency in the arts. Only one question causes the 64-year-old playwright to falter at all: does he know any spooks, and did he meet with them while researching Page Eight, the spy thriller which receives its world premiere at the Edinburgh International Film Festival this week?

“I … I … I …” he begins before pausing. “I know a bit about what goes on inside MI5. Or I’ve been told a bit about what goes on inside MI5. But, on the other hand, for all I know, I’ve been misled.” Another snort of laughter. “They are spies after all. I mean, that’s the underlying theme of the film. It’s about trust. Who you trust and why and how you make decisions about trust.” So he does know some spies then? “Of course.”

Page Eight stars Bill Nighy, above right, as Johnny Worricker, a senior MI5 intelligence analyst who was recruited at Cambridge by his oldest friend, Benedict Baron (Michael Gambon). Baron is now head of the service and married to Worricker’s ex-wife. Elsewhere in the stellar cast are Saskia Reeves as the Home Secretary; Ralph Fiennes as the menacing, crop-haired Prime Minister; Ewen Bremner as a fast-talking journalist who sometimes works for Worricker; and Rachel Weisz, who plays Worricker’s neighbour Nancy Pierpan. Born in Syria to a famous Orientalist academic father, her peace campaigner brother was killed protesting in Israel’s Occupied Territories. Or so she says.

With those characters in play, Hare’s script turns on a classified document from a secret source whose eighth page suggests to Worricker that MI5’s political masters have been colluding in torture and that the service itself has been compromised as a result. As his doubts mount, the pressures on him increase. After the death of someone close to him, they redouble.

So much for the story. But underlying and supporting Hare’s fiction are some unpalatable realities.

“I know a little about what’s been going on inside MI5 in the last 10 years,” says the writer. “I’ve talked to various people about it and two things are topical. One is that the uses of intelligence have been corrupted, and I think that’s incredibly serious. Plainly in the run-up to the Iraq war the intelligence agencies were being asked come up with evidence which suited the Government’s case. To its credit MI5, if I believe what I am told, refused to do that, whereas MI6 went along with it and came up with all the stuff that went into the dodgy dossiers.

“Secondly, our allies have been torturing people. That’s been happening in many countries in the world. Now in this country, we’re not meant to use information which is gained by torture. So MI5 and MI6 have been faced with a problem, and so have ministers. The way they have dealt with it, by and large, is to try to turn a blind eye.”

That, he believes, raises “very real moral problems for us”.

“I don’t think the Government or the security services are being straight with us about what’s going on,” he says.

The spies he knows, he adds, “do see themselves as principled and moral people. They don’t see themselves as John le Carre represents them – hopelessly compromised and angry and bitter. They hope they’re cheerful and effective people who have some sort of moral compass. Now that moral compass has been very thrown in the last 10 years and they’re very upset about it, and I think the film is trying to represent that”.

While Hare has never strayed far from politics or film in a 40-year writing career that began with Slag in 1970, Page Eight does mark a return to directing duties after an absence of two decades. He last took that role in 1991 when he made Heading Home for the BBC’s Screen Two series. Prior to that, however, he had written and directed regularly for the Play For Today strand in the 1970s, most notably 1978’s Licking Hitler, which gave an early TV outing to Bill Paterson. In the 1980s he wrote and directed cinema films such as Wetherby, starring Judi Dench and Vanessa Redgrave; Paris By Night, with Charlotte Rampling and Michael Gambon; and 1989’s Strapless, which featured Bruno Ganz, Bridget Fonda and Hare’s then-partner, American actress Blair Brown. He is now married to fashion designer Nicole Farhi.

So why stop directing? “I didn’t think it was possible to go on doing both things – working in the theatre and doing something as time-consuming as directing movies. I thought I could only get good at doing one thing,” he says. “And whereas there are lots of people who are good at doing films, there are very few people who can write them.”

Besides, he found the 1980s British film industry a dismal, dispiriting, hierarchical place. “Let’s say the memory of David Lean was very strong,” he laughs. “Working practices were extremely rusty. It was hard work getting a team together and trying to make a radical film. It was against the mood of the industry. It was very conservative, as represented by Bafta and all those sorts of organisations, which in those days were incredibly crusty and reactionary and full of people who were more interested in playing golf than making films.”

So Hare continued to write screenplays, but with the intention of letting other people direct them. In this decade he has worked twice with Stephen Daldry – on Oscar-nominated pair The Hours (2002) and The Reader (2008) – and adapted his own play, My Zinc Bed, for television. A script he had written for a proposed film version of Craig Murray’s memoir, Murder In Samarkand, eventually found a home on BBC Radio 4 last year when it was broadcast as a radio play. Murray was formerly ambassador to Uzbekistan but protested about the use by MI6 and the CIA of intelligence gained by torture in that country. These themes resurface in Page Eight.

But of all the projects Hare undertook in his break from directing, the one which taught him the most was 1992’s Damage. It was helmed by French New Wave veteran Louis Malle, who would sit Hare down every morning and make him tell and re-tell the story they were going to film. It was an exhausting process which felt to Hare like a police interrogation. “But it meant that when it came to the actual writing of the script it was a doddle because you’d actually made the clothesline – putting the dialogue on was just hanging the washing out at the last minute. So working with someone who thought that thoroughly about a story was fantastic. That really transformed my life as a screenwriter.”

As well as marking Hare’s return to directing, Page Eight is also a rapprochement of sorts between him and the BBC, which part-financed the film and will screen it later in the year. Hare has criticised the corporation in the past for its lack of ambition and its concentration on news-gathering at the expense of original drama, once its calling card. But with a change of leadership at BBC Two – former BBC Four controller Janice Hadlow took over in late 2008 – he thinks the corporation is beginning to address the issue. “I think the days of lifestyle TV on a major BBC channel are over,” he says. “Thank God.”

The BBC is emboldened, he feels, by the success of programmes like Mad Men and The Killing, which show there is an appetite in the UK for complex, nuanced drama serials. Yet even here he urges caution. We can’t just imitate. “You absolutely dread that there’s going to be a 20-part British drama investigating one murder just because The Killing was so great. We’ve got to be more sophisticated. But I hope Page Eight is part of them trying to put more resources into drama.”

But although film, theatre and TV audiences lavish acclaim on Hare’s sophisticated fictions, there are those on the sidelines who lob insults and criticisms instead. Jewish playwright Arnold Wesker, for instance, who penned an open letter to Hare about his 1998 play Via Dolorosa, a monologue about the Israeli-Palestiniain conflict (though Hare describes it to me as “pretty even-handed”). Others on the political right take him to task for (among other things) his perceived champagne socialist lifestyle and his plush redoubt in literary Hampstead. Last week a Daily Telegraph columnist described him as “an unreconstructed Leftist, possibly a Marxist”.

A fair cop? “I don’t think so,” he snorts. “I was never a Marxist. That’s just complete nonsense. The reason I had such an incredibly hostile ride from the press in the early days was because they couldn’t pin it on me.”

The Marxist jibe was itself a reaction to Hare’s recent claim that the arts in Britain are now showing a pronounced right-wing bias. Does he stand by that? He does. “I think there is a very, very right-wing atmosphere.” Look at the Royal Wedding, he says, look at Downton Abbey, the Terence Rattigan revival and a Conservative-led Government which thinks Britishness means “everybody knowing their place”. We may laugh at the narrow-minded 1950s, but, he says: “We’re living through a time just as narrow-minded and unadventurous, politically, economically, culturally ... the judgements passed in the newspapers about culture at the moment are just so philistine and boring.”

With plenty of talking – and writing – left in him yet, those are two words nobody could ever apply to David Hare.

Page Eight has its world premiere at the Edinburgh International Film Festival on Saturday and Sunday. It will screen on BBC Two later in the year.