The main character is a one-hundred-year-old woman, Roseanne McNulty, who now resides in the Roscommon Regional Mental Hospital. Having been a patient for some fifty years or more, Roseanne decides to write an autobiography. She calls it "Roseanne's testimony of herself" and charts her life and that of her parents, living in Sligo at the turn of the 20th Century. She keeps her story hidden under the loose floorboard in her room, unsure as yet if she wants it to be found. The second narrative is the "commonplace book" of the current chief Psychiatrist of the hospital, Dr Grene. The hospital now faces imminent demolition. He must decide who of his patients are to be transferred, and who must be released into the community. He is particularly concerned about Roseanne, and begins tentatively to attempt to discover her history. It soon becomes apparent that both Roseanne and Dr Grene have differing stories as to her incarceration and her early life, but what is consistent in both narratives is that Roseanne fell victim to the religious and political upheavals in Ireland in the 1920s – 1930s.
The novel was inspired by a story told to him by his mother of an old relative – "We were driving through Sligo, and my mother pointed out a hut and told me that was where my great uncle's first wife had lived before being put into a lunatic asylum by the family. She knew nothing more, except that she was beautiful. I once heard my grandfather say that she was no good. That's what survives and the rumours of her beauty. She was nameless, fateless, unknown. I felt I was almost duty-bound as a novelist to reclaim her and, indeed, remake her." The story also ties in with previous novels by Barry, especially The Whereabouts of Eneas Mcnulty, the title character being a brother in law to Roseanne McNulty.
It won the James Tait Black Memorial Prize, one of the most prestigious English literature prizes and the oldest prize in the United Kingdom.
The novel won the Book of the Year at the 2008 Costa Awards,. This was despite the misgivings of the jury, one of whom, Matthew Parris said "They agreed that it was flawed, and almost no one liked the ending, which was almost fatal to its success"
At the Irish Book Awards, it won "Novel of the Year" and the Choice Award.
It was shortlisted for the Man Booker Prize for Fiction, narrowly losing to The White Tiger
In May 2008, the novel was adapted and abridged by Neville Teller for BBC Radio 4's Book at Bedtime with Doreen Keogh and Alex Jennings voicing the roles of Roseanne and Dr. Grene, respectively.
A film version also titled The Secret Scripture, directed by Jim Sheridan and starring Rooney Mara and Vanessa Redgrave, is in post-production. Filming began in January 2015 in Dublin with scenes shot in Dollymount Strand and Portrane Beach. In February, filming moved to Inistioge, County Kilkenny. Filming completed on March 6. Other stars include Eric Bana and Theo James as well as Irish natives Jack Reynor, Tom Vaughan-Lawlor, and Aidan Turner.