We consider nonparametrically estimating a parameter of interest under the constraint that a functional of the parameter is bounded. We define the unconstrained parameter as the minimizer of the expectation of a loss function over the unconstrained parameter space, allowing that the constraint functional depend on the unknown distribution of the data, thus making it unknown. We characterize the constrained functional parameter as a penalized expectation of a loss function and characterize the minimizer over the unconstrained parameter space as a quantity dependent on the canonical gradients of the expectation of the loss function and the constraint functional. Further, we show that when closed-form solutions are attainable, these may be used to define a path through the unconstrained parameter space that may be used to iterate toward a solution that satisfies the desired constraint. We present this approach in light of both prediction problems where we construct optimal ensemble learners via cross-validation and in the estimation of causal effects under arbitrary constraints that encode desirable social intuitions – thereby providing a mechanism for fair learning and inference. This is joint work with Mark van der Laan.