Les Proverbes 22:5 Halakha : Shulchan Arukh, Yoreh De'ah

צִנִּ֣ים פַּ֭חִים בְּדֶ֣רֶךְ עִקֵּ֑שׁ שׁוֹמֵ֥ר נַ֝פְשׁ֗וֹ יִרְחַ֥ק מֵהֶֽם׃

Des lacets et des pièges sont semés sur la route du pervers; qui tient à sa vie s’en éloigne.

Shulchan Arukh, Yoreh De'ah

Demonic work is prohibited, but some permit inquiring of them about stolen items. [Comment of Rema: And derived from this (B"Y and Hagahot Maimoniot 11 in "Laws of Theft") And to force them to swear oaths using Divine Names, some permit in any situation. (B"Y citing N"Y and citing that comment) But in any case, most of the practitioners of this do not get out of it peacefully, so one who wants to protect their soul will distance themselves from them (demons) (B"Y).]