In ancient times, vows from both parties secured a treaty between individuals or nations. Israel's promise was in a song of witness that Moses composed under divine inspiration (31:19–22).
Israel probably sang the song during a regular covenant-renewal ceremony (31:21). They invoked upon themselves the covenant's judgments and reminded themselves of its promises.