Hey Bigurn,
That number you see top left are the # idle guards/total guards. For ex 20/100. These are the guards that you see over in various places like deliveries just waiting for something to do.
Just like patrols/deploying a guard to a sector, they will eventually become exhausted of operating the machine & seek a staff room(will recover energy w/o staff room but will be significantly slower). Not much you can do to stop them from leaving. I found that putting a staff room in the same area as the security room will help them get back to their routine quicker.
PS: Things like this make me miss the deployment scheduler from PC. Your able to setup like 9 different shifts, each with different guards stationed at various places based on prison regime. I really hope they bring it to console because it helps keep all your guards in top notch shape by working in shifts. D11 plz