To live at Her Majesty’s pleasure.
“News that notorious police killer Harry Roberts could be released from prison within days could make for a more shocking ending. Roberts is to walk free after 48 years living at Her Majesty’s pleasure, despite being told by a judge he should never be released.” — Burton Mail, 23 Oct 2014
To do time. In jail (or gaol, as some Brits still prefer to call it). To be detained at Her Majesty’s pleasure (or at His Majesty’s pleasure, if the reigning monarch is a king) officially refers to the indeterminate length of service of certain appointed officials or the indeterminate sentences of some prisoners.
Doing porridge: “Toff’s guide to doing porridge. Prison is dangerous for toffs, writes Yvonne Ridley. Here are a few survival rules for high society criminals.” — The Observer, 5 June 1999