Devarim 20:16 reads:
טז. רַק מֵעָרֵי הָעַמִּים הָאֵלֶּה אֲשֶׁר יְהֹוָה אֱלֹהֶיךָ נֹתֵן לְךָ נַחֲלָה לֹא תְחַיֶּה כָּל נְשָׁמָה׃
However, of these peoples' cities, which the Lord, your God, gives you as an inheritance, you shall not allow any soul to live.
Yet we see in Yehoshua 2:14-19 that the spies promised to save Rachav and her family.
How did they have authority to promise this?