(31) Turn ye not unto the ghosts, nor unto familiar spirits; seek them not out, to be defiled by them: I am the LORD your God.
(י) לֹֽא־יִמָּצֵ֣א בְךָ֔ מַעֲבִ֥יר בְּנֽוֹ־וּבִתּ֖וֹ בָּאֵ֑שׁ קֹסֵ֣ם קְסָמִ֔ים מְעוֹנֵ֥ן וּמְנַחֵ֖שׁ וּמְכַשֵּֽׁף׃ (יא) וְחֹבֵ֖ר חָ֑בֶר וְשֹׁאֵ֥ל אוֹב֙ וְיִדְּעֹנִ֔י וְדֹרֵ֖שׁ אֶל־הַמֵּתִֽים׃
(10) There shall not be found among you any one that maketh his son or his daughter to pass through the fire, one that useth divination, a soothsayer, or an enchanter, or a sorcerer, (11) or a charmer, or one that consulteth a ghost or a familiar spirit, or a necromancer.
(כ) וחובר חבר ענינו הלחשים, וכן נתבאר בספרי ואלו הידיעות כלן הקסם והעוננות והכשוף וזולתם הם הנקראים בלשונם ז"ל דרכי האמורי, ומאלה קצת הדברים אסורים וקצת מותרים. ודעת הרמב"ם ז"ל בזה כי כל מה שלא יגזרהו העיון הטבעי אסור וזולתו מותר, ופירוש זה שאמרו במסכת שבת בפ' במה אשה יוצאה (דף סז) אביי ורבא דאמרי תרוייהו כל דבר שהוא משום רפואה אין בו משום דרכי האמורי. שכל דבר שיגזרהו העיון הטבעי אין בו משום דרכי האמורי וזולתם יש בו. וזהו שהקשו הא אין בו משום רפואה יש בו משום דרכי האמורי והא תניא אילן שמשיר פירותיו סוקרו בסקרא וטוענו באבנים בשלמא טוענו באבנים כי היכי דניכחש חיליה אלא צובעו וסוקרו בסקרא מאי רפואה עביד, כלו' שזה לא יגזרהו ההקש ועיון טבעי. ותירצו כי היכי דליחזוהו אינשי ולבעו רחמי עליה.
(20) "A conjurer [chover chaver]" (Deuteronomy 18:11) is one who pronounces incantations, as explained in Sifrei (Shoftim 172). And all of these arts — divination, soothsaying, and augury — are all referred to by our sages of blessed memory as "the ways of the Emorites." Within the body of these practices, however, some are forbidden and some permitted. The Rambam's view on this is that anything not dictated by rational considerations is forbidden and anything else, permitted. This view is based on the statement in Tractate Sabbath (67a): "Abbaye and Rava both agree that anything within the province of healing is not in the category of 'the way of the Emorites.'" The implication is that anything dictated by reason is not within the category of "the ways of the Emorites" and that anything else is. This is the intent of the question which follows (Ibid): "Is this to imply that anything not within the province of healing is in the category of 'the ways of the Emorites'? Did we not learn: 'A tree that is losing its fruits should be coated with red paint and be weighted down by stones so as to weaken it [its over-richness being responsible for the fruit loss]'?" That is: we can understand weighing it down, this being dictated by reason, but what healing is effected by coating it with red paint? There are no cause and effect considerations or other natural considerations which would warrant this. And the Gemara answers: "So that people notice its condition and pray that it be healed."
א"ר יוחנן אין מושיבין בסנהדרי אלא בעלי קומה ובעלי חכמה ובעלי מראה ובעלי זקנה ובעלי כשפים ויודעים בע' לשון שלא תהא סנהדרי שומעת מפי המתורגמן
R. Johanan said: None are to be appointed members of the Sanhedrin, but men of stature, wisdom, good appearance, mature age, with a knowledge of sorcery*, and who are conversant with all the seventy languages of mankind, in order that the court should have no need of an interpreter.
*So as to be able to detect [and defeat] those who seduce and pervert by means of witchcraft. -Rashi