Leviticus 25:39-26:9
If your kinsman under you continues in straits and must give himself over to you, do not subject him to the treatment of a slave. He shall remain with you as a hired or bound laborer; he shall serve with you only until the jubilee year. Then he and his children with him shall be free of your authority; he shall go back to his family and return to his ancestral holding. For they are My servants, whom I freed from the land of Egypt; they may not give themselves over into servitude. You shall not rule over him ruthlessly; you shall fear your God. Such male and female slaves as you may have--it is from the nations round about you that you may acquire male and female slaves. You may also buy them from among the children of aliens resident among you, or from their families that are among you, whom they begot in your land. These shall become your property: you may keep them as a possession for your children after you, for them to inherit as property for all time. Such you may treat as slaves. But as for your Israelite kinsmen, no one shall rule ruthlessly over the other.
If a resident alien among you has prospered, and your kinsman being in straits, comes under his authority and gives himself over to the resident alien among you, or to an offshoot of an alien's family, he shall have the right of redemption even after he has given himself over. One of his kinsmen shall redeem him, or his uncle or his uncle's son shall redeem him, or anyone of his family who is of his own flesh shall redeem him; or, if he prospers, he may redeem himself. He shall compute with his purchaser the total from the year he gave himself over to him until the jubilee year; the price of his sale shall be applied to the number of years, as though it were for a term as a hired laborer under the other's authority. If many years remain, he shall pay back for his redemption in proportion to his purchase price; and if few years remain until the jubilee year, he shall so compute: he shall make payment for his redemption according to the years involved. He shall be under his authority as a laborer hired by the year; he shall not rule ruthlessly over him in your sight. If he has not been redeemed in any of those ways, he and his children with him shall go free in the jubilee year. For it is to Me that the Israelites are servants: they are My servants, whom I freed from the land of Egypt, I the Lord your God.
You shall not make idols for yourselves, or set up for yourselves carved images or pillars, or place figured stones in your land to worship upon, for I the Lord am your God. You shall keep My sabbaths and venerate My sanctuary, Mine, the Lord's.
If you follow My laws and faithfully observe My commandments, I will grant your rains in their season, so that the earth shall yield its produce and the trees of the field their fruit. Your threshing shall overtake the vintage, and your vintage shall overtake the sowing; you shall eat your fill of bread and dwell securely in your land.
I will grant peace in the land, and you shall lie down untroubled by anyone; I will give the land respite from vicious beasts, and no sword shall cross your land. You shall give chase to your enemies, and they shall fall before you by the sword. Five of you shall give chase to a hundred, and a hundred of you shall give chase to ten thousand; your enemies shall fall before you by the sword.
I will look with favor upon you, and make you fertile and multiply you; and I will maintain My covenant with you.