The Golden Rule originates in a well-known Torah verse (Hebrew: “ואהבת לרעך כמוך”):
You shall not take vengeance or bear a grudge against your kinsfolk. Love your neighbor as yourself: I am the LORD.
This Torah verse represents one of several versions of the Golden Rule, which itself appears in various forms, positive and negative. It is the earliest written version of that concept in a positive form.
At the turn of the eras, the Jewish rabbis were discussing the scope of the meaning of Leviticus 19:18 and 19:34 extensively:
The stranger who resides with you shall be to you as one of your citizens; you shall love him as yourself, for you were strangers in the land of Egypt: I the LORD am your God.
Commentators summed up foreigners (= Samaritans), proselytes (= ‘strangers who resides with you’) (Rabbi Akiba, bQuid 75b) or Jews (Rabbi Gamaliel, yKet 3,1; 27a) to the scope of the meaning.
The Sage Hillel formulated a negative form of the golden rule. When asked to sum up the entire Torah concisely, he answered:
That which is hateful to you, do not do to your fellow. That is the whole Torah; the rest is the explanation; go and learn it.
—Talmud, Shabbat 31a, the “Great Principle”
On the verse, “Love your fellow as yourself,” the classic commentator Rashi quotes from Torat Kohanim, an early Midrashic text regarding the famous dictum of Rabbi Akiva: “Love your fellow as yourself — Rabbi Akiva says this is a great principle of the Torah.”