In Philip Dick's book TIME OUT OF JOINT, published in 1959, the main character slowly realizes that he is living in a world that is artificially constructed just to keep him captive within it. He had been a revolutionary figure in a space rebellion, and now he was being used by the military to solve puzzles that predicted attacks from the rebels. The puzzles were part of the artificial environment. All the people he interacts with are actors, and he cannot escape because (at least before his discoveries) he has no knowledge that he is being held captive.
This very same idea was used for the plot of the 1998 Peter Weir movie THE TRUMAN SHOW, where the main character's entire life has been lived in a constructed reality TV environment. It also has echoes in the "Matrix" trilogy. The basic idea for this comes from Gnosticism, which believes that the "real world" is a malignant illusion, constructed by evil entities, in which we are held captive, and only the Knowledge ("Gnosis") will set us free from it.
"Time Out of Joint" was a Gregg Press frontispiece published in 1979. Original art is ink on illustration board, 7" x 10", winter 1979.