Equity can be defined as the use of a more flexible, morally judgmental, and subjective mode of legal decision making that roughly corresponds with historical equity. This Element presents a simple contracting model that captures the role of equity as a safety valve, and shows how it can solve problems posed by opportunists–agents with unusual willingness and ability to take advantage of necessary imperfections in the law. In this model, a simple but imperfect formal legal regime is able to achieve first best in the absence of opportunists. But when opportunists are added, a more flexible regime (equity), can be preferred. However, equity is also vulnerable to being used opportunistically by the parties it intends to protect. Hence, the Element shows that it is often preferable to limit equity, reserving it for use only against those who appear sufficiently likely to be opportunists.