abstract In this article, we use Transaction Cost Economics (TCE) and the Resource-Based View (RBV) of the firm to study outsourcing agreements. We develop an original approach of contract complexity and analyse the links among exchange hazards (i.e. specificity and environmental uncertainty), the contractual aspects of outsourcing (control, incentives, penalties, price and flexibility clauses) and the level of ex post transaction costs. Both contract complexity and ex post transaction costs are operationalized and measured. Our empirical research analyses 82 outsourcing contracts. This article uses three different dimensions (proximity to the core business, switching costs and adaptation costs) to assess the strategic importance of an outsourced activity. Our findings extend TCE's validity for the outsourcing of activities with a strategic value. Finally, this study offers an indirect measurement of ex post transaction costs. In short, to restrict vendor opportunism, contracts must contain incentives and penalties, as well as pricing and monitoring clauses.