Riots and escape plans occur when your prisoners are not properly attended. Some of their needs could require more assistance. You can improve their stats by upgrading objects in cells, improving the courtyard, building more showers, etc. Pay attention to the dialog windows and object descriptions to change your strategy: each in-game feature provides different improvements in your overall stats. Don't forget to hire the proper amount of employees according to the number of prisoners your prison could attend.
However, riots or escape attempts could happen randomly, or provoked by your special prisoners, who will bring some instability thanks to their leadership skills. You need to make sure that your premises are well guarded and attended during the growth process. Sometimes these things happen!

The team is taking players' feedback into consideration to refine this feature. Stay tuned to know new changes in future updates!