In Falcrest, in the Metademe, they condition prisoners just so: permit escape. Offer a rescuer, a collaborator. Slip a key in with the food. Let them come close to freedom, let them feel real triumph -- they would not let me this far! This is the crux: And then snatch it away. The collaborator betrays them. the key will not open the outermost door.
With enough repetition, most prisoners learn to ignore a key, an open door, a whisper to run. Led out onto the street, they will wait to be returned to their cells.
After a time, they begin to teach new prisoners the same.