This paper explores the conditions under which compliance with a social contract establishes an equilibrium in a society. It is assumed that society consists of two groups, one of which has a comparative advantage in using violence, whereas the other one has a comparative advantage in producing a private good. Violence can be used to produce security as well as to exploit the weaker group. Yet, exploitation is limited: it reduces the incentives of the exploited group to produce the private good and increases the chances of a revolution. A social contract consists of the exchange of security against a share of the private good, produced at a high level of effort. The model not only allows the derivation of conditions for either compliance or exploitation to occur, but also sheds light on the transition from one form of government to the other. Hence, it contributes to Positive Constitutional Economics, i.e., the research program that is interested in explaining the emergence and the change of constitutions.