Siman 24
Presented here for study, not as a practical ruling. The Shulchan Aruch rules by Sephardi custom, the Rema's glosses by Ashkenazi custom, and the Kitzur follows Ashkenazi custom. For a practical question, ask your rabbi.
א לֹא נֶחְשְׁדוּ יִשְׂרָאֵל עַל מִשְׁכַּב זָכָר וְעַל הַבְּהֵמָה, לְפִיכָךְ אֵין אִסוּר לְהִתְיַחֵד עִמָּהֶן, וְאִם נִתְרַחֵק אֲפִלּוּ מִיִּחוּד זָכָר וּבְהֵמָה, הֲרֵי זֶה מְשֻׁבָּח. וּגְדוֹלֵי הַחֲכָמִים הָיוּ מַרְחִיקִין הַבְּהֵמָה, כְּדֵי שֶׁלֹּא יִתְיַחֲדוּ עִמָּהּ. וּבַדּוֹרוֹת הַלָּלוּ שֶׁרַבּוּ הַפְּרִיצִים, יֵשׁ לְהִתְרַחֵק מִלְּהִתְיַחֵד עִם הַזָּכָר:
1 We do not suspect a [male] Jew of sleeping with a man, or of sleeping with an animal. Therefore, there is no prohibition of being secluded with them. If one distances himself even from seclusion with a man or animal, it is praiseworthy. The great wise men would distance an animal so as not to be secluded with it. In these generations, where licentious people have increased, one should distance himself from seclusion with a man.