A setting is treated as equivalent to prison in many ways, even if it does not explicitly call itself a prison. It is often a place of "refuge" that for all intents and purposes is a prison. Often, this means there is some threat just outside the refuge itself.
Note that this portrayal often revolves around the idea that "confined against will" is equivalent to prison, even if the living conditions aren't as bad as they would be at a prison (or even better than what the prisoner is used to). The old saying that "a gilded cage is still a cage" acknowledges the idea of a prison being a prison, no matter how comfortable, and there is some overlap of the Gilded Cage with this trope.
In historical works, this trope frequently affects people seeking respite from hostile forces (often government or law enforcement) in a church or temple. Their refuge effectively becomes this trope if they must stay within its buildings or grounds to remain unmolested. Alternatively, wayward clerics might find themselves consigned to a monastery for a period as part of their penance.
In modern usage, this trope can be explicitly judicial or more a matter of political control. House arrest (a common punishment for juveniles and a sentence pronounced by actual courts of law) and not being allowed to leave the city (because there is a pending court procedure involving you) are examples of the former. Whenever the government of a country doesn't allow its citizens to travel abroad, or at least significantly limits their possibility to do so (a notable example was East Germany) would fall under the latter category. Of course, some of the judicial uses of this are for political "offences".
Supertrope to Locked Away in a Monastery. Compare Deadly Environment Prison, where the danger is the surrounding environment itself rather than the auhtorities and the prison nature of the location is usually more explicit. See also Gilded Cage.
- In Marvel Comics "Decimation" event, the Xavier Institute was called a "Haven" for remaining mutants, but was really an internment camp for them.
- The "Sanctuary Communities" of The Road To Cydonia, if the evil government agency decides you need "sanctuary" you will be placed in one and never allowed to leave... ever.
- In the epilogue of The Vow, Lord Shen is forced to live secretly in the Shan Palace, the home of his wife Lady Lianne. This is her way of using her noble's right to condemn him on her lands for his crimes as she sees fit, and while a secret life inside the borders of her palace is a form of imprisonment, it's still more merciful than whatever any other authority of China would inflict on him. While it takes time for Shen to accept this unappealing course of life, he has at the very least his wife and son.
- Beacon Academy itself becomes this for Roman Torchwick and Headmaster Jaune Arc in Professor Arc, given there's still a lot of Atlesian military forces outside. Both are still technically wanted men since they escaped military custody, though popular opinion is beginning to push for the charges to be thrown out, since they were pivotal in repulsing Cinder's vast attack on Vale.
- Mermaid Melody Pichi Pichi Duo: In order to keep them safe from Dr. Hishki, Nikora gathers all seven Mermaid Princesses and declares that they're forbidden to leave the Pearl Piari for any reason until the threat has passed. It doesn't take long for the group to sneak out, and after Nikora has a talk with Maki over it and is nearly captured by Hishki's minions herself, she relents as long as they be careful and watch their backs.
- Sunnyside Daycare from Toy Story 3, in that toys donated there are locked up, required to stay, and security is tight to deter inmates from escaping.
- Marnie is under a year's house arrest with an electronic tracking bracelet limiting her to the eponymous hundred feet in 100 Feet after serving two years in an actual prison.
- Tedd, in Delirium (2018), is similarly confined to his deceased father's house for a month after his release, forbidden to leave the property, obliged to entertain his parole officer at any time of day, and subject to a daily check-in where he must get to the ringing telephone within 10 rings to state his name and have his picture taken.
- Kylie, in Housebound, is remanded to her parents' custody and confined to their house with an ankle monitor.
- Kale, in Disturbia, is under house-arrest with the corresponding ankle bracelet when finds that the neighbor may have more sinister hobbies.
- In the Hurog series, there is an asylum for insane nobles. It is also used to get rid of nobles who are in someone else's way, but can't be killed without causing political trouble.
- The cathedral from Victor Hugo's The Hunchback of Notre Dame and most adaptations, including Disney's, in that Esmeralda goes there to avoid Frollo, and in order to avoid arrest has to stay in that building, until Quasimodo decides to help her get past the guards.
- Religious houses are occasionally used this way in the Deryni works:
- Prince Javan Haldane spends time in a monastery run by the Custodes Fidei. While Javan bides his time there, studying and trying to avoid the regents' notice, he is still flogged for disobedience at one point and is pressured towards taking religious vows and resigning his position as his twin brother's heir.
- The prologue of The Bishop's Heir shows Archbishop Loris confined to a monastery (in the custody of the Fratri Silentii) after being stripped of his ecclesiastical offices.
- As part of The King's Justice, Kelson decrees that Caitrin Quinnell, the Mearan Pretender, will live out her life in a convent.
- In Gary Corby's historical mystery The Ionian Sanction, Nico and his allies (including a high Persian imperial official) pursue a killer to the Temple of Artemis. Once the killer is past the white boundary stones, a priest stops the pursuit and a negotiation ensues over the conditions. The temple is not obliged to feed the killer, but his friends can bring food. The official summons extra guards to be posted around the perimeter to prevent the killer from leaving.
- In Harry Potter and the Order of the Phoenix Sirius is forced to stay in the house he ran away from as a teenager since the Ministry of Magic is hunting for him and has already shown that they will sentence him to a Dementor's Kiss without trial the moment they get their hands on him. While the family that abused him is all dead and gone their portraits and Kreacher still spout their xenophobic rhetoric constantly and drive him a bit mad; noticeably he only seems to start mixing up Harry with his father after being stuck in the house for months.
- Heralds of Valdemar:
- Two characters connected to the kidnapping of Amily meet this fate at the end of Changes. Tobias Marchand is "assigned" to a chronicler's post at a border Guard station, the posting is specifically referred to as lifetime house arrest. A Healer who worked for the kidnappers is sent to be the resident Healer at a prison for the rest of his life.
- In Brightly Burning, an insane woman guilty of attempted murder is sentenced to be bricked up in a hermit's cell for the rest of her life. (Misses Locked Away in a Monastery status because she doesn't take vows. However, her family is still required to make the usual "gift" to the religious order for her care.)
- In the first Time of Troubles flashback in the Deverry novels, the surviving women of the Wolf clan seek sanctuary in a temple. The head of the Boar clan, which had slain all the men and most of the soldiers of the Wolf, declined to break sanctuary, but left a squad of men with enough supplies to last them for a month or more waiting on the only road leading away from the temple to capture the women if they try to leave. This lasts until some survivors of the Wolf war band attack and kill the besieging squad.
- Dragon historian Jin Jae-Hoon is imprisoned in one of these in The Secret World. More specifically, his prison is Seoul - as in an entire city. Since the Dragon need him around to serve as their chronicler, he can spend his time anywhere within the city limits, but attempting to leave will only result in the Silent Monks being sent out to retrieve him; plus, the Dragon are masters of predicting and manipulating events, so there's no point in running anyway. By now, Jae-Hoon's adjusted to his incarceration, and spends his days lounging in the foyer of the Kumiho Hotel, listening to the music and reviewing his notes until someone asks him a question.
- Star vs. the Forces of Evil has St. Olga's Reform School for Wayward Princesses. It is likened to a prison from the very beginning, and the eponymous episode (very much a Prison Episode) shows us just how accurate this is.
King Pony Head: It's reform school, cupcake, not jail. Although, admittedly, it is a lot like jail.
- When the Yorkist King Edward IV was defeated, during the Wars of the Roses, his Queen Elizabeth Woodville fled into sanctuary with her daughters at Westminster Abbey. Supporters of the Lancastrian King Henry VI held the capital around the abbey, as well as the machinery of government. Her son (who would've been Edward V) was born there, and King Edward IV wasn't presented with his heir until he won back his throne months later.
- This only worked for women. Edmund Beaufort, the Duke of Somerset, tried hiding in an abbey. The Yorkists stormed it, dragged him out, and beheaded him.
- For 14 years, the Angulo siblings of Manhattan were mostly confined to their apartment by their dictatorial father, with only movies and home-schooling to learn about the outside world. Their story has been explored in the documentary The Wolfpack.
- Julian Assange of Wikileaks, threatened with extradition from the UK to Sweden to face rape charges, sought diplomatic asylum in London's Ecuadorian embassy in 2012, claiming his arrest warrant was merely an excuse to have him extradited to the USA to face politically-motivated espionage charges (and thus potentially the death penalty). As of 2018, he's still there, and numerous stories have leaked of the long seclusion having a negative effect on his health, and on the sanity of both Assange and the embassy staff. He and his supporters have outright described his (technically voluntary) confinement as "imprisonment".