Comment: 45 pagesWe study a generic principal-agent problem in continuous time on a finite time horizon. We introduce a framework in which the agent is allowed to employ measure-valued controls and characterise the continuation utility as a solution to a specific form of a backward stochastic differential equation driven by a martingale measure. We leverage this characterisation to prove that, under appropriate conditions, an optimal solution to the principal's problem exists, even when constraints on the contract are imposed. In doing so, we employ compactification techniques and, as a result, circumvent the typical challenge of showing well-posedness for a degenerate partial differential equation with potential boundary conditions, where regularity problems often arise.