A preening egotist accused of leaking government documents and under threat of extradition takes refuge in the London embassy of a South American country ... does the premise of new political comedy Asylum sound familiar?

Well yes, it’s no surprise that since the much-anticipated BBC4 show was announced last year, it has been talked about as “the Julian Assange sitcom”, even if the main character has neither white hair nor an Australian accent.

Asylum was devised by Kayvan Novak (of Fonejacker fame) and producer Tom Thostrup, and Novak acknowledges that the WikiLeaks founder’s situation – he’s been living at the Ecuadorian Embassy in London since 2012 – was his main inspiration for the three-part series. But he says the initial spark came when American Edward Snowden, who leaked highly sensitive information while working for the National Security Agency in 2013, tried to claim asylum in Russia and spent 39 days at Moscow airport as a diplomatic wrangle unfolded.

Ben Miller as Dan Hern and Dustin Demri-Burns as Ludo (BBC)

“I thought there’s a trend of these whistleblowers getting stuck in various situations,” Novak says, “and a Julian Assange-like character in an embassy being used as a pawn between America and everyone else could be hilarious. I’d never done anything political or zeitgeisty before – I’m more a funny-voice and pranking people on the street guy – but this felt like something that could be current in its subject matter and also make for some classic comedy.”

Did he and Thostrup consider making the lead character the actual Assange? “There was a debate about that,” says Novak, “but in making Dan not Assange, we could torture his ego by making him somebody who wants to be as notorious as Assange but never can be. And that way we didn’t have to cast a white-haired Australian guy ....”

Dan, who has been living in the embassy’s broom cupboard for a year after revealing CIA torture, is played by Ben Miller (of sketch duo Armstrong and Miller); he describes the starting point for his characterisation as “a mishmash” of Assange and Snowden.

“They’re intriguing people,” Miller says. “I watched their interviews and Snowden’s awkwardness is as fascinating as Assange’s assuredness, but I tried to find something of them in myself, and that was [to do with] ego. As someone on telly who has a bit of fame it would be easy to turn into a megalomaniacal monster, so you have to keep your ego in check.”

The best TV to watch in 2015 Show all 13 1 /13 The best TV to watch in 2015 The best TV to watch in 2015 Game of Thrones Sky Atlantic, April HBO The best TV to watch in 2015 Poldark BBC 1, March BBC The best TV to watch in 2015 Fortitude A murder mystery set in a close-knit Arctic Circle community, with an impressive ensemble cast -Sky Atlantic, January Sky Atlantic The best TV to watch in 2015 Banished BBC 2, March BBC The best TV to watch in 2015 Ordinary Lise BBC 1, March BBC The best TV to watch in 2015 Life in Squares Phoebe Fox, James Norton and Lydia Lynch in ‘Life in Squares’ BBC The best TV to watch in 2015 Wolf Hall BBC2, January BBC The best TV to watch in 2015 Better Call Saul Netflix, February Netflix The best TV to watch in 2015 Mel & Sue chat show ITV, January Princess Productions The best TV to watch in 2015 Mad Men, Series 7, Part II Sky Atlantic, Spring ©Lionsgate The best TV to watch in 2015 Dementiaville This series of documentaries explores both the heart-breaking experiences of those with dementia and a ground-breaking new approach to their care - Channel 4, Summer Georgie Scott/Age UK 2013 The best TV to watch in 2015 Morning Has Broken More than a decade since Nighty Night established Julia Davis’s reputation for caustic character comedy, she’s back with a new creation on Channel 4 BBC The best TV to watch in 2015 Cucumber/Banana Sixteen years after Queer as Folk, Russell T Davies returns with two interlinked series about gay life in Manchester on Channel 4 c.Showtime/Everett/REX

