The Truth Machine (1996) is a science fiction novel by James L. Halperin about a genius who invents an infallible lie detector.
The novel primarily focuses on the life story of Randall Peterson "Pete" Armstrong, a child prodigy with total recall memory, whose entire life's outlook has been defined by the tragic murder of his younger brother, Leonard, by an ex-convict who was believed to be capable of committing violent crimes again, but could not be imprisoned any longer under the current law structure.
In his first year at Harvard at the age 13, Pete is recruited to enroll in a small, but exclusive, class of the brightest and most agile students on campus.
As long as it is employed universally (and not just by government officials), the 'truth machine' could revolutionize humanity and take it to that next evolutionary step which would help it avert its coming self-destruction.
The protagonist places a back door in the book's otherwise infallible lie detector, allowing him to avoid detection when he repeats fragments of Walt Whitman's poem "O Captain!