Catherine Fisher is the amazing author of Incarceron and the sequel, Sapphique. Here's a summary to get you interested if you haven't read the book yet.
§ Incarceron Incarceron is a prison so vast that it contains not only cells, but also metal forests, dilapidated cities, and vast wilderness. Finn, a seventeen-year-old prisoner, has no memory of his childhood and is sure that he came from Outside Incarceron. Very few prisoners believe that there is an Outside, however, which makes escape seems impossible.
And then Finn finds a crystal key that allows him to communicate with a girl named Claudia. She claims to live Outside- she is the daughter of the Warden of Incarceron, and doomed to an arranged marriage. Finn is determined to escape the prison, and Claudia believes she can help him. But they don't realize that there is more to Incarceron than meets the eye. Escape will take their greatest courage and cost more than they know.
Read the description of Sapphiquehere. (Contains spoilers for Incarceron.)