An agreement or contract made among a group of people is called a social contract. Social contracts have existed throughout time. A social contract does not necessarily have to be written. It can be implied and understood between the parties involved.
One notable thinker of the Age of Enlightenment was Thomas Hobbes. He believed that peopled needed governments to impose order and that people in a society should agree to give up some freedoms to a stronger power in exchange for peace and safety. Hobbes called this exchange between society and government the social contract. The Magna Carta (1215) is one of the earliest social and political contracts.
Jean-Jacques Rousseau believed that government should work for the benefit of the common good, not just for the wealthy.
What then is government? It is an intermediary body established between the subjects and the sovereign . . .
—Jean Jacques Rousseau, The Social Contract, 1763