Contract theory is a framework used to understand how economic agents formulate agreements and the implications of those agreements for incentives and behavior. This theory examines how contracts can be designed to mitigate issues such as moral hazard, where one party may take risks because they do not bear the full consequences, or principal-agent problems, where the interests of the principal (the one who delegates) may not align with those of the agent (the one who acts on behalf of the principal).