Joshua 9:18

And the children of Israel smote them not, because the princes of the congregation had sworn unto them by the LORD God of Israel. And all the congregation murmured against the princes.

Israel did not attack or strike the Gibeonites because the princes of the congregation had sworn to them by the Lord God of Israel to preserve them. That oath was honored even though the agreement and treaty had been obtained through deception. The whole congregation murmured and protested against the princes over the decision to spare the Gibeonites.

The Gibeonites renounced their heathenism, were joined to and accepted among Israel, and shared in the blessings of the covenant. Keeping the oath did not require Israel to disobey God's command against the idolatrous Canaanites, because the Gibeonites had pledged to renounce idolatry and worship Jehovah. An oath or pledge must be kept when it does not bind a person to do wrong; deception in obtaining it does not make it right to break it, and neither gain, revenge, nor self-interest can cancel its obligation.