The king  and all the people made an agreement to go in the way of the Lord

Covenant people

And the king took his place by the pillar, and made an agreement before the Lord, to go in the way of the Lord, and keep his orders and his decisions and his rules with all his heart and all his soul, and to keep the words of the agreement recorded in the book; and all the people gave their word to keep the agreement.
2 Kings 23:3