We obtain a recursive formulation for a general class of optimization problems with forward‐looking constraints which often arise in economic dynamic models, for example, in contracting problems with incentive constraints or in models of optimal policy. In this case, the solution does not satisfy the Bellman equation. Our approach consists of studying a recursive Lagrangian. Under standard general conditions, there is a recursive saddle‐point functional equation (analogous to a Bellman equation) that characterizes a recursive solution to the planner's problem. The recursive formulation is obtained after adding a co‐state variable μt summarizing previous commitments reflected in past Lagrange multipliers. The continuation problem is obtained with μt playing the role of weights in the objective function. Our approach is applicable to characterizing and computing solutions to a large class of dynamic contracting problems.