Actress will take role of Katharine Gun, who leaked an email to the Observer about US spying plans, in new film

Her story has been all but forgotten in the years since the 2003 Iraq war ended, overshadowed by more recent, flashier tales. Now a new film, starring Keira Knightley and Matt Smith, will put GCHQ whistleblower Katharine Gun back in the spotlight – and in doing so ask audiences the question: where do your true loyalties lie?

“I found Katharine’s story fascinating,” says director Gavin Hood, known for the Helen Mirren thriller Eye in the Sky and the acclaimed South African crime drama Tsotsi. He will begin filming Official Secrets in March, with a planned release date later this year.

“It’s a story that has largely been overlooked. Even in the recent Iraq inquiry, which was otherwise very thorough, she was not called to testify. Katharine’s story is a very important piece of the Iraq war puzzle and one which has been missing for too long.”

Gun, 28 at the time, was working as a Mandarin translator at GCHQ, the British government’s communications HQ in Cheltenham, when she leaked a confidential US National Security Agency email to the Observer. The memo, a single sheet of paper, asked her and her colleagues to help the US government spy on UN security council delegations in New York. The belief was that doing so would help the US and UK governments to swing wavering countries in favour of a planned invasion of Iraq.

The story, one of the most important and delicate in the history of the Observer, ran even though the paper had controversially taken a pro-war stance weeks earlier. It cost Gun, who now lives in Turkey with her husband and daughter, her job. She was subsequently arrested and charged under the Official Secrets Act.

Former Observer reporter Martin Bright, who broke the story along with his colleagues Ed Vulliamy and Peter Beaumont, said: “The story of Katharine Gun, her bravery, and her preparedness to stick her neck out when almost nobody else would, has become one of the forgotten stories of the Iraq war, so I’m delighted that we’re finally going to be able to pay tribute to her courage.

“I’m not sure that anyone when they first decided to leak knew what the consequences would be, but the British state comes down very hard on people who leak official secrets. Katharine faced a double cruelty in that she was pursued by the state for the best part of the year and then was unable to call those responsible to account. Hopefully this film will go some way to addressing that.”

Official Secrets also marks a rare contemporary role for the 32-year-old Knightley, who recently told the US trade magazine Variety that she didn’t “really do films set in the modern day because the female character nearly always gets raped” She said that she was, however, interested in modern scripts where women weren’t “there to be the loving girlfriend or wife”.

“Keira’s presence in this movie is indispensable in terms of star power,” says Hood of the long-planned project, which was previously set to star Natalie Dormer and had Justin Chadwick attached to direct. “I take it as a huge compliment that she has agreed to do this film. She really responded to Katharine’s bravery and strength of character.”

Facebook Twitter Pinterest Katharine Gun at Bow Street magistrates court in 2003 after being charged with breaching the Official Secrets Act. Photograph: Martin Godwin/The Observer

Some recent films about whistleblowers, such as The Fifth Estate (2013), starring Benedict Cumberbatch, and Oliver Stone’s Snowden (2016), have flopped at the box office. Hood, who spent hours talking to Gun, her lawyers and the journalists involved, in addition to working from an early script by Gregory and Sara Bernstein, prefers to invoke comparisons to classics such as Silkwood (1983), The Insider (1999) and All the President’s Men (1976). There are echoes, too, of films such as In the Name of the Father (1993), with their emphasis on the unequal fight between an ordinary individual and the government machine.

“Katharine is an extraordinarily loyal person, who still considers herself bound by the Official Secrets Act,” Hood says. “She didn’t simply dump a tranche of information but instead felt compelled, as a matter of necessity, to leak one particular document as evidence of a deep corruption that was likely to lead the world into an illegal war.

“Her story is about so many different kinds of loyalty: loyalty to your personal conscience, your family and relationships, your government, your country, which does not necessarily equate to the government, and to greater humanity in general. It’s a story that asks: is it possible to serve all those loyalties at the same time? And what happens when you have to make a choice? It’s also a very personal tale about relationships and how much a marriage can take.”

Hood gives nothing away about what else viewers of Official Secrets can expect, beyond noting that it follows Gun and Bright as they deal with the fallout from the leak. “I will say that I don’t think it’s a film with a downbeat ending,” he says.

“It’s a thriller and a mystery and there are some interesting reveals along the way. Ultimately, it’s a movie for grown-ups which I hope will intrigue people and inspire them and, most of all, lead to great debates when they leave the cinema.

“I want people to be saying: ‘What would you have done? Would you have done that?’”