Imagine a dictator who owns a massive prison. The tech level is 12th-15th century, and the dictator has very few guards at his disposal. The prison already has all necessary resources such as food and water dispensed from vending machines, which use coins. Coins are obtained by doing work, such as carrying stones or building things. Unfortunately, with so few guards, none can be spared for this prison as they all work somewhere else.
Now, I suspect there's a way that some sort of economy in the camp based on the population of prisoners would be able to make the prisoners guard themselves. If one of them runs away, they are somehow punished. You can handwave how the vending machines that provide resources work, but assume they can know how many prisoners there are and calculate things like cost.
So, what would be an effective method of accomplishing this? You can divide up the prisoners any way you wish, and assume the "prison" is a massive camp, taking up several dozen acres with a large building for sleeping/housing the vending machines. The walls can be set up however you wish.