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 authorities and the prison nature of the location is usually more explicit. See also Gilded Cage for an upper-class variety. Also compare Hikikomori, where the confinement is self-imposed.
- 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.
- The Redemption of Harley Quinn: At the end, Harley is allowed to be trained to become a PTSD psychiatrist, and Poison Ivy is allowed to be her domestic partner, but their criminal records still stand. From now on, every single aspect of their lives will be monitored by law enforcement, and will never have any real freedom or privacy (except in bed). Furthermore, Harley will never be allowed to contact her twin daughters, whose adoptive parents can seal up her status as their birth mother. Harley doesn't mind any of this as long as she gets to help people, and Ivy doesn't mind either just as long as Harley's happy.
- 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.
- Orson Scott Card's "The Originist": A week after the funeral Leyel Forska threw for Hari Seldon, a representative from the Commission of Public Safety appears to explain to Leyel how concerned they are for his old age. Through subtext (which Leyel's inner narration explains for the reader's benefit), we learn Leyel will not be allowed to leave the planet, his travel on planet will be monitored, and whenever his children or grandchildren visit him, the other group will be held as hostages as well. In addition, any scientific research he (or his wife) wants to publish will be submitted for approval first.
- The Village from The Prisoner (1967).
- The waiting areas in the Doctor Who serial The Happiness Patrol are specifically not prisons ... but step over the line that marks the edge of the area, and "you're a dead man".
- The Sanctuary Districts shown in the Star Trek: Deep Space Nine episode "Past Tense". In the mid-21st century, America faced ever-rising rates of unemployment and homelessness that Sanctuary Districts were set up as temporary housing districts for jobless and homeless citizens, so long as they don't have criminal records. The repeal of the Federal Employment Act of 1946, however, resulted in job placement services being practically scrapped, with those who find themselves in the Sanctuary Districts essentially imprisoned there, possibly for life, since no one was allowed to leave "for their own safety", essentially making them modern-day debtors' prisons.
- Sam's situation in Death Stranding can be compared to this. When he's unconcious, the staff of BRIDGES puts a pair of cufflinks (a small computer that locks around the wrist like a pair of cuffs) on him. They constantly monitor his location and vitals, even when he showers or sleeps, and it seems like they are constantly recording audio. He can't take them off himself and requires a permission from a higher ranking member of BRIDGES (like Deadman or Mama). The cuffs seem very sturdy and nigh unbreakable, and can withstand the temperature and humidity of a hot spring. They serve multiple purposes, like a map or a hacking device, but it still seems like they were put on him first and foremost to make sure he won't escape before he completes his mission. Sam lampshades his situation a couple of times, asking the BRIDGES staff if he's a prisoner (to what they answer avoidantly) and likens the cufflinks to actual handcuffs.
- 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.
- Contrary to its portrayal in Fate/Grand Order, the Chaldea of Learning with Manga! FGO is pretty much a prison for its Servants. They do have their accommodations and are allowed to use the facilities within, but they get shoved into a room if they're not useful to Gudako's team and are locked up indefinitely after they reach max bond with her.
- 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). He was still there up until 2019 when he was arrested after the embassy evicted him, 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".