15 Then she let them down by a rope through the window, for her house was built into the city wall, so that she lived in the wall. 16 And she said[1] to them, "Go into the hills, or the pursuers will encounter you, and hide there three days until the pursuers have returned. Then afterward you may go your way." 17 The men said to her, "We will be guiltless with respect to this oath of yours that you have made us swear. 18 Behold, when we come into the land, you shall tie this scarlet cord in the window through which you let us down, and you shall gather into your house your father and mother, your brothers, and all your father's household.

Matthew Henry's Commentary on Joshua 2:15-18

Commentary on Joshua 2:8-21

(Read Joshua 2:8-21)

Rahab had heard of the miracles the Lord wrought for Israel. She believed that his promises would certainly be fulfilled, and his threatenings take effect; and that there was no way of escape but by submitting to him, and joining with his people. The conduct of Rahab proved that she had the real principle of Divine faith. Observe the promises the spies made to her. The goodness of God is often expressed by his kindness and truth, Psalm 117:2; in both these we must be followers of him. Those who will be conscientious in keeping promises, are cautious in making them. The spies make needful conditions. The scarlet cord, like the blood upon the doorpost at the passover, recalls to remembrance the sinner's security under the atoning blood of Christ; and that we are to flee thereto for refuge from the wrath of a justly offended God. The same cord Rahab used for the saving of these Israelites, was to be used for her own safety. What we serve and honour God with, we may expect he will bless, and make useful to us.