TT #90 · Parashas Shoftim · Second Aliyah · Passuk 17:15
You shall surely set over yourself a king whom the Eternal your God will choose; from among your brethren you shall set a king over yourself; you may not place over yourself a foreigner who is not your brother.
Torah Temimah points to Sifrei Devarim 157.
TT lemma: לֹא תוּכַל לָתֵת עָלֶיךָ אִישׁ נׇכְרִי.
English: ‘You may not place over yourself a foreigner’ – this includes all appointments of authority in Yisrael.
Derash expanding the prohibition (Sifrei) — the ban on a foreigner applies to every position of authority.
No foreigner may be placed in any position of coercive authority over Yisrael. The rule is not limited to the king alone.