God had not prohibited the Israelites from entering into a covenant with people outside of Canaan. However, they were not allowed to do so with the people living in the Promised Land (see Exodus 34:11–12; Deuteronomy 20:10–18). Perhaps the Gibeonites knew about this prohibition, which is why they went to elaborate lengths to make it appears as if they came from far away.1
15 And Joshua made peace with them and made a covenant with them, to let them live, and the leaders of the congregation swore to them.