The foundational principle governing the tension between transgression and survival is rooted in Vayikra 18:5, which commands that one shall live by the mitzvot — and not die by them; Yoma 85b develops this into an explicit license to desecrate Shabbat in order to preserve life, with Rabbi Shimon ben Menasya reasoning that one should desecrate one Shabbat so that many future Shabbatot can be observed, and Shmuel adding that "וָחַי בָּהֶם" — and live by them — is itself the operative proof-text.
The Gemara in Sanhedrin 74a extends this framework into a comprehensive hierarchy: for all Torah prohibitions except idolatry, forbidden sexual relations, and bloodshed, one must transgress rather than be killed, since preserving life overrides virtually the entire Torah; but during a time of active religious persecution, even a minor commandment must be upheld at the cost of one's life, and any public violation — even of an otherwise permissible act — requires martyrdom to avoid desecrating God's name.
The Rambam codifies this hierarchy in Mishneh Torah, Foundations of the Torah 5:1–4, grounding it in the obligation of kiddush Hashem: in ordinary circumstances one transgresses and lives, but dying rather than transgressing in the three cardinal categories, or publicly in a time of persecution, constitutes sanctification of God's name, whereas dying needlessly in other cases makes one culpable for his own death.
Critically, the Gemara in Shabbat 4a establishes that one may not commit a sin — even a rabbinic one — in order to spare another person from a more severe prohibition: Rav Sheshet's objection, "does one tell another: sin so that your fellow may benefit?" is treated as self-evident, and the resolution offered by Rav Ashi and Rav Aḥa bar Rava allows only a reframing of the situation (acting before the graver violation is reached), not a deliberate choice to be over an aveira in order to prevent another's.
The question of whether a rabbinic prohibition can be set aside for the sake of human dignity receives nuanced treatment in Berakhot 19b: the Gemara rules that great is human dignity, for it overrides a prohibition in the Torah — but Rav Kahana clarifies that what is actually overridden is the rabbinic layer that was anchored to the verse "lo tasur," since the Sages themselves waived their enactments in circumstances of kevod habriyot, rather than Torah-level prohibitions being directly suspended.
Ben Azzai in Pirkei Avot 4:2 teaches that one should run toward a minor mitzvah just as toward a weighty one, and flee from transgression — because mitzvah leads to mitzvah and transgression leads to transgression; Avot DeRabbi Natan 25:4 amplifies this by warning that one who commits a single aveira without remorse will find that it draws many more in its wake, since sin compounds upon itself just as merit does.
Pirkei Avot 2:1 reinforces that one should be as scrupulous about a minor mitzvah as a major one, since the rewards of mitzvot are unknown — a principle that counsels against practically ranking obligations by apparent weight and neglecting the lighter ones.
Sha'arei Teshuvah 1:5 warns that the person who repeats a sin finds repentance exceedingly difficult, because the sin becomes normalized and treated as though it were permitted — illustrating how the momentum of transgression distorts one's moral perception over time.
Mesillat Yesharim, Chapter 11 — Nekiyut drives home that a mitzvah performed through a transgression is not credited as a merit but condemned as a further sin, citing the principle that "sin cannot be a mitzvah" and the teaching that one who steals wheat, bakes it, and recites a brachah is not blessing but blaspheming — so that the aveira corrupts and nullifies the mitzvah entirely rather than serving as a valid means to it.
Mesillat Yesharim, Chapter 4 — Zehirut urges continuous vigilance and trembling before divine judgment, stressing that even casual speech between husband and wife is recalled at the time of judgment and that God scrutinizes every small and large act — underscoring that no aveira, however minor, falls outside the ledger of accountability.
Maharal, Netivot Olam — Netiv HaTorah 1 addresses the interplay between Torah study and the performance of mitzvot, ruling that Torah — as the supernal intellect implanted in the world — exceeds even the mitzvot in rank, except for a mitzvah that cannot be performed by anyone else, in which case the mitzvah takes precedence — a ruling that demonstrates that priority among obligations depends on circumstances and replaceability, not fixed hierarchical rank alone.
Rav Tzadok HaKohen, Tzidkat HaTzadik 40 draws on the paradigm of the scapegoat sent to Azazel: what would otherwise be an act associated with the demonic becomes a mitzvah precisely because God commanded it, showing that divine mandate can transform the character of an act entirely — a consideration that frames the outer boundary of when "aveira" and "mitzvah" are categorically distinct.
Maamar Mordechai Hilchot Shabbat 16:65 rules that one who declares a rabbinic mitzvah to be a Torah-level obligation transgresses the prohibition of "bal tosif" (adding to the Torah), while one who declares a Torah mitzvah to be merely rabbinic transgresses "bal tigra" (diminishing the Torah) — so that even the verbal framing of a mitzvah's level carries independent halachic weight.
Moreh Nevuchim III:26 establishes that every divine commandment has a purpose rooted in wisdom rather than arbitrary will, and that all mitzvot serve a rational aim even when the specific reason is unknown — a philosophic foundation that gives coherence to the entire enterprise of weighing and prioritizing obligations.
Tanya, Likkutei Amarim, Chapter 27 addresses the intermediate person who is assailed by unwanted evil thoughts: rather than despairing, he should rejoice that he turns his mind away from them, thereby fulfilling the commandment not to stray after his heart and eyes — demonstrating that the very act of resisting an aveira, even without eliminating its temptation, constitutes its own form of service.
Sha'ar HaGemul of the Ramban situates the entire structure of reward and punishment within the framework that at Rosh Hashanah three books are opened — for the wholly righteous, the wholly wicked, and the intermediate — while acknowledging that the perfectly righteous and entirely wicked are theoretical categories, since the system of reward and punishment does not operate in simple, visible proportion even for the righteous, as Kohelet testifies.