Following the establishment of a public justice system and the appointment of judges, attention turns to the most severe offense an individual can commit: idolatry. This is not merely a private moral failure; it is an act that completely undermines the foundations of faith and shatters the core relationship between the Israelites and God [אבן עזרא, ספורנו, חזקוני]. Engaging in such practices is considered an absolute breach of the covenant God established with the Israelites when giving the Torah [רש״י, העמק דבר]. It effectively overturns and cancels this sacred agreement [אבן עזרא, אוהב גר]. Even if an individual maintains a belief in God but chooses to also worship natural forces or intermediaries, they are essentially denying God's direct providence and nullifying all His Commandments [ספורנו, ביאור יש״ר, ברכת אשר].
Bringing such a severe charge requires strict legal protocols. An accusation cannot be based on a casual discovery; it demands clear, formal evidence provided by at least two witnesses [תורה תמימה, מלבי״ם, אדרת אליהו, רש״ר הירש]. The court is then obligated to conduct a thorough and exhaustive investigation to verify the exact truth of the claims [רלב״ג, רבנו בחיי]. Furthermore, to secure a conviction, the witnesses must forewarn the individual right before the act, explicitly stating that they are about to break God's covenant. The perpetrator must acknowledge this warning and proceed intentionally and willfully, rather than acting out of a desire to please or out of fear of other people [אור החיים, רש״ר הירש, העמק דבר]. Even if the offender argues that they had previously sworn an oath to worship the idol, the court clarifies that their foundational covenant with God precedes and instantly nullifies any such vow [אור החיים].
The responsibility to root out this profound betrayal falls primarily on the local residents where the crime occurred. This obligation applies specifically within a Jewish city, which inherently excludes gentiles from the punishment of stoning [אור החיים, העמק דבר, אדרת אליהו]. It carries an expectation to eradicate even hidden sins, much like clearing out leaven, and serves as a strict warning against covering up for guilty relatives [רבנו בחיי, שפתי כהן]. If convicted, the individual is judged and stoned at the specific city gates where the offense took place, rather than at the gates where the regional court sits [אור החיים, העמק דבר, מלבי״ם, אדרת אליהו]. This localized execution prevents the unnecessary disgrace of dragging the guilty party from city to city [שפתי כהן]. However, this specific protocol of stoning at the local city gates applies exclusively within the Land of Israel; outside the land, the execution takes place at the entrance of the court that issued the judgment [רמב״ן, העמק דבר].
The law explicitly applies to adult men and women, intentionally excluding minors from this severe penalty [אדרת אליהו]. Specifying both genders also distinguishes this individual crime from the collective punishment of a subverted city. Unlike a subverted city, where individuals and women might not face the exact same collective severity, here every person stands trial and faces punishment entirely on their own [רמב״ן, תורה תמימה, מלבי״ם, צפנת פענח]. Highlighting women in this context addresses a specific concern that they might be more easily swayed by the false signs and wonders of fraudulent prophets, clarifying that their punishment is not reduced [רמב״ן, טור, שפתי כהן]. Ultimately, it is the unique nature of the covenant with God that dictates the severity of the consequence; a Jewish person who commits idolatry faces the severe penalty of stoning, whereas a gentile who commits the same act faces a lighter penalty by the sword [אדרת אליהו].