Confinement is the state of being forced to stay in a prison or another place which you cannot leave.
She had been held in solitary confinement for four months.
她曾被单独关押了4个月。