Financial risk measurement relies on models of prices and other market variables, but models inevitably rely on imperfect assumptions and estimates, creating model risk. Moreover, optimization decisions, such as portfolio selection, amplify the effect of model error. In this work, we develop a framework for quantifying the impact of model error and for measuring and minimizing risk in a way that is robust to model error. This robust approach starts from a baseline model and finds the worstcase error in risk measurement that would be incurred through a deviation from the baseline model, given a precise constraint on the plausibility of the deviation. Using relative entropy to constrain model distance leads to an explicit characterization of worst-case model errors; this characterization lends itself to Monte Carlo simulation, allowing straightforward calculation of bounds on model error with very little computational effort beyond that required to evaluate performance under the baseline nominal model. This approach goes well beyond the effect of errors in parameter estimates to consider errors in the underlying stochastic assumptions of the model and to characterize the greatest vulnerabilities to error in a model.We apply this approach to problems of portfolio risk measurement, credit risk, delta hedging and counterparty risk measured through credit valuation adjustment.