In the general case, the prediction of localized corrosion damage can be made in statistical terms, for example, probability that the deepest pit will exceed a critical depth. However, the statistical parameters (mean depth of the deepest pit with its standard deviation, etc.) can be estimated deterministically (i.e. on the basis of the natural laws). In order to perform such a calculation, we require deterministic models for every stage of cavity propagation (pit nucleation, propagation and repassivation, transition pit into crack, crack propagation, etc.). Such an approach has been illustrated in this paper by predicting pitting damage in oil and gas pipelines. It is shown that repassivation phenomena, leading to pit repassivation (death), must be taken into account, in order to explain some experiential observations and to improve prediction of corrosion damage in pipelines by using results of short term experiments. Manipulation of the value of repassivation constant would seem to be the promising way of preventing pipeline failures.