Julian Assange and Alex Gibney seem natural allies. Both are committed to divulging secrets and exposing abuses. Both have a track record of confronting powerful institutions. But as neither takes kindly to criticism, it was always likely that We Steal Secrets, Gibney's documentary about WikiLeaks, would lead to recriminations.
The film, which opens in Australia next week, has inspired so much invective that its true subject - the importance of a secure haven for whistleblowers in an era of unprecedented clandestine surveillance - is in danger of being overshadowed.
Gibney has laid bare corruption in the Catholic Church, torture perpetrated by the United States military and fraud on an epic scale at Enron. WikiLeaks has revealed corporate venality, military atrocities and the lies that governments tell to justify and sustain wars.
At the start of the film, Assange is asked by an interviewer what drives him. After describing the appeal of devising systems to overcome technical challenges - the hacker's thrill - he explains that he likes "crushing bastards". Is this a just cause, in and of itself? "It depends on the bastard."
As with all the footage of Assange in We Steal Secrets, this is archive material. No current members of WikiLeaks took part in the documentary. Assange and Gibney were in negotiations for months, culminating in a six-hour meeting at the Norfolk mansion where Assange lived for a year as a condition of his bail while fighting extradition to Sweden to face possible rape charges. In voiceover, Gibney claims that Assange asked for a million dollars - an accusation denied in an annotated transcript of the film published online by WikiLeaks.
"He spent a lot of time talking to me about how unjustly he'd been treated. He was going on and on about the people who have betrayed him," says Gibney. Although he concedes that he has much in common with Assange - "I wouldn't use the word crush, but exposing bastards is definitely one of my interests" - the experience evidently created a degree of animosity that found its way into the film, then carried over into the bitter exchanges that followed.
Gibney portrays Assange as a paranoid egotist with an obsessive need for control. The first two-thirds of We Steal Secrets is full of voices sympathetic to WikiLeaks and its mission, but the last third is a parade of former friends criticising Assange. In particular, the film suggests that by conflating his own legal struggles with those of the organisation and adopting a "with us or against us" mentality, he has alienated so many supporters that WikiLeaks is near collapse.
In response, WikiLeaks spokesman Joseph Farrell described Gibney as "just another one in a long list of people trying to cash in on Julian and WikiLeaks", and attacked the credibility of the film's contributors, including Guardian journalists Nick Davies and James Ball, former WikiLeaks member Daniel Domscheit-Berg and ex-hacker Adrian Lamo, who turned Bradley Manning over to the US authorities after he confessed to leaking classified documents.
Jemima Khan, who was once one of Assange's most high-profile supporters, has become a prominent critic, writing in the New Statesman that unless he learns to tolerate dissent, he risks becoming "an Australian L. Ron Hubbard" - a comparison with the Church of Scientology that did not go down well with her old friends at WikiLeaks. "There has been a backlash," she says. "But I'm quite used to aggressive backlashes generally. I lived in Pakistan for 10 years [as the wife of cricketer turned politician Imran Khan] and every time an election came up the opposition would label me a Zionist conspirator, or a Hindu fundamentalist, or a Salman Rushdie fan. I've got quite a thick skin now."
In December 2010, after reading that Assange had been arrested on suspicion of rape, Khan appeared in court to post bail, even though she had never met him. WikiLeaks had just published diplomatic cables showing that Pakistan's Prime Minister had given tacit approval to US drone strikes on Waziristan, confirming lies and double-dealing that Khan had long suspected.
When Assange jumped bail last September and applied for asylum at the Ecuadorian embassy in London, Khan lost her money. She won't say how much, but the total surety was $330,000 and she was one of the biggest contributors. "I wanted him to be able to continue his work and he couldn't do that in solitary confinement," she says. "So no, I don't regret it."
WikiLeaks supporters have suggested that by working on Gibney's film as an executive producer and defending it in print, Khan is attempting to make good that loss and extract some measure of revenge. "The reaction has been so hysterical, but I think that Assange reacts that way to any project that he hasn't had total control over," she says. "Assange operates the WikiLeaks Twitter account, and a lot of the hysteria emanates from that."
When I first discussed We Steal Secrets with Gibney in February, he mentioned that veteran Australian journalist John Pilger had written a scathing article alleging bias, even though he had not seen the documentary, which had just premiered at the Sundance Film Festival. I asked him how he knew that Pilger hadn't seen it - it is about WikiLeaks, after all, so it wasn't implausible that he had got his hands on a copy. "He hasn't seen the film," Gibney replied firmly.
It turns out that Pilger had read a transcript, minus Manning's instant message chats, which appear as text on screen. "Its very title, We Steal Secrets: The Story of WikiLeaks, was a gift to the fabricators of a bogus criminal indictment that could doom [Assange] to one of America's hellholes," Pilger wrote, noting that the quote in question is snipped from an interview with General Michael Hayden, who led the Central Intelligence Agency under President George W. Bush.
WikiLeaks does not "steal" secrets, he pointed out, it provides a secure, anonymous platform for people to share them.
Gibney responded with a livid editorial. "How sad," it began. "John Pilger, who once had a claim to the role of truth-teller, has become a prisoner of his own unquestioning beliefs." He now says that he regrets losing his temper - "I got angry, because I felt that his argument was politically motivated and not much connected to the facts" - but insists that Assange's supporters underplay the seriousness of the rape allegations and overstate the chances of him being extradited to the US from Sweden.
Khan concurs. "The idea that the Swedish case is some kind of conspiracy to get him to America, I don't agree with," she says. "It looked like that, at the beginning, but every day that he doesn't go to Sweden to face the charges, it damages WikiLeaks."
Assange now says even if the Swedish prosecutor dropped the case, he would not leave the embassy for fear of being extradited. Prominent American politicians have called for him to be treated as an "enemy combatant", subject to extraordinary rendition. Others have called for his assassination, only half in jest. A grand jury is investigating the possibility of bringing criminal charges against him, although as its deliberations are secret, there is no proof that a sealed indictment exists.
"Claims are made that there's definitely an indictment against Assange, and there's no evidence of that," Gibney says. "Was there animus towards Assange from the US government? Definitely. Is there an ongoing grand jury proceeding? Yes, but people tell me it's running out of gas. They have a problem, which is how do you distinguish WikiLeaks from The New York Times or the Guardian."
The Obama administration's unprecedented clampdown on whistleblowers - more than twice as many prosecutions as all previous presidents combined - leaves little room for doubt that it would get Assange if it could. "It's possible that he could be extradited there," Khan admits. "I think that's when all those former allies who have been alienated by him over the last couple of years will come out in his defence."
Bradley Manning, who is presented as a heroic figure in We Steal Secrets, his leaks an act of conscience, might question how much the liberal media's sympathy is worth. If he is convicted of aiding the enemy at his ongoing court martial, he faces life in prison.
There's a telling section in We Steal Secrets that recounts how Assange's media partners turned on him. Bill Keller, the New York Times editor who published the Afghan War Logs in collaboration with WikiLeaks, is shown at a discussion panel. Confronted with language he used about Assange in a snide editorial - "eccentric, elusive, manipulative, volatile, openly hostile, coy, an office geek, derelict, arrogant, thin-skinned, conspiratorial and oddly credulous" - all he can do is grin.
Pilger argues that Gibney is trying to have it both ways, by presenting Keller as a hypocrite without acknowledging his own hypocrisy. "Julian Assange excites a jealousy among certain journalists with inflated reputations because he refused to be 'one of us' - he was unclubbable, he wouldn't play the game," he says. "And WikiLeaks' disclosures demonstrated clearly that many journalists in the so-called mainstream had not been doing their job - that is, keeping the record straight, not merely amplifying authority and its vested interests."
The latest whistleblower to be psychoanalysed in the press is Edward Snowden: The New Yorker's legal analyst, Jeffrey Toobin, called him "a grandiose narcissist who deserves to be in prison". Politico's Roger Simon observed that he has "all the qualifications to become a grocery bagger", while veteran anchorman Tom Brokaw described him as "a high school drop-out who is a military washout". The vapid debate about whether Snowden is a hero or a traitor consumed several news cycles, a distraction from the real issue of whether a vast, impenetrable, all-seeing security state is justified in the name of preventing terrorism.
We Steal Secrets provides a reminder of the vital role WikiLeaks has played in bringing war crimes and cover-ups to light - the infamous images that Manning leaked of an American helicopter gunship mowing down civilians are no less shocking now than they were three years ago - but by the end, it is almost an elegy for Assange, holed up in a dingy room with his laptops and mobile phones. His role in Snowden's dramatic flight from the authorities this week, an unexpected coda to the film that is still playing out, shows this conclusion to be premature.
We Steal Secrets opens on Thursday.