Does he like Dan? “No!” he says, laughing. “He’s pedantic and irritating and he’s quite a dislikeable person, even if his cause is a noble one.” Novak – who appears in Asylum as the ambassador’s slippery, manipulative son – handed over the writing to duo Thom Phipps and Peter Bowden because, he says: “I’ve never sat down and written jokes. I wouldn’t know how to.” And they’ve done the premise justice, creating a pacy, subtle and very funny political satire. “We wanted to flesh out a personal story – of how whistleblowers cope when they suddenly find themselves in the spotlight,” Phipps says, “that fits into a much bigger picture of global politics, democracy and abuse of power.”

Much of the comedy comes from the introduction of Ludo Backslash, who is broadly based on German-Finnish internet entrepreneur Kim Dotcom and is played by Dustin Demri-Burns, one half of sketch duo Cardinal Burns. An irritating young hacker wanted by the authorities for setting up an illegal file-sharing website, he is also claiming asylum at the El Rican Embassy.

Much to Dan’s consternation and increasing fury, the two men are forced to share his tiny room, now equipped with bunk beds. “Very broadly it’s an odd-couple comedy,” says Phipps, “but we were keen not to make it like a flat-share sitcom – Dan and Ludo don’t argue about doing the washing-up, for example. Ludo is just this annoying upstart who steals Dan’s thunder.” As the ambassador’s daughter (Yasmine Akram) says of Dan: “Last year he was hot s**t. Now he’s room-temperature s**t. Which is s**t.”

Much of the comedy comes from the introduction of Ludo Backslash played by Dustin Demri-Burns (left) (BBC)

“Without being too grand about it, there’s something existential about their situation,” Miller says.

“You can’t go back, you can’t go forward and you can’t leave. But for me the most extraordinary thing is that this is really happening. You can go and stand outside the Ecuadorian Embassy – as I did – and Assange is actually in there.” Ludo is the polar opposite of the beige-cardigan-wearing Dan; profits rather than politics have brought him to the embassy and he wears eye-wateringly garish clothes. Demri-Burns describes him as “an idiot”.

“This guy has spent years in his bedroom writing code and suddenly has been given a lot of money, and now hangs around with celebrities …. You can’t buy style or taste but somebody like Lady Gaga has told him to wear this hat, or this T-shirt. He just throws it on because it’s bright and expensive. It’s his equivalent of bling.”

I ask if they take a personal view on WikiLeaks and Assange, who still faces a rape charge – which he strenuously denies – in Sweden. Novak and Demri-Burns demur, and Phipps offers a hesitant “I think WikiLeaks is great but I’d be very careful to distinguish the man from the organisation”, while Miller says: “I’m a great supporter of WikiLeaks and I think it’s laudable to protect the public interest.”

Raphael Castillo played by Kayvan Novak (BBC)

WikiLeaks has objected to Asylum – without seeing the show – and Miller sees the unintended irony of their position. “On one hand I’m a supporter of WikiLeaks but on the other they didn’t want our programme to be made. But we can’t just suppress the things we don’t like, we have to allow it all.” Novak, meanwhile, says drily: “I’d remind them this is a fictional character who in many ways wants to be Assange. They should take that as a compliment.”

Asylum is being shown as part of the BBC’s Taking Liberties season, which is an examination of the state of democracy to mark the 800th anniversary of the Magna Carta, but everyone involved in the three-part series is keen to continue. “Perhaps we can have a revolving door of characters who want to live in the embassy,” jokes Novak.

Miller says he’s very proud to be part of the season. “The Magna Carta is fundamentally about freedom and one of the great things about the BBC is that it informs political debate in this country in a way that doesn’t happen almost anywhere else. It’s almost part of our democratic system in that it provides this unbiased news source about politics. It’s an extraordinarily valuable thing.”

Asylum follows in the same rich vein of clever political satire as The Thick of It and Veep (which the creatives are all fans of), and our conversations take place in the aftermath of the Charlie Hebdo murders. As Miller says, Asylum and its counterparts serve to remind us that: “Comedy – and satire in particular – is often saying the unsayable. We should be grateful to live in a country where we can make jokes about people even when they don’t like it.”