Interesting situation came up in my session. The players captured a wizard NPC and put him in jail. Then came a long discussion about what measures needed to be taken in order to prevent said wizard from using spells to force his way out.
Basic measures like removing a spell book, holy/arcane focus, and spell components would prevent use of any spells with a material component. A gag would stop verbal spells and being bound would stop somatic spells. However this is an unsustainable level of treatment for a jail for more than a day or so since it would have to be applied to ALL prisoners since there is no easy way to tell who can cast and who can't.
Preventing a long rest would severely handicap most casters in that it would prevent recovery of spell slots/sorcery points, although a warlock wouldn't be affected. Seems like a basic precaution to not allow prisoners long periods of rest. But this doesn't affect unused spell slots and no character class, from what I can tell, "loses" spells if they don't perform some sort of ritual each day (they just can't change their prepared spells if applicable), even the wizard. So unless a caster is tapped out on spell slots/sorcery points before being jailed, they would always retain what they have left even if denied a long rest (and would still have cantrips).
So, apart from being tightly bound, gagged, and stripped, are there any ways to prevent casting that I'm missing?
There are plenty of verbal only spells that would be useful in a jail environment (Command, Knock, Misty Step) so really, how are casters supposed to be locked up other than some sort of dedicated magicked prison (assuming you could even transport them there)? Just taking out the gag to feed them opens up the possibility of a spell being cast. I don't want my characters to have to be treated like this if they get jailed, but it seems like in a world of scarse magic items but numerous magic wielding people, anyone not KNOWN to be non-magic using would be treated like Hannibal Lecter or put in an Arkham Asylum type specialty prison (bad example, folks escape from there all the time! Maybe the one from Harry Potter).
My homebrew solution is to have the higher levels of exhaustion stop casting. This way someone who has been in a jail for more than a few days can't cast due to poor conditions, poor food, etc. But they can still move around a bit and talk, so there are role playing possibilities (barter for more food, become prison kingpin to get better treatment, bribe a guard, etc). When captured maybe casters could be bound and gagged, but it wouldn't be necessary for long term imprisonment.
I'm using the basic vanilla forgotten realms setting with the suggested "low magic item availability" from the 5e PHB and DMG. Judging from the published campaigns I've read (Phandelin and Horde) there does not seem to be common availability of magical effects and devices. Party level is 5-9th level.
The answers to the previous setting-free question How could towns restrain a magic user? has plenty of useful "soft" suggestions like archers on the roof. But I would like some 5e and Forgotten Realms-specific techniques.