Law enforcement sources tell TMZ ... Danny is under 24-hour video surveillance, and deputies come by his cell every 30 minutes to check on him ... with the goal of keeping tabs on his mental state and making sure he's safe.
Should Danny show any signs of mental distress or tell his team or a deputy about a mental health issue, we're told he would be taken for a mental health exam, STAT.
Danny's certainly got a lot on his mind. As we reported, he was sentenced Thursday to 30 years in prison after being convicted on 2 rape counts.
Shawn Holley, Danny's lawyer, tells TMZ ... the actor is mentally strong and feels confident his conviction will be overturned on appeal, based on his meetings with several top appellate attorneys.
Danny's already familiar with life behind bars ... as we first reported, he was kept in L.A. County Men's Central Jail for months as he awaited sentencing, staying in the same area as other high-profile inmates, including Suge Knight and O.J. Simpson.
Do you believe 30 years is a fair sentence for Danny Masterson? Share your thoughts by answering the question in our game below.