The Talmud derives 'shelihut' from the gezeirah shavah of 'אתם גם אתם,' limiting agency to those who are themselves obligated in mitzvot — excluding non-Jews. This supplies the biblical basis for why a non-Jew cannot be a halachic agent.
וְאֶלָּא ״אַתֶּם״ ״גַּם אַתֶּם״ לְמָה לִי? מִיבְּעֵי לֵיהּ לְכִדְרַבִּי יַנַּאי. דְּאָמַר רַבִּי יַנַּאי ״גַּם אַתֶּם״ – מָה אַתֶּם בְּנֵי בְּרִית, אַף שְׁלוּחֲכֶם בְּנֵי בְּרִית. הָא לְמָה לִי קְרָא? מִדְּרַבִּי חִיָּיא בַּר אַבָּא אָמַר רַבִּי יוֹחָנָן נָפְקָא! דְּאָמַר רַבִּי חִיָּיא בַּר אַבָּא אָמַר רַבִּי יוֹחָנָן: אֵין הָעֶבֶד נַעֲשֶׂה שָׁלִיחַ לְקַבֵּל גֵּט מִיַּד בַּעְלָהּ שֶׁל אִשָּׁה, לְפִי שֶׁאֵינוֹ בְּתוֹרַת גִּיטִּין וְקִידּוּשִׁין. אִיצְטְרִיךְ, סָלְקָא דַּעְתָּךְ אָמֵינָא: עֶבֶד, דְּלָאו בַּר הֶיתֵּירָא הוּא כְּלָל. אֲבָל נׇכְרִי, הוֹאִיל וְאִיתֵיהּ בִּתְרוּמָה דְּנַפְשֵׁיהּ, דִּתְנַן: הַנׇּכְרִי וְהַכּוּתִי שֶׁתָּרְמוּ – תְּרוּמָתָן תְּרוּמָה, אֵימָא שָׁלִיחַ נָמֵי עָבֵיד, קָמַשְׁמַע לַן.
The Gemara asks: But then why do I need the derivation that once the verse states “you,” the addition of the word “also” in the term “you also” serves to include an agent? The Gemara answers: It is necessary to function as the source of the statement of Rabbi Yannai, as Rabbi Yannai says that from the term “you also,” the following is derived: Just as you, those who appoint agents, are members of the covenant, i.e., Jews, so too, your agents must be members of the covenant. A gentile cannot separate teruma even if appointed as an agent by a Jew. The Gemara asks: Why do I need a verse to teach this halakha? It is derived from that which Rabbi Ḥiyya bar Abba says that Rabbi Yoḥanan says, as Rabbi Ḥiyya bar Abba says that Rabbi Yoḥanan says: A slave cannot become an agent to receive a bill of divorce from the hand of a woman’s husband on her behalf because he is not included in the laws of bills of divorce and betrothal. This indicates that there is a principle that if certain matters do not apply to a person, he cannot act as an agent with regard to those matters. Therefore, since gentiles are not commanded to separate teruma, they cannot be agents for its separation. The Gemara answers: It was nevertheless necessary to derive this halakha for the case of teruma, because it cannot be derived from the statement of Rabbi Yoḥanan. This is as it might enter your mind to say: It is a slave who cannot serve as an agent to receive a bill of divorce, since he cannot release a woman by divorce at all; but a gentile, since he is included in his own teruma, as we learned in a mishna (Terumot 3:9): A gentile or a Samaritan who separated teruma from their own produce, their teruma is considered teruma, despite the fact that they are not obligated to do so, I will say that he can also be appointed as an agent. To counter this argument, the term “you also” teaches us that only members of the covenant can act as agents for separating teruma; gentiles cannot.