Obstructive Code of Conduct

""It seems impossible. A Star Captain's most solemn oath is that he will he give his life, even his entire crew, rather than violate the Prime Directive.""

- Captain James T. Kirk, Star Trek: The Original Series

This trope involves any code of conduct that artificially constrains the choices available to the protagonist. Often (as with Star Trek's Prime Directive), it restricts or prevents his use of phlebotinum that would wrap up the plot in two seconds otherwise. Conveniently forgotten (or hand waved) when the plot requires it, but some shows do try to use this as a point of plot drama as the protagonists try to find a way to twist the rules to fit the situation.

See also Restraining Bolt, Screw the Rules, I'm Doing What's Right. Can result in Reed Richards Is Useless. If the party with the Obstructive Code of Conduct is substantially more powerful than the others involved, it can result in Awakening the Sleeping Giant. See Alien Non-Interference Clause for a common version of this.

Anime & Manga

 * The eponymous demihuman warriors of Claymore are sworn never to kill a human under any circumstances on pain of being hunted down by their colleagues (presumably to keep the general populace at least a little less frightened of them than the creatures they hunt). In practice their behaviors range from refusing to raise a hand against any human to avoiding deathblows and making sure nobody bleeds out to slaughtering any witnesses to prevent accusations from being made.
 * Mermaid Melody Pichi Pichi Pitch's forbidding of relationships between mermaids and humans. Legend even stated that if a mermaid revealed her identity to a human, she would die,
 * In Sailor Moon, Sailor Pluto had three taboos: she was forbidden to leave the Space-Time Door, to bring others through it, and to stop time (it was said that using her power to stop time would result in her death). Nevertheless, she broke all three directives in both the anime and the manga and got away with it, although she stopped time under different circumstances (in different Story arcs, even) and seemed to die immediately afterward, then came back with little explanation.
 * In Tantei Gakuen Q, DDS students are not to parade their identity. Nonetheless, they whip out their notebooks whenever they hit a slight snag in operations and sometimes before then - and as of episode 34, it's only seriously backfired once.
 * In Haruhi Suzumiya, Yuki Nagato's directive is to "observe and not interfere." She's violated that directive quite a number of times by book 10 of the light novels and will probably continue to do so for the near future.

Comic Books

 * Similarly, the Watchers from Marvel Comics have a non-interference oath that exists pretty much so that Uatu can break it, thereby establishing that the stakes are really high this time.
 * The Watchers are very strict about their Prime Directive most of the time. In one case the universe was being destroyed and the Watchers (an entire race of people with power rivaling Galactus) went to watch the show.
 * Deconstructed in Earth X, where the Watchers' oath turns out to exist so they can weasel out of preventing (and emotionally distance themselves from) the multiple genocides committed by their masters, the Celestials as the latter carry out their plan to take over the universe. Uatu's violations are also explained- he only ever interceded when the fate of the world (literally, as he was out to protect ) was at stake.
 * Lampshaded by a Celestial that the Watcher has broken his oath over four hundred times. Though for an immortal being that's lived billions of years, theoretically that means he doesn't violate it all that often.

Film
"There is no emotion; there is peace. There is no ignorance; there is knowledge. There is no passion; there is serenity. There is no death; there is the Force."
 * In Star Wars, the Sith have an ages-old rule that there can be only two Sith at any given time—a master and an apprentice. They break this rule all the time, especially in the Expanded Universe, in which every villain from the movies seems to have two or three "secret apprentices." Granted, they're villains, so rule-breaking is no surprise, but it makes you wonder why they made this dumb rule for themselves in the first place.
 * A lot of these make the Dark Side = Sith distinction. You can teach the force to others, but Sith Techniques are shared only between a Master and Apprentice. Of course a lot of Sith have broken this one too.
 * Similarly, the Jedi have their own creed, though never specifically stated in the movies. The promotional material for Episode II told us that "A Jedi Shall Not Know Anger. Nor Hatred. Nor Love". And in the Expanded Universe, the Jedi Code taught is:

"Woody: We're going to have to break a few rules."
 * While many Jedi seem able to more or less come to terms with anger and hatred, they always seem to be having trouble tackling the matter of not falling in love... In the end it becomes rather clear in the EU that later Jedi consider the "no love" thing a rather dysfunctional rule. Even the movies hint at this as it's the "no love" nonsense that really drives Anakin toward the dark side and it's Luke's love for his father (that the older Jedi consider a weakness) that saved him. It's little surprise then that when Luke goes on to found his own order the no love rule is more or less totally abandoned with large numbers of Jedi marrying and producing children whom they clearly deeply care for without anyone saying this is bad.
 * Fridge Brilliance: Would you want to be telling Han Solo "No, you can't marry my sister?"
 * The eponymous character of RoboCop follows a number of Prime Directives. While 'Serve the Public Trust', 'Protect the Innocent' and 'Uphold the Law' follow the code of conduct aspect of the trope, additional Sub-Directives have on occasion been programmed into Robocop as restraining bolts that keep him from doing his job effectively.
 * In the Toy Story universe, toys seem to have a Obstructive Code of Conduct. Toys must not allow themselves to be seen by humans while animate. This is never said explicitly, but judging from the fact that toys will either hide or "play dead" whenever a human comes by, it's probably safe to assume this.
 * Woody makes a vague mention of this in the first movie, when he and the reassembled toys confront Sid.


 * Word of God is that involuntary instinct also plays a role (which explains why it's never made explicit).
 * In the Superman movie the reason given (though in a piecemeal and blink-or-you'll-miss-it way) for Superman's non-interference with the world on a large scale is that due to early interplanetary warfare an intergalactic law was set in place for people from one planet never to interfere with the course of history of another planet. To break it might cause more harm than good: it could start an intergalactic war. No prize for guessing whether he breaks it at the end anyway.

Literature

 * In the Harry Potter books, the wizarding world has hidden from the Muggle (non-magic) world since 1689, and the International Statute of Secrecy is one of their most important laws. The reasons given are "everyone'd want magical solutions to their problems" and "they'd persecute us". There are strict rules about performing magic in front of Muggles and, if you're underage, anywhere outside of school. In essence, they amount to it having to be a life-or-death situation.
 * Sector General: The Monitor Corps have a Alien Non-Intervention Clause similar to that of Star Trek, meaning no contact before the discovery of FTL, but seemed to be much more reasonable with it, as they violated it four times during the series. Once was because a pandemic (although, through no fault of the person in charge, the cure resulted in a genocide), once was because of an environmental disaster, once was because the civilization was killing off another intelligent being on the planet (as well as itself), and once because the species involved were physically incapable of spaceflight, due to an inherent psychological problem.
 * The Andalites of Animorphs have the Law of Seerow's Kindness forbidding them from sharing technology or other sensitive knowledge with aliens. It's named for Prince Seerow, who provided advanced technology to the then-primitive Yeerks. Prince Elfangor broke this law by giving morphing powers to the title characters.
 * The Ellimist claims that, as a rule, he never interferes with mortal races, but in actual practice he finds many excuses to interfere.
 * The Ellimist's rules are generally based on the game he plays with Crayak. Because both of them are so powerful that they could wreck the entire galaxy if they felt like it (their battles were at the stage where they were hurling planets and suns and even solar systems at each other, destroying what might have been an entire arm of the galaxy' and this was before they got their God-power upgrades), they have a rule that each time one interferes directly, the other is allowed a single action to balance it out. As a result, they fight their wars through proxies for the vast majority of the time.
 * At the end of one of the Vampire Chronicles novels, the surviving oldest vampires make a pact to stop making any more vampires, even though their version of Conservation of Ninjutsu states that the more vampires are out there the less they need to feed. Lestat, the Magnificent Bastard that he is, goes ahead and forcibly turns the very next book.
 * In the Heralds of Valdemar series, the Companions are spirit advisors in corporeal form for the eponymous Heralds, taking the shape of cool horses. Most of the time, they're under strict divine orders not to interfere with the course of events, supplying advice and intervention only when asked. This is strongly Justified Trope, as the gods want the Heralds to solve problems on their own rather than rely on the Companions as a personal source of Deus Ex Machinas, and because the Companions themselves are fallible and risk falling into the Omniscient Morality License trap. Sometimes, however, the Companions are seen to subtly (or not so subtly) influence things behind the scenes, and they get called out on this rather severely by Elspeth in Mage Winds.
 * The Federation in Enchantress From the Stars has a very strict non-interference policy on developing civilizations. Field agents to Youngling planets often die rather than reveal their true nature.
 * In Twilight and other related books, the Volturi enforce laws that all other vampires must follow: any humans who learn of vampires must be turned into vampires or killed, do not turn babies or toddlers into vampires, do not make alliances with werewolves, do not hunt in Volterra, do not lie to or defy The Volturi. The punishment is death, but The Volturi often bends the rules and invites vampires with special talents to join them.
 * The Wheel of Time's Aes Sedai are magically bound by three prohibitions: they can't lie, they can't make weapons, and they can't use magic as a weapon except against Shadowspawn or as a last resort in self-defense. They are so well known for circumventing the prohibition against lying that they're invariably met with suspicion. The last prohibition, however, causes the Aes Sedai no end of trouble as they encounter groups bent on their annihilation that are not, technically, allied with the Shadow. They generally circumvent the problem by deliberately placing themselves in mortal danger until they feel that they have no alternatives to letting loose.
 * The War Gods series has Wencit of Rûm, a wizard who's sworn to enforce the Strictures of Ottovar, that strictly forbid using magic against non-wizards except in direct and non-lethal self defense, and contain a strict dueling code for wizard to wizard action. Both instances of him joining combat include him enlisting the aid of non-wizards to work around the rules. For a dark wizard, fulfilling the requirements for Wencit to attack them means instant death.
 * The Valar and Maiar are both limited in the amount of intervention they can take in Middle Earth. Considering that the times the Valar have intervened, entire continents have been sunk, they may have a point.

Live-Action TV
""As the right of each sentient species to live in accordance with its normal cultural evolution is considered sacred, no Star Fleet personnel may interfere with the healthy development of alien life and culture. Such interference includes the introduction of superior knowledge, strength, or technology to a world whose society is incapable of handling such advantages wisely. Star Fleet personnel may not violate this Prime Directive, even to save their lives and/or their ship unless they are acting to right an earlier violation or an accidental contamination of said culture. This directive takes precedence over any and all other considerations, and carries with it the highest moral obligation.""
 * Star Trek is the most famous for this (and the Prime Directive being an archetypal example).

"Dick: We can make little differences, we just can't make global differences. Harry: Can we blow up the Earth? Dick: You see, that's a global difference. Harry: It's so hard to keep track of all this."
 * One of Gene Roddenberry's favorite Aesops involved the distinctions between the spirit of the law and the letter of the law. In particular, the "healthy development" phrase proved, on several occasions, to be a loophole big enough to fly the Enterprise through, while on other occasions, serious debate has been put up on the question of whether getting annihilated by the disaster-of-the-week is part of said "healthy development".
 * Currently, there are only two directives that are known to supersede the Prime Directive: the Omega Directive (which aims at ) and the Temporal Prime Directive (don't mess with the timeline).
 * In Babylon 5, the Psi Corps rules basically exist only so that telepaths can break them to show that it's really serious this time.
 * At times, the Time Lords from Doctor Who have tried to maintain this, even putting the Doctor on trial for its violation at one point; a few other episodes have had him ask the people he's saved (if any survive) to not mention him. In other cases, the Time Lords have redirected his TARDIS to places they wanted fixed by him without admitting their involvement.
 * In Frontios, the Doctor does his very best to keep out of it—until he sees there are injured. Then, at the end, he asks them not to spread the news.
 * In the new series, the Doctor also has a rule against using time travel to change events that he's personally involved in. It's implied that this would be really, really bad for nonspecific reasons. This is usually used to keep him from using the TARDIS to get out of trouble.
 * Highlander employed it constantly as well (do not fight on holy ground, do not fight in front of other people, etc).
 * Highlander Endgame had the villain violate the holy ground rule. This caused Fan Backlash so bad the bit mentioning holy ground was cut from the DVD release, leading to a plot hole instead. Fans took it badly than many a worst villains abided by that rule, and several material like Highlander the Series inferred near-apocalyptic consequences to violating it (It was said the last time someone did it, Vesuvius happened to Pompeii". Yet when the villain of Endgame did it, nothing happened.
 * Also, in Sliders, the Professor originally insisted on employing a similar Prime Directive to that of Star Trek—namely, not getting involved in the world's culture and politics. Obviously, they always violated this directive, even when it was unnecessary for their survival (for example, the Professor winning the mayoral election in a female dominated society).
 * Stargate SG-1 deconstructs the Star Trek-style Prime Directive by putting our heroes on the other side of it. See Neglectful Precursors—and that's just the Ancients.
 * The Nox are perhaps even more into this idea. Both they and the Nox get incredibly annoying about it ("You are very young," anyone?) The Asgard initially take this path as well,.
 * The Tollan also qualify. Despite being a younger civilization, they have advanced centuries beyond Earthlings (possibly, due to the lack of anti-science movements in their culture). They refuse to give any of their technology to less advanced races. This is Justified Trope in their case, as their previous experience with giving technology to a less advanced civilization ended in an Earthshattering Kaboom. Later, however, after the untimely death of one of their leaders, the Tollan offer to trade their powerful ion cannons to Earth in exchange for Unobtainium. . It should be noted, though, that it would still have taken Earth scientists decades, if not centuries, to reverse-engineer and understand the workings of Tollan technology, which would explain why one of the Tollan broke their rule and gave a device to Carter.
 * P Lus the Goa'uld had just developed motherships with shields that could resist the ion cannons, making them just an ordinary weapon.
 * The aliens of 3rd Rock from the Sun also had a Prime Directive-like policy about interfering with the Earth. Explained thus:


 * Thunderbirds has their policy of maintaining strict secrecy about their organization and equipment when they could indirectly save many more lives licensing their vehicles to various emergency response services and militaries as standard issue equipment.

Tabletop Games
"1- Masquerade: Vampires must not reveal their existence to mortals. 2- Diablerie: Vampires must not devour the souls of other Vampires. Doing so gives them power, but drives them insane. 3- Progeny: Vampires shall not create more of their own kind. When they do, the Childe's actions are the Sire's burden."
 * Vampires in the White Wolf's Tabletop RPG Vampire: The Requiem have three Traditions that they must follow or face the wrath of the elders:

"1- Masquerade: Pretty much the same deal as in Requiem. 2- Domain: When a vampire has a domain, all others must owe that vampire respect when in it, and none may challenge their word. This is primarily used for princes. 3- Progeny: Vampires may not create others of their kind without their elder's (read: the prince's) permission, or else both they and their progeny will be slain. 4- Accounting: If you do create another vampire, you're responsible for them until such time as you release them, including any trouble they might get into. 5- Hospitality: When traveling to a foreign city, you must present yourself to the prince of that city and gain his acceptance. 6- Destruction: Vampires are forbidden to kill each other. The right of destruction belongs only to your elder (read: the prince), and only the eldest among vampires of a given city can call a Blood Hunt."
 * In short, rule one and three are barely considered loose guidelines. Rule 2 is obviously considered a bad thing, mostly because Vampires expect it to be done to them next. They're usually right.
 * The Camarilla from Vampire: The Masquerade had six Traditions which also needed to be followed to avoid the wrath of the elders:


 * As you might expect, many of these rules get bent or outright broken with some degree of regularity. The Camarilla is especially hard on those who break the Masquerade.
 * Dungeons & Dragons: The Paladin in many incarnations of the game has one of these by design. For starters, they must always maintain an alignment of Lawful Good, and if they ever stray from it, they must atone and perform penance as prescribed by a high-level priest before they can call upon their powers again—but if the breach was intentional, their paladinhood is lost forever, and they must ever after be a fighter. In particular, any intentionally-committed evil act automatically forfeits your paladinhood. This often cuts off a wide range of traditional player character activities and can get the character into trouble when the choice is: damned if you do, dead if you don't. This is especially true if you have a Killer Game Master, who will often make paladins "fall" for such small things that it effectively becomes impossible to actually stay one for very long.
 * Paladins could become anti-paladins, depending on alternate rulesets.
 * The 1st and 2nd Edition paladin had several additional restrictions as well, such as not being able to own more than a few magic items. The 1E ranger was likewise limited in how many possessions could be owned, and had to be Good-aligned.
 * Several other classes have alignment restrictions as well, although they aren't as stringent in that it takes a full-on alignment change to break this Code, not just a single act. Also, they don't lose their existing powers, they just can't advance any further in the class they've broken the Code of.
 * Monks can't advance any further in that class if they take a level in a non-monk class.
 * Removed in 4th Edition. Clerics and paladins can change their alignment and break codes later.
 * In Unknown Armies, the Taboo of any magick-user is basically this. There are some behaviors that you cannot engage in, ever, or you weaken your power in some way. For example, the Taboo of a Healer Avatar is denying a cry for help. If they do so, they lose points in their Avatar skill.

Video Games

 * There is one in Kingdom Hearts; do not meddle in the affairs of other worlds except to protect them from The Heartless, but it has been so blatantly violated through both games that no one really cares anymore.
 * Donald and Goofy care throughout the first game; at the end of the first game, they get ready to leave Sora for good, never to see him again (and can't bring themselves to say goodbye, opting to sneak away as Sora unites with Kairi and his own homeworld). But things happen and they still stick together; the beginning of the second game has a subtle "fuck that" moment on Donald and Goofy's part and no one brings it up again.

Western Animation
"1. A genie can't make anyone simply fall in love (though they're allowed to play cupid mundanely). 2. A genie can't kill anyone (implicitly, even indirectly or nonmagically -- however, as is repeatedly warned, "you'd be surprised what you can live through ...") 3. A genie can't raise anyone from the dead. There is an additional rule, saying that one cannot wish for extra wishes beyond the initial three."
 * The "provisos and quid pro quos" of genies in Disney's Aladdin:

"Pinchhard: Number One, I can't order you to host the pimple; I can only remind you of the PC Directive, and your responsibilities as a Sevfleet officer. Piker: Captain, I have my own directive -- Always look out for Number One. The zit goes! Pinchhard: Belay that popping! Piker: I see -- it's my choice only if I choose what you want!"
 * These were initially presented in the original movie as limitations on granted wishes, but became implicitly upgraded to general behavioral rules in the direct-to-video sequel (that also functioned as the pilot of the TV series).
 * In fact, the third rule is followed by "It's not a pretty picture. I don't like doing it!" which might mean the genie in fact can raise people from the dead - but they would come back in whatever state of decomposition they had reached and/or he just doesn't want to.
 * The second rule can be bent greatly. In the climactic scene of Return of Jafar, Jafar opened up a pit of lava beneath Aladdin's feet, with only a few rapidly sinking towers of stone keeping him from a molten death.
 * Da Rulez from Fairly Oddparents restricted the unlimited magic of fairies, disallowing them from making people fall in love, or die, or to maim, crush, cut, etc. (directly, anyhow, it was theorized on the show one could turn someone into an ice sculpture then "poof" them into the sun), or break the law, such as asking for money (as they can't make more, which is counterfeiting, or get some from others, which would be stealing). Some of these rules seem like simple incapabilities on the fairies' part; others are breakable, but have huge consequences, such as revealing the fairy godparents to anyone who isn't already aware of them. They are frequently broken as comedy requires.
 * One rule specifically applies to Timmy Turner, forbidding him from time travelling to the month of March, 1972. He's still allowed to visit other months of that year on the proviso he doesn't interfere with the election of President Mc Govern.
 * Because of the mess caused when Timmy wished it'd be Christmas Every Day, a new rule has been passed against wishing for that.
 * Making secret wishes became the most egregious violation of Da Rules ever since Joshua Applebee used one to wish for a fairy-eating giant cockatrice.
 * Genies have no rule other than having to grant their master's wishes in any way they can interpret the wish's wording. When asked, genies usually claim their masters can't use any of their wishes to wish for more wishes. The only exception was when Crocker became Norm's master. Norm and Crocker shared a common interest (Timmy's destruction)
 * Spoofed in Sev Trek: Puss in Boots when Commander Piker (Will Riker) is infected by an enormous zit that turns out to be an evolving sentient lifeform.


 * In Avatar: The Last Airbender, at the beginning of the second season, Aang wants to skip his Prime Directive of learning the four bending arts and go straight to the Fire Lord and take him out with the all powerful Avatar State, however he soon learns without control of this state he could easily hurt those around him and decides to take the traditional way by learning the bending arts first.
 * Another unwritten rule seems to be that the Avatar should learn the elements in order, starting with their natural element, air, water, earth and fire. Aang tries to learn Firebending second, but that doesn't really work out, he also learns several elements at the same time, otherwise the rule is followed by Aang.

Web Original

 * One episode of Mr. Deity has the titular god refusing to help out on Earth because it would violate the Prime Directive. Larry spends most of the episode trying to convince Mr. Deity that he's getting his own rules confused with Star Trek.
 * The Caretaker Gods of Orion's Arm have an active version of this. They prevent terragen lifeforms (anything with an ancestry going back to Earth) from contacting various planets, moon and solar systems that they have declared to be protected. This includes Old Earth itself.