According to the Old Testament, Rahab hid Israelite spies in Jericho.
Joshua 2 describes Rahab as a woman living in Jericho who sheltered two spies sent by Joshua. When the king of Jericho demanded that she surrender them, Rahab hid the men under stalks of flax on her roof and sent the searchers in another direction.
Rahab said she had heard how the God of Israel had helped the Israelites, including the crossing of the Red Sea. In return for her protection, the spies promised safety for Rahab and her family when Jericho was attacked.
The story says Rahab marked her household with a scarlet cord so the Israelites would recognize it. She is therefore associated with both the Jericho spies and the scarlet cord.