The phrase we often hear here is "detained at her Majesty's pleasure"

Thanks for clearing that up, Rod. Here in NZ we have a sentence called preventive detention, an indefinite sentence, allowing the authorities to incarcerate the recipient of that sentence for as long as they see fit. It is easily the harshest sentence available here, and seldom used. I had always assumed that the phrase you mentioned referred to the same sort of sentence